[BUG] Getting "invalid_request_error" when typing '/context' command in middle of claude code session in Thinking mode
Resolved 💬 2 comments Opened Nov 1, 2025 by kshitij3027 Closed Nov 1, 2025
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 I try to check the context of my current load code session while I am developing, using the /context command, I get the below message ( this is specifically true just for when 'thinking' is on.)
⎿ Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.123.c
ontent.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking`
is enabled, a final `assistant` message must start with a thinking block (preceeding the
lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking
blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult
our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking"},"
request_id":"req_011CUhtTvqWjcnrbX8LXg49b"}
Steps to reproduce error:
- Start a Claude Code session and try to work on an existing application or build a new application.
- After a couple of messaging back-and-forth, type /context command in Claude Code session while thinking mode is on.
What Should Happen?
Claude should provide the output for the context command as it does when the thinking mode is off.
Error Messages/Logs
> /context
⎿ Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.123.c
ontent.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking`
is enabled, a final `assistant` message must start with a thinking block (preceeding the
lastmost set of `tool_use` and `tool_result` blocks). We recommend you include thinking
blocks from previous turns. To avoid this requirement, disable `thinking`. Please consult
our documentation at https://docs.claude.com/en/docs/build-with-claude/extended-thinking"},"
request_id":"req_011CUhtTvqWjcnrbX8LXg49b"}
Steps to Reproduce
Steps to reproduce error:
- Start a Claude Code session and try to work on an existing application or build a new application.
- After a couple of messaging back-and-forth, type /context command in Claude Code session while thinking mode is on.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.31 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗