How a Corrupted Session on Claude Code Web Cost Me My Work
It was a simple request: commit what you just made and push it.
I had Claude Code Web write an article, then asked it to run git commit and push at the end. That’s when an error appeared and the session froze.
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.3.content.5: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."},"request_id":"r...
The Web version has no /clear command like the CLI does. There was nothing I could do — the article Claude had written was gone.
What Causes This Error
This error occurs when extended thinking (deep reasoning mode) is in use.
Before responding to the user, Claude performs internal “thinking” and caches that content. When inconsistencies arise in this cache during a long conversation, it gets flagged as “thinking block has been modified” and triggers the error.
Conditions where it tends to occur:
- Long-running conversation sessions
- After a sequence of file operations or multiple tool calls
- Mid-way through a complex task
This is an Anthropic-side issue, so there’s no way for users to fully prevent it.
Workarounds
CLI version
/clear # Clear the context
If that doesn’t work, restart Claude Code (close and reopen the terminal).
Web version
There’s almost nothing you can do.
- Reload the browser (F5) and start a new conversation
- Open a new chat and continue from there
- Wait a bit (it might be a temporary server-side issue)
Since the Web version doesn’t have the /clear command, if the session breaks, you’re basically stuck.
Can the Files Be Recovered?
No.
After opening a new session, I checked the following:
/mnt/user-data/outputs/→ doesn’t exist~/.claude/projects/→ only the current session log (jsonl)git stash→ empty- working tree → clean
When a Web session crashes, the container environment for that session is discarded entirely. Files that weren’t committed cannot be recovered.
Lessons Learned
Commit frequently. Especially with AI-generated output — commit as soon as you’ve reviewed it. If you try to do one big commit at the end of a long conversation, you risk losing everything to this error.
Prefer CLI over Web. With the CLI, there’s a chance you can recover using /clear. If you have a Max subscription, the CLI is included in the same plan.
Avoid long conversations. Starting fresh chats and giving single instructions reduces the risk of session corruption.
Consider doing git operations manually. For tasks where having AI do it adds little value, doing it yourself by hand is sometimes the more reliable choice.