[BUG] Resume fails with "thinking.signature: Field required" — empty unsigned thinking block persisted to transcript
Summary
Resuming a session fails with:
API Error: 400 messages.N.content.0.thinking.signature: Field required
The cause is in the persisted transcript (~/.claude/projects/<proj>/<session>.jsonl): an assistant message is serialized with a leading thinking content block that has empty text and no signature, e.g.:
{"type":"thinking","thinking":"","signature":""}
followed by normal blocks. On resume the transcript is replayed to the API, which rejects any thinking block without a valid signature → 400. The session becomes unresumable until the block is hand-removed.
Steps to reproduce
- Run a long session with extended/interleaved thinking on an Opus 4.8 1M-context (
[1m]) model via Bedrock. - Resume the session (or it auto-continues across a context window).
- Resume fails with the 400 above.
What I observed
- The offending block is always a zero-length, unsigned
thinkingblock as the first content block of an assistant message that also containstext+tool_use. Example block layout:
[ thinking(sig=false, len=0), text(len=127), tool_use(Bash) ]
- It recurs. After manually stripping the bad block and successfully resuming, a new empty-thinking block was generated on a later turn and broke resume again — so it is produced live during the session, not just stale data.
- In both occurrences the bad assistant message was immediately preceded by a
permission-mode/modeentry in the transcript (permission mode was toggled mid-session). Possible correlation with mode/model switches mid-turn.
Expected
A thinking block with empty content and no signature should never be persisted to the transcript, or should be filtered out before the conversation is replayed on resume.
Workaround
Strip content blocks matching type === "thinking" && !signature from the assistant messages in the .jsonl, then resume.
Environment
- Claude Code version:
2.1.178 - Model:
claude-opus-4-8(1M-context[1m]variant) - Provider: Amazon Bedrock
- OS: macOS (darwin 25.3.0)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗