claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Persistent API Error After Teleporting Session

Open J268sing opened this issue 3 months ago • 11 comments

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?

After using claude --teleport session_011CUpE6ZSg5RQbETyMDpZha, every subsequent command results in a 400 API error about malformed tool_result blocks.

What Should Happen?

Teleporting should transfer the session cleanly without corrupting conversation state.

Actual Behavior: Session state corruption that persists even after reinstalling Claude Code.

Error Messages/Logs

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.48.content.0: unexpected tool_use_id found in tool_result blocks: toolu_01XmC5ysqAiDPKb5kABUiSCi. Each tool_result block must have a corresponding tool_use block in the previous message."}}

Steps to Reproduce

  1. Start a Claude Code session
  2. Used claude --teleport session_011CUpE6ZSg5RQbETyMDpZha
  3. Attempted to run any command
  4. Received 400 error on every message

Troubleshooting Attempted:

  • ✅ Exited and restarted Claude Code
  • ✅ Killed all Claude processes
  • ✅ Uninstalled and reinstalled Claude Code
  • ✅ Tried in different directories
  • ❌ Error persists

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.0.33 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

J268sing avatar Nov 05 '25 07:11 J268sing

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/11017
  2. https://github.com/anthropics/claude-code/issues/11026
  3. https://github.com/anthropics/claude-code/issues/8484

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Nov 05 '25 07:11 github-actions[bot]

I am facing the same issue.

Claude Code Version 2.0.34 (Claude Code)

Operating System macOS

Terminal/Shell ghostty

Error

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.50.content.0: unexpected
    `tool_use_id` found in `tool_result` blocks: toolu_019LH462QgZAC98M7ibbQJ8H. Each `tool_result` block must have a corresponding
     `tool_use` block in the previous message."},"request_id":"req_011CUr7Tku1wHmUS2JcBrcup"}

kenryu42 avatar Nov 06 '25 05:11 kenryu42

Same issue

thedaviddias avatar Nov 07 '25 15:11 thedaviddias

Same issue, also on MacOS using Ghostty

Session was teleported from a Claude Code Web session

leefowlercu avatar Nov 07 '25 18:11 leefowlercu

Hello, can someone look into this please? I have the same issue every time continuing session by using teleport from Claude Code web. Thanks

ngannguyen-nvn avatar Nov 08 '25 14:11 ngannguyen-nvn

This issue is still present on v2.0.37.

adamrothman avatar Nov 12 '25 03:11 adamrothman

I have never once gotten teleport to work. Every time I get the API 400 error.

smartwatermelon avatar Nov 23 '25 23:11 smartwatermelon

This issue still persists on v2.0.53.

fakade2 avatar Nov 25 '25 08:11 fakade2

This issue still persists on v2.0.55.

waterbang avatar Dec 01 '25 13:12 waterbang

This issue still persists on v2.0.69

weidwonder avatar Dec 15 '25 06:12 weidwonder

This issue still persists on v2.0.72

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.24.content.3: unexpected `tool_use_id` found in `tool_result` blocks: toolu_01LLjDFcWxGyYvTh5PchmaNu. Each `tool_result` block must have a corresponding `tool_use` block in the previous message."},"request_id":"req_011CWJ2roFn4MhGgseytCTx2"}

My current workaround is to /export the conversation to clipboard, then paste it in a new session.

madeyexz avatar Dec 20 '25 13:12 madeyexz