-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclaude-tmux-start.sh
More file actions
26 lines (22 loc) · 948 Bytes
/
Copy pathclaude-tmux-start.sh
File metadata and controls
26 lines (22 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/bash
#
# claude-tmux-start.sh
# Launches Claude Code inside a detached tmux session on a dedicated socket,
# then auto-enables Remote Control so the phone's Claude App sees the session.
#
# Deploy to: ~/bin/claude-tmux-start.sh (chmod +x)
# Invoked by: ~/.config/systemd/user/claude-android.service
#
# IMPORTANT: Replace /home/$USER/.local/bin/claude with the absolute path
# from `which claude` on your system. systemd's default PATH does NOT
# include ~/.local/bin, so you MUST use the full absolute path here.
setsid /usr/bin/tmux -L android new-session -d -s android \
-c "$HOME/claude-vm" \
'/home/$USER/.local/bin/claude' \
< /dev/null > /dev/null 2>&1 &
# Give Claude Code 5s to fully load before sending the slash command.
# Sending too early lands in the loading screen and gets ignored (or worse,
# gets treated as a user prompt).
sleep 5
/usr/bin/tmux -L android send-keys -t android "/remote-control on" Enter
exit 0