claude-code - 💡(How to fix) Fix Remote-control session produces parallel divergent responses when resumed in VS Code [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49246Fetched 2026-04-17 08:46:41
View on GitHub
Comments
2
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×5commented ×2
RAW_BUFFERClick to expand / collapse

Bug Description

When a session initiated via a claude remote-control server is opened in VS Code while still active on the originating client (mobile browser), both clients begin generating independent response streams simultaneously. The two streams write interleaved entries into the same JSONL transcript file, producing two completely different reasoning chains for the same user message.

Steps to Reproduce

  1. Start a remote control server with claude remote-control --name "Test"
  2. Initiate a session from a mobile device and begin a multi-step conversation
  3. While the session is mid-response, open VS Code and resume the same session from the chat history
  4. Observe that from the attachment point onward, two independent assistant responses are generated in parallel

Observed Behavior

  • The JSONL transcript contains interleaved entries from both sdk-cli and claude-vscode entrypoints
  • Each stream generates its own independent reasoning, tool calls, and conclusions
  • The two streams are unaware of each other — neither references or defers to the other's output
  • The mobile client and VS Code client each display only their own stream, so the user sees two different conversations diverging from the same point
  • One stream had different tool access than the other (e.g., one could run Bash, the other could not), leading to substantially different approaches

Expected Behavior

The session should behave like a shared conversation (similar to iMessage or a Gmail thread) — one unified conversation displayed across both devices, with a single response stream regardless of how many clients are viewing it.

Environment

  • macOS
  • Claude Code CLI + VS Code extension
  • Session started via claude remote-control

extent analysis

TL;DR

To fix the issue, implement a mechanism to synchronize and merge response streams from different clients, ensuring a unified conversation across all devices.

Guidance

  • Identify a unique session identifier that can be shared across all clients (e.g., mobile browser, VS Code) to associate responses with the same conversation.
  • Develop a locking or synchronization mechanism to prevent concurrent writing to the JSONL transcript file, ensuring that only one client can write at a time.
  • Consider implementing a pub-sub architecture or a centralized server to manage and broadcast responses to all connected clients, ensuring a single source of truth for the conversation.
  • Investigate using a more robust data storage solution, such as a database, to store conversation history and responses, rather than a JSONL file.

Example

// Example of a session identifier object
{
  "sessionId": "unique-session-id",
  "clients": ["mobile-browser", "vs-code"]
}

Notes

The current implementation relies on a JSONL file for storing conversation history, which may not be suitable for multi-client conversations. A more robust solution may require significant changes to the underlying architecture.

Recommendation

Apply a workaround by implementing a synchronization mechanism, such as a locking system, to prevent concurrent writing to the JSONL file, and consider migrating to a more robust data storage solution in the long term. This will help ensure a unified conversation across all devices, although it may not fully address the underlying architectural issues.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING