/context command fails after toggling thinking mode during conversation
Resolved 💬 3 comments Opened Nov 23, 2025 by garrettmoss Closed Nov 26, 2025
Bug Description
The /context command fails with an API error when it's used in a conversation where thinking mode has been toggled on/off during the session.
Steps to Reproduce
- Start a new conversation with thinking mode enabled
- Have some back-and-forth conversation with thinking blocks
- Toggle thinking mode off (via settings or
/config) - Continue conversation without thinking blocks
- Toggle thinking mode back on
- Run the
/contextcommand
Expected Behavior
The /context command should work regardless of thinking mode toggle history in the conversation.
Actual Behavior
The command fails with a 400 API error:
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.73.content.0.type: Expected `thinking` or `redacted_thinking`, but found `text`. When `thinking` is enabled, a final `assistant` message must start with a thinking block. 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_011CVPvrUtagodkzBXf4dq6p"}
The error indicates that the conversation history contains a mix of messages with and without thinking blocks, which violates the API requirement when thinking mode is currently enabled.
Impact
- Cannot use
/contextin conversations where thinking mode was toggled - Forces users to start new conversations to regain
/contextfunctionality - Limits flexibility in using thinking mode during long conversations
- Breaks user workflow when they want to analyze conversation context
Suggested Fixes
- Normalize conversation history: When
/contextreplays conversation to API, strip or convert thinking blocks to match current thinking mode setting - Warn users: Display a warning when toggling thinking mode that certain commands like
/contextmay break - Persist mode choice: Prevent thinking mode changes mid-conversation, or track mode per message and replay accordingly
- Graceful degradation: Have
/contextfall back to summarization or partial context when full replay fails
Environment
- Claude Code version: 2.0.5
- Platform: macOS Sequoia 15.6.1
- Interface: VSCode extension
Workaround
Currently, the only workaround is to start a new conversation with a consistent thinking mode setting.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗