[BUG] Claude Code VS Code Extension — 400 error when extended thinking IDs are passed back to API
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?
When using the Claude Code VS Code extension with extended thinking enabled, the assistant generates thinking block IDs in the format thinking_0. When these IDs are referenced in subsequent API inputs (e.g., as tool result references or continuation messages), the API rejects them because it expects IDs beginning with rs., resulting in a 400 invalid_request_body error.
Error: Invalid 'input[83].id': 'thinking_0'. Expected an ID that begins with 'rs.'
Code: invalid_request_body / HTTP 400
GH Request Id: 5757:2731B4:FFD8A:10E9A0:6A27EDE3
Model: Raptor mini (Preview)
Context: Happens when Claude uses extended thinking blocks and the response is passed back to an API that requires tool result IDs prefixed with rs.
What Should Happen?
Thinking block IDs generated by the model (thinking_0, thinking_1, etc.) should either:
Be remapped to the expected rs.-prefixed format before being sent back to the API, or
Be excluded from inputs where the API does not accept them.
The conversation should continue without error.
Error Messages/Logs
Steps to Reproduce
- Open VS Code with the Claude Code extension installed.
- Start a conversation in the chat panel using a model with extended thinking enabled (e.g., Raptor mini Preview).
- Send a prompt that triggers a multi-step or tool-use response — especially one that produces a thinking block in the response.
- Either continue the conversation or trigger a retry after the thinking block is generated.
- Observe the 400 error: Invalid 'input[83].id': 'thinking_0'. Expected an ID that begins with 'rs.'
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.163.
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗