claude-code - 💡(How to fix) Fix Remote Control bridge registration returning 502 — server mode unusable [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#48712Fetched 2026-04-16 06:53:05
View on GitHub
Comments
2
Participants
2
Timeline
9
Reactions
0
Timeline (top)
labeled ×4commented ×2cross-referenced ×2closed ×1

claude remote-control (server mode) has been unable to register with the bridge API since ~15:44 UTC on April 15, 2026. The POST /v1/environments/bridge endpoint consistently returns 502 Bad Gateway. Regular Claude Code sessions (including those with /remote-control or --rc) work fine — only the server-mode bridge registration is affected.

Error Message

[bridge:init] apiBaseUrl=https://api.anthropic.com sessionIngressUrl=https://api.anthropic.com [bridge:api] POST /v1/environments/bridge bridgeId=... Error: Request failed with status code 502

Root Cause

claude remote-control (server mode) has been unable to register with the bridge API since ~15:44 UTC on April 15, 2026. The POST /v1/environments/bridge endpoint consistently returns 502 Bad Gateway. Regular Claude Code sessions (including those with /remote-control or --rc) work fine — only the server-mode bridge registration is affected.

Code Example

# Direct curl test confirms the endpoint is down:
curl -s -w "\nHTTP_CODE: %{http_code}\n" \
  -X POST https://api.anthropic.com/v1/environments/bridge \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "anthropic-beta: environments-2025-11-01" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"machine_name":"test","directory":"/root","branch":"HEAD","max_sessions":32}'
# Returns: 502 Bad Gateway

---

curl -s -X GET https://api.anthropic.com/v1/sessions \
  -H "Authorization: Bearer $TOKEN" \
  -H "anthropic-beta: managed-agents-2026-04-01" \
  -H "anthropic-version: 2023-06-01"
# Returns: 200 OK

---

[bridge:init] apiBaseUrl=https://api.anthropic.com sessionIngressUrl=https://api.anthropic.com
[bridge:api] POST /v1/environments/bridge bridgeId=...
Error: Request failed with status code 502
RAW_BUFFERClick to expand / collapse

Summary

claude remote-control (server mode) has been unable to register with the bridge API since ~15:44 UTC on April 15, 2026. The POST /v1/environments/bridge endpoint consistently returns 502 Bad Gateway. Regular Claude Code sessions (including those with /remote-control or --rc) work fine — only the server-mode bridge registration is affected.

Environment

  • Claude Code version: 2.1.109 (latest)
  • OS: Ubuntu Linux (headless server)
  • Auth: claude.ai OAuth, Max subscription (confirmed with claude auth status)
  • Setup: systemd service running claude remote-control --name "Home Server" --spawn same-dir --permission-mode dontAsk --verbose
  • This setup has been working reliably for weeks prior to this incident.

Reproduction

# Direct curl test confirms the endpoint is down:
curl -s -w "\nHTTP_CODE: %{http_code}\n" \
  -X POST https://api.anthropic.com/v1/environments/bridge \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "anthropic-beta: environments-2025-11-01" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"machine_name":"test","directory":"/root","branch":"HEAD","max_sessions":32}'
# Returns: 502 Bad Gateway

Meanwhile, the sessions API works fine:

curl -s -X GET https://api.anthropic.com/v1/sessions \
  -H "Authorization: Bearer $TOKEN" \
  -H "anthropic-beta: managed-agents-2026-04-01" \
  -H "anthropic-version: 2023-06-01"
# Returns: 200 OK

Timeline (all times EEST = UTC+3)

  1. 15:44 — Running bridge process (PID from previous day) had all 12 active sessions fail simultaneously with timeouts
  2. 16:01 — Auto-update installed v2.1.109, service restarted
  3. 16:01–16:35 — Service registered but immediately entered reconnection loop (poll timeouts + 503s)
  4. 16:35 onwards — Service crashes on startup, unable to register bridge. Restart loop (100+ attempts)
  5. 21:15 — Still failing. Confirmed with direct curl: POST /v1/environments/bridge → 502

Debug log output

[bridge:init] apiBaseUrl=https://api.anthropic.com sessionIngressUrl=https://api.anthropic.com
[bridge:api] POST /v1/environments/bridge bridgeId=...
Error: Request failed with status code 502

Alternates between 500, 502, 503, and timeout of 15000ms exceeded.

Impact

Remote Control server mode is the only way to run Claude Code headlessly and spawn sessions from the browser/mobile without an active terminal. This is a key workflow for headless server deployments. The status page (status.claude.com) shows "All Systems Operational" despite this endpoint being down for 5+ hours.

What's NOT the issue

  • ✅ Auth is valid (OAuth, Max subscription, correct scopes)
  • ✅ No ANTHROPIC_API_KEY set
  • ✅ No conflicting env vars (DISABLE_TELEMETRY, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, etc.)
  • ✅ Network is fine (other API endpoints respond normally)
  • ✅ Version is latest (2.1.109)
  • ✅ Config matches documentation exactly

extent analysis

TL;DR

The most likely fix is to wait for the POST /v1/environments/bridge endpoint to be restored or to contact the Anthropic API support team for assistance.

Guidance

  • Verify the status of the POST /v1/environments/bridge endpoint using the provided curl command to confirm if the issue persists.
  • Check the Anthropic API status page (status.claude.com) for any updates on the endpoint's status, although it may not always reflect the current status.
  • Consider reaching out to the Anthropic API support team for further assistance, as the issue seems to be related to their endpoint.
  • Review the debug log output for any patterns or clues that might indicate a specific cause for the failures.

Example

No code snippet is provided as the issue seems to be related to the Anthropic API endpoint and not the Claude Code configuration or code.

Notes

The issue seems to be related to the Anthropic API endpoint POST /v1/environments/bridge returning a 502 Bad Gateway error, which is outside of the control of the Claude Code configuration or code. The fact that other API endpoints respond normally suggests that the issue is specific to this endpoint.

Recommendation

Apply workaround: Contact the Anthropic API support team for assistance, as the issue seems to be related to their endpoint and not the Claude Code configuration or code. This is because the endpoint has been down for an extended period, and other API endpoints respond normally.

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