Analysis updated 2026-05-18
Fix a Claude Code session that broke after switching from a third-party model like GLM or DeepSeek back to an official Anthropic model.
Scan your Claude Code project files to check which sessions contain unsigned thinking blocks.
Preview and safely strip problematic data from a session file with automatic backup and restore support.
| yonghaozhao722/cc-sanitizer | chaos-xxl/zelda-hyrule-ui | coasty-ai/open-cowork | |
|---|---|---|---|
| Stars | 39 | 39 | 39 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 2/5 | 3/5 |
| Audience | developer | developer | vibe coder |
Figures from each repo's GitHub metadata at analysis time.
No installation needed, runs directly with npx.
CC-Sanitizer is a small command-line tool that fixes a specific error in Claude Code, the AI coding assistant from Anthropic. The error appears when you switch between unofficial third-party AI models (such as GLM or DeepSeek) and official Anthropic models within the same session. The third-party models produce a type of internal data called thinking blocks, but without the cryptographic signature that Anthropic's models require. When you switch back to an official model, Claude Code rejects the session with a 400 error about an invalid signature. The tool fixes this by reading the session files that Claude Code stores on your computer and removing the problematic thinking blocks. Your conversation history, text responses, and tool calls are all kept intact, only the unsigned thinking entries are stripped out. There are three commands. The scan command reads your session files and reports which thinking blocks have valid signatures and which are suspect. The strip command removes thinking blocks from a session file, with options for a dry-run preview, automatic backup creation, and a mode that only removes blocks lacking a valid signature. The restore command recovers the previous version of a file from the backup that strip creates by default. All three commands accept a file path, a session ID, or a project name. If you run scan with no arguments, it scans every Claude Code project on your machine. The tool detects suspect blocks by checking whether the signature field is a base64 string between 600 and 1200 characters long, which is the range Anthropic's server-generated signatures fall into. The README notes this is a heuristic and could miss a third-party block that happens to produce a plausible-looking string. No installation is required, you can run it directly with npx. It works on Windows, macOS, and Linux and is released under the MIT license.
A CLI tool that fixes a session error in Claude Code caused by switching between third-party and official AI models.
Mainly TypeScript. The stack also includes TypeScript, Node.js.
MIT license: free to use, modify, and redistribute, including commercially, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.