[BUG] readBridgePointer is dead code in bridgeMain — env_id never reused, no headless way to resume historical chats

Resolved 💬 3 comments Opened May 5, 2026 by bornsl0ppy Closed May 9, 2026

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:

  1. readBridgePointer is defined but has zero call sites — verified with grep -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 }).

  1. 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

  1. claude remote-control --remote-control-session-name-prefix foo (no --resume, no --spawnsame-dir mode).
  2. Open env URL in iOS, send messages — works.
  3. Restart the process.
  4. 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
...
};
`
Pointer write only fires in single-session mode (≈120127497) — so
same-dir writes nothing — and readBridgePointer` is never called in any mode.

### Asks

  1. Wire readBridgePointer → reuseEnvironmentId in bridgeMain:

``js
let qH;
try { qH = (await readBridgePointer(J))?.environmentId; } catch {}
`
Plus extend the pointer-write block to fire in
same-dir` too.

  1. 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_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗