[BUG]
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?
Claude Code Bug Report
Issue: 400 Error on /context command after resume from Ctrl+C
Date: 2025-11-09 Claude Code Version: Latest (as of Nov 9, 2025) Model: claude-sonnet-4-5-20250929[1m] Platform: Linux 6.14.0-35-generic
Summary
After interrupting a long-running session with Ctrl+C and resuming, the /context command immediately fails with a 400 error related to thinking block requirements in message structure.
Error Message
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.735.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_011CUxvAgbaSBYYLrJ2RAV5j"}
Steps to Reproduce
Start a long conversation with many tool calls (we had 735+ messages in conversation)
Observe system hanging/slow response during tool execution
Interrupt with Ctrl+C to exit the hanging process
Resume the conversation (conversation state restored)
Type /context command to check context usage
Error occurs immediately with 400 invalid_request_error
Expected Behavior
/context command should display context usage statistics
No errors should occur from built-in commands
Resume functionality should properly restore conversation state
Actual Behavior
/context command fails with 400 error
Error message indicates issue with message structure: "messages.735.content.0.type: Expected thinking or redacted_thinking, but found text"
System expects thinking blocks but conversation state doesn't have them in correct format
Additional Context
Session Details
Working directory: /home/corey/projects/mvp-scout-knowledge-pipline
Git repo: Yes
Token usage at error: Message 735 (likely near context limits)
Session duration: Multi-hour coding session
Task type: Complex multi-file refactoring with compilation, deployment, and testing
What We Were Doing
Entity detection algorithm development
Multiple deploy cycles with Cloudflare Workers
File uploads to R2
Compilation of corpus files
Testing and accuracy validation
System Behavior Before Error
Response became slow/hung during tool execution
May have been near token/context limits
Multiple concurrent tool operations were running
Impact
Severity: High
Breaks workflow when using /context after resume
Forces users to restart conversation from scratch
Loses conversation context and progress
No workaround available (can't check context usage)
Root Cause Hypothesis
The error suggests that when resuming a conversation:
Message structure isn't properly reconstructed
Thinking mode (interleaved) requires thinking blocks in specific positions
Message 735 has a text content block where a thinking block is expected
The /context command triggers API call that fails validation
Possible causes:
Resume doesn't properly serialize/deserialize thinking blocks
Message state corruption after Ctrl+C interrupt
Context compaction or autocompact may have removed thinking blocks incorrectly
Slash commands after resume don't properly handle conversation state
Workarounds Attempted
None - error is immediate on /context command with no available workaround.
Request to Claude Code Team
Fix message structure validation on resume to ensure thinking blocks are properly preserved
Add error handling for slash commands to gracefully handle malformed message history
Consider: Allow /context command to work even if message structure is invalid
Improve: Add better error messages for users (what to do when this happens)
Additional Information Needed?
Happy to provide:
Full conversation logs if helpful
Reproduction steps in more detail
System environment details
Git repository access if needed for reproduction
Temporary Impact on Our Work
We were in the middle of:
Entity detection accuracy improvements (PERSON, ORG, GPE, LOC)
Achieved 84% PERSON, 96% ORG, 100% GPE, 93% LOC accuracy
Had 3 of 4 entities above 90% target
Now unable to check context usage to plan remaining work
Request: Please prioritize fix as this blocks workflow continuation after interrupts.
What Should Happen?
Claude Code Bug Report
Issue: 400 Error on /context command after resume from Ctrl+C
Date: 2025-11-09 Claude Code Version: Latest (as of Nov 9, 2025) Model: claude-sonnet-4-5-20250929[1m] Platform: Linux 6.14.0-35-generic
Summary
After interrupting a long-running session with Ctrl+C and resuming, the /context command immediately fails with a 400 error related to thinking block requirements in message structure.
Error Message
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.735.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_011CUxvAgbaSBYYLrJ2RAV5j"}
Steps to Reproduce
Start a long conversation with many tool calls (we had 735+ messages in conversation)
Observe system hanging/slow response during tool execution
Interrupt with Ctrl+C to exit the hanging process
Resume the conversation (conversation state restored)
Type /context command to check context usage
Error occurs immediately with 400 invalid_request_error
Expected Behavior
/context command should display context usage statistics
No errors should occur from built-in commands
Resume functionality should properly restore conversation state
Actual Behavior
/context command fails with 400 error
Error message indicates issue with message structure: "messages.735.content.0.type: Expected thinking or redacted_thinking, but found text"
System expects thinking blocks but conversation state doesn't have them in correct format
Additional Context
Session Details
Working directory: /home/corey/projects/mvp-scout-knowledge-pipline
Git repo: Yes
Token usage at error: Message 735 (likely near context limits)
Session duration: Multi-hour coding session
Task type: Complex multi-file refactoring with compilation, deployment, and testing
What We Were Doing
Entity detection algorithm development
Multiple deploy cycles with Cloudflare Workers
File uploads to R2
Compilation of corpus files
Testing and accuracy validation
System Behavior Before Error
Response became slow/hung during tool execution
May have been near token/context limits
Multiple concurrent tool operations were running
Impact
Severity: High
Breaks workflow when using /context after resume
Forces users to restart conversation from scratch
Loses conversation context and progress
No workaround available (can't check context usage)
Root Cause Hypothesis
The error suggests that when resuming a conversation:
Message structure isn't properly reconstructed
Thinking mode (interleaved) requires thinking blocks in specific positions
Message 735 has a text content block where a thinking block is expected
The /context command triggers API call that fails validation
Possible causes:
Resume doesn't properly serialize/deserialize thinking blocks
Message state corruption after Ctrl+C interrupt
Context compaction or autocompact may have removed thinking blocks incorrectly
Slash commands after resume don't properly handle conversation state
Workarounds Attempted
None - error is immediate on /context command with no available workaround.
Request to Claude Code Team
Fix message structure validation on resume to ensure thinking blocks are properly preserved
Add error handling for slash commands to gracefully handle malformed message history
Consider: Allow /context command to work even if message structure is invalid
Improve: Add better error messages for users (what to do when this happens)
Additional Information Needed?
Happy to provide:
Full conversation logs if helpful
Reproduction steps in more detail
System environment details
Git repository access if needed for reproduction
Temporary Impact on Our Work
We were in the middle of:
Entity detection accuracy improvements (PERSON, ORG, GPE, LOC)
Achieved 84% PERSON, 96% ORG, 100% GPE, 93% LOC accuracy
Had 3 of 4 entities above 90% target
Now unable to check context usage to plan remaining work
Request: Please prioritize fix as this blocks workflow continuation after interrupts.
Error Messages/Logs
Steps to Reproduce
Claude Code Bug Report
Issue: 400 Error on /context command after resume from Ctrl+C
Date: 2025-11-09 Claude Code Version: Latest (as of Nov 9, 2025) Model: claude-sonnet-4-5-20250929[1m] Platform: Linux 6.14.0-35-generic
Summary
After interrupting a long-running session with Ctrl+C and resuming, the /context command immediately fails with a 400 error related to thinking block requirements in message structure.
Error Message
Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.735.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_011CUxvAgbaSBYYLrJ2RAV5j"}
Steps to Reproduce
Start a long conversation with many tool calls (we had 735+ messages in conversation)
Observe system hanging/slow response during tool execution
Interrupt with Ctrl+C to exit the hanging process
Resume the conversation (conversation state restored)
Type /context command to check context usage
Error occurs immediately with 400 invalid_request_error
Expected Behavior
/context command should display context usage statistics
No errors should occur from built-in commands
Resume functionality should properly restore conversation state
Actual Behavior
/context command fails with 400 error
Error message indicates issue with message structure: "messages.735.content.0.type: Expected thinking or redacted_thinking, but found text"
System expects thinking blocks but conversation state doesn't have them in correct format
Additional Context
Session Details
Working directory: /home/corey/projects/mvp-scout-knowledge-pipline
Git repo: Yes
Token usage at error: Message 735 (likely near context limits)
Session duration: Multi-hour coding session
Task type: Complex multi-file refactoring with compilation, deployment, and testing
What We Were Doing
Entity detection algorithm development
Multiple deploy cycles with Cloudflare Workers
File uploads to R2
Compilation of corpus files
Testing and accuracy validation
System Behavior Before Error
Response became slow/hung during tool execution
May have been near token/context limits
Multiple concurrent tool operations were running
Impact
Severity: High
Breaks workflow when using /context after resume
Forces users to restart conversation from scratch
Loses conversation context and progress
No workaround available (can't check context usage)
Root Cause Hypothesis
The error suggests that when resuming a conversation:
Message structure isn't properly reconstructed
Thinking mode (interleaved) requires thinking blocks in specific positions
Message 735 has a text content block where a thinking block is expected
The /context command triggers API call that fails validation
Possible causes:
Resume doesn't properly serialize/deserialize thinking blocks
Message state corruption after Ctrl+C interrupt
Context compaction or autocompact may have removed thinking blocks incorrectly
Slash commands after resume don't properly handle conversation state
Workarounds Attempted
None - error is immediate on /context command with no available workaround.
Request to Claude Code Team
Fix message structure validation on resume to ensure thinking blocks are properly preserved
Add error handling for slash commands to gracefully handle malformed message history
Consider: Allow /context command to work even if message structure is invalid
Improve: Add better error messages for users (what to do when this happens)
Additional Information Needed?
Happy to provide:
Full conversation logs if helpful
Reproduction steps in more detail
System environment details
Git repository access if needed for reproduction
Temporary Impact on Our Work
We were in the middle of:
Entity detection accuracy improvements (PERSON, ORG, GPE, LOC)
Achieved 84% PERSON, 96% ORG, 100% GPE, 93% LOC accuracy
Had 3 of 4 entities above 90% target
Now unable to check context usage to plan remaining work
Request: Please prioritize fix as this blocks workflow continuation after interrupts.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
latest
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗