[BUG] readBridgePointer is dead code in bridgeMain — env_id never reused, no headless way to resume historical chats
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Two design gaps in claude remote-control standalone-server mode prevent headless deployments from preserving iOS / claude.ai-code chats across a
service restart:
readBridgePointeris defined but has zero call sites — verified withgrep -aobE 'readBridgePointer\(' claude(only matches the
definition readBridgePointer:()=>). The reuseEnvironmentId field on registerBridgeEnvironment is therefore always undefined, even though
the API call site supports it (...Y.reuseEnvironmentId && { environment_id: Y.reuseEnvironmentId }).
- No headless invocation resumes a historical chat as a bridge child. The subcommand rejects
--resume(`Error: Unknown argument:
--resume). The TUI flag form claude --resume <uuid> --remote-control exits with Error: No deferred tool marker found in the resumed session…--resume` is scoped to deferred-tool-call resumption, not chat-resumption-as-server.
—
Combined effect under systemd: env URL stays stable (server-side relay reuse on (machine_name, dir, account)), but every historical chat
tombstones — transcript visible, session counter increments, prompts silently drop. Surfaces as "Remote Control disconnected." Related: #52796.
- Claude Code: 2.1.128 (also 2.1.126); GIT_SHA
e44c1d97bd39 - linux-x64, Debian 13, OAuth (Max plan)
- Invocation:
claude remote-control --remote-control-session-name-prefix <prefix>under systemd
What Should Happen?
readBridgePointer should workxD
Error Messages/Logs
Steps to Reproduce
claude remote-control --remote-control-session-name-prefix foo(no--resume, no--spawn→same-dirmode).- Open env URL in iOS, send messages — works.
- Restart the process.
- Reopen the previous chat: visible, counter increments, prompts get no reply.
Code (offsets in 2.1.126 ELF)
bridgeMain registration (≈120124458):
``js`
let qH, zH = {
...,
environmentId: vJ$.randomUUID(),
reuseEnvironmentId: qH, // never assigned
...
};
same-dir
Pointer write only fires in single-session mode (≈120127497) — so writes nothing — and readBridgePointer` is never called in any mode.
### Asks
- Wire
readBridgePointer → reuseEnvironmentIdinbridgeMain:
``js`
let qH;
try { qH = (await readBridgePointer(J))?.environmentId; } catch {}
same-dir` too.
Plus extend the pointer-write block to fire in
- Add a "resume bridge session" headless mode (e.g.
claude remote-control --resume-bridge <session-uuid>) that spawns a sub-session bound to
the historical session_id so prompts route to a live process.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.128
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗