From b836174d5ad5e4ea36a5f456061a00862317375f Mon Sep 17 00:00:00 2001 From: yyamashita Date: Sun, 17 May 2026 11:02:19 +0900 Subject: Add Claude Code session management via post-receive hook Root's post-receive hook now calls scripts/sync-claude-services.sh to manage yyamashita's systemd user services on git push. Sessions are configured in claude-code-sessions.txt (user:repo format). Co-Authored-By: Claude Sonnet 4.6 --- systemd/user/claude-code@.service | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 systemd/user/claude-code@.service (limited to 'systemd') diff --git a/systemd/user/claude-code@.service b/systemd/user/claude-code@.service new file mode 100644 index 0000000..e3983b6 --- /dev/null +++ b/systemd/user/claude-code@.service @@ -0,0 +1,17 @@ +[Unit] +Description=Claude Code Remote Session (%i) +After=network.target + +[Service] +Type=oneshot +RemainAfterExit=yes +WorkingDirectory=/home/yyamashita/workspaces/repos/%i +ExecStart=/usr/bin/tmux new-session -d -s claude-%i -c /home/yyamashita/workspaces/repos/%i /usr/local/bin/claude --remote-control %i --dangerously-skip-permissions +ExecStop=/usr/bin/tmux kill-session -t claude-%i +Environment=HOME=/home/yyamashita +Environment=USER=yyamashita +Environment=XDG_RUNTIME_DIR=/run/user/1000 +Environment=TMUX_TMPDIR=/tmp + +[Install] +WantedBy=default.target -- cgit v1.2.3