/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

  1. Start a new conversation with thinking mode enabled
  2. Have some back-and-forth conversation with thinking blocks
  3. Toggle thinking mode off (via settings or /config)
  4. Continue conversation without thinking blocks
  5. Toggle thinking mode back on
  6. Run the /context command

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 /context in conversations where thinking mode was toggled
  • Forces users to start new conversations to regain /context functionality
  • Limits flexibility in using thinking mode during long conversations
  • Breaks user workflow when they want to analyze conversation context

Suggested Fixes

  1. Normalize conversation history: When /context replays conversation to API, strip or convert thinking blocks to match current thinking mode setting
  2. Warn users: Display a warning when toggling thinking mode that certain commands like /context may break
  3. Persist mode choice: Prevent thinking mode changes mid-conversation, or track mode per message and replay accordingly
  4. Graceful degradation: Have /context fall 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗