Skip to content

feat: open background sessions with claude attach - #174

Merged
brtkwr merged 1 commit into
mainfrom
feat/background-sessions
Oct 30, 2026
Merged

brtkwr merged 1 commit into
mainfrom
feat/background-sessions

Conversation

@brtkwr

@brtkwr brtkwr commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

Option 0 from the relay design (docs/design/relay.md): Claude Code's own claude --bg does the delegating, and ccs makes those sessions visible and openable.

  • Detection: every 10s the live tick runs claude agents --json (0.3s, off the UI thread) and keeps the kind: background sessions with their short id and state. If the call fails (no claude, or one too old for agents), ccs keeps its last answer.
  • List: background sessions keep ●, because unlike T3 Code's sessions they can be opened, and show bg working / bg blocked on the grey row.
  • Enter: opens claude attach <id> in a new tmux window or iTerm tab, never in place. Without either, ccs says to run the command yourself.
  • ^X K: pressed twice within 5s, runs claude stop <id>.
  • Nesting: a session started by another's claude --bg nests under it, as claude -p ones already do.

Tested with fake claude and tmux binaries; there were no background sessions on this machine to try for real.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QUnP8jVL2NG9cWmohJTyun

ccs asks claude agents --json every 10s for background sessions (claude
--bg). They show "bg <state>" and keep ●: Enter opens claude attach <id>
in a new tmux window or iTerm tab, ^X K twice stops one, and a session
started by another's claude --bg nests under it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QUnP8jVL2NG9cWmohJTyun
@brtkwr
brtkwr enabled auto-merge October 30, 2026 09:38
@brtkwr
brtkwr merged commit 24f20bc into main Oct 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant