/remote-control fails with 400 'Failed to convert session context' when system prompt is large

Resolved 💬 3 comments Opened Mar 2, 2026 by Budgulick Closed Mar 30, 2026

Bug Description

/remote-control consistently fails with HTTP 400 Failed to convert session context when the combined system prompt (CLAUDE.md files, hooks, MCP server instructions, plugins) exceeds a certain size threshold. The feature works in smaller projects but fails in projects with extensive configuration.

Environment

  • Claude Code version: v2.1.63
  • Model: Opus 4.6 (Claude Max)
  • OS: Windows 11 Pro 10.0.26200
  • Shell: Git Bash

Steps to Reproduce

  1. Configure a project with a moderately large system prompt:
  • User-level ~/.claude/CLAUDE.md (~19K chars)
  • Project-level CLAUDE.md (~14K chars)
  • Auto-memory MEMORY.md (~4K chars)
  • SessionStart hooks that inject additional context (~14K chars)
  • MCP servers with instructions (Claude in Chrome, Microsoft Learn)
  • Plugin (Superpowers) that adds skill descriptions to system prompt
  1. Open a fresh Claude Code session (no prior conversation)
  2. Type /remote-control
  3. Observe "Remote Control failed" in the status line

Expected Behavior

Remote control either works, or provides an actionable error message indicating what the limit is and which part of the context is too large.

Actual Behavior

The bridge registers the environment successfully (HTTP 200), then immediately fails session creation with HTTP 400. No user-facing details about what failed.

From debug log (~/.claude/debug/<session-id>.txt):

[bridge:repl] initReplBridge #1 starting (initialMessages=0)
[bridge:api] POST /v1/environments/bridge -> 200 environment_id=env_...
[bridge] Session creation failed with status 400: Failed to convert session context
[bridge:repl] Session creation failed, deregistering environment
[bridge:repl] Init returned null (precondition or session creation failed)

Key Observations

  • Fails on a brand-new session with zero conversation messages (the 9 system messages alone trigger it)
  • The same account and user-level config works with a different project that has less total context
  • The estimated total system context is ~90,000+ characters across all sources
  • The error message Failed to convert session context provides no information about what the limit is, which component is too large, or what the user can do to fix it

Suggested Improvements

  1. Actionable error message: Include the size limit and actual size in the error, e.g., "Session context is X tokens but the limit is Y"
  2. Graceful degradation: Truncate or summarize context rather than hard-failing
  3. Documentation: Document the remote control context size limit so users can plan their configurations accordingly

View original on GitHub ↗

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