[BUG] --teleport fails with "Session not found" despite valid session (claude.ai returns 403 to CLI)
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?
claude --teleport session_xxx always fails with "Session not found" even though the session is active and accessible on claude.ai/code.
The root cause appears to be that claude.ai API endpoints return HTTP 403 to non-browser HTTP clients, while api.anthropic.com endpoints work correctly with the same OAuth token.
Evidence:curl -H "Authorization: Bearer $TOKEN" "https://api.anthropic.com/v1/session_ingress/session/session_xxx" → Returns full session data with loglines ✅curl -H "Authorization: Bearer $TOKEN" "https://claude.ai/api/code/sessions" → HTTP 403 ❌
Same claude.ai URL in browser → Returns JSON normally ✅
claude --teleport (without ID, to list sessions) → "Error loading Claude Code sessions" ❌
The CLI appears to validate/fetch sessions via claude.ai endpoints (which get 403'd) rather than api.anthropic.com (which works fine).
What Should Happen?
claude --teleport <session_id> should successfully connect to and resume the web session. The CLI should either use api.anthropic.com endpoints (which work), or handle claude.ai 403 responses gracefully with a meaningful error message.
Error Messages/Logs
2026-02-08T05:29:48.335Z [DEBUG] Resuming code session ID: session_xxx
2026-02-08T05:29:48.623Z [ERROR] Error: Error: Session not found: session_xxx
at pxT (/$bunfs/root/claude:1931:39772)
at async ds (/$bunfs/root/claude:2879:1875)
at async Oy8 (/$bunfs/root/claude:6381:552)
at async E40 (/$bunfs/root/claude:6364:813)
at processTicksAndRejections (native:7:39)
2026-02-08T05:29:48.624Z [ERROR] TeleportOperationError: TeleportOperationError: Session not found: session_xxx
No HTTP request URL is logged between "Resuming code session ID" and the error — the fetch appears to fail silently.
Steps to Reproduce
- Start a Claude Code session on claude.ai/code (web interface)
- Copy the session ID from the URL (format: session_01Mhb...)
- In terminal, run
claude --teleport session_01Mhb... - Error: "Session not found"
- Verify the session is accessible via API: curl -H "Authorization: Bearer $(security find-generic-password -s 'Claude Code-credentials' -w | python3 -c "import sys,json; print(json.load(sys.stdin)['claudeAiOauth']['accessToken'])")" "https://api.anthropic.com/v1/session_ingress/session/<SESSION_ID>" — returns full session data
- Verify claude.ai is 403'd: curl -v -H "Authorization: Bearer $TOKEN" "https://claude.ai/api/code/sessions" — returns HTTP 403
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.37 (also tested 2.1.17 and 2.1.0 — same error)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
- Tested across multiple Claude Code versions (2.1.0, 2.1.17, 2.1.37)
- Tried re-authentication (claude logout → claude login) multiple times
- Tried switching DNS to Google (8.8.8.8) — no change
- Tried checking out the matching git branch — no change
- Location: Australia (Sydney) — possibly relevant to Cloudflare geo-blocking
10 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Opus tried to debug from the compiled claude
---
Root Cause Analysis
The --teleport feature works like this:
The API Flow
GET ${BASE_API_URL}/v1/sessions/${sessionId}
// i.e. https://api.anthropic.com/v1/sessions/<id>
GET ${BASE_API_URL}/v1/sessions
// i.e. https://api.anthropic.com/v1/sessions
The Bug
The CLI is using api.anthropic.com (not claude.ai), so the user's hypothesis about claude.ai endpoints being used is incorrect. However, the real issue is likely one of these:
validateStatus: ($) => $ < 500, so a 403 would actually fall through to the generic error path (Failed to fetch session: 403 Forbidden), not the "Session not found"
path. The fact that the user sees "Session not found" means the API is returning exactly 404.
session_ingress endpoint exists in the codebase too (for persisting session data), but it's not used for the teleport validation flow.
Key Finding
The user proved that GET /v1/session_ingress/session/<id> works, but the teleport code uses GET /v1/sessions/<id> which returns 404. This could be:
The claude.ai 403 is a red herring
The user also tested claude.ai/api/code/sessions which returns 403 - but the CLI never calls that endpoint. The CLI exclusively uses api.anthropic.com.
Recommendation
This is a server-side issue, not a client-side bug. The /v1/sessions/<id> endpoint returns 404 for sessions that are demonstrably accessible via /v1/session_ingress/session/<id>. Since this is the public open-source repo (docs/plugins/changelog only) and the actual CLI is a compiled binary, there's nothing to fix here. This should be escalated to the Anthropic backend team to investigate why the /v1/sessions/ endpoint returns 404 for valid sessions.
Also having this issue
same with version 2.1.34 (Claude Code)
Also having this issue
Also have this
installed @anthropic-ai/claude-code@2.1.39I am having this issue also.
Same currently on v2.1.39 but its been an issue for a few versions at least
Seems working again now with new 2.1.42 🥳
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.