remote-control: resume/surface prior session for a directory on restart
Summary
When claude remote-control --spawn=same-dir runs as a persistent server (e.g. supervised in a tmux loop on a remote dev box) and the server process restarts — box reboot, supervisor relaunch, etc. — it always pre-creates a new session and points ~/.claude/projects/<dir>/bridge-pointer.json at it. The previous session's transcript persists on disk (~/.claude/projects/<dir>/<id>.jsonl) but is no longer surfaced as the active session in claude.ai/code, so users perceive their in-flight work as "gone."
The work is recoverable (claude --resume <id> in that directory, or the session picker), but not automatically, and the default/active session after a restart is always a fresh one.
Repro
- Run
claude remote-control --name X --spawn=same-dir --permission-mode autoas a long-lived server in a directory, supervised so it relaunches if it exits. - Connect from claude.ai/code, do substantial work in the auto-created session (transcript grows under
~/.claude/projects/<dir>/). - Restart the host / the RC server process.
- The RC server comes back with a freshly pre-created session ("New sessions will be created in the current directory"). The prior session is on disk but not the active/surfaced one.
Request
A way for claude remote-control to resume or re-surface the most recent on-disk session for its directory on start. For example:
- a
--resume-last/--continueflag forremote-control, or - making the claude.ai/code session list rehydrate from on-disk transcripts for the server's cwd so prior sessions are selectable after a server restart.
Notes
remote-control --help currently exposes no resume/continue option (only --name, --remote-control-session-name-prefix, --permission-mode, --spawn, --capacity, --[no-]create-session-in-dir, --debug-file, --verbose).
Environment
- Claude Code v2.1.177
- Headless Linux dev box (Coder workspace), RC supervised in a tmux loop
claude remote-control --spawn=same-dir --permission-mode auto
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗