[BUG] API Error: 400 reasoning `encrypted_content` was not issued to this caller
Status Open
Reported on v2.1.241
Maintainer reply None cached
Activity 4 comments · opened Aug 25, 2026
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?
So when i change the API key things while at machine level the claude code break and shows this error API Error: 400 reasoning encrypted_content was not issued to this caller
What Should Happen?
I have maked an python script to fix this and it can be used via the fix-claude i have the code if any one have this issue please let me know so i can just make an repo and publish the code so you can use to fix it
Error Messages/Logs
API Error: 400 reasoning `encrypted_content` was not issued to this caller
Steps to Reproduce
when i change the API keys at system level in windows 11 it brokes the claude chat and shows the error and i have fixed it via the python script
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.241 (Claude Code)
Platform
Other
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
4 Comments
Not from Anthropic, just another user, but this might be the same thing as #49994. Encrypted content blocks can't be read by the client, only replayed as-is on later turns. Claude Code keeps them in the session transcript and resends them on every request, so a block issued under the old key goes out under the new one and gets rejected. That's why it stays broken on every prompt afterwards instead of failing once.
Try running
/clearin that session, or just start a new one. Don't reopen the old session with--continueor--resume, since that reloads the same transcript. You shouldn't need to patch any files. Does that work on the new key?via /clear it works but if i have something important then i have to export it and its not that much efficent and i dont think its an corect way so i pursued this way and just want to share if any one other have that problem
Agreed,
/clearisn't a fix, it just tells us where the problem is. A fresh session working means the new key is fine and the failure is purely the old transcript being replayed. Heads up that /compact probably won't save you either: in #49994 it returned the same 400, so it can't clear the bad block.If you can say which blocks your script strips out, that would make this much easier to fix properly. That's the part that pins down what Claude Code is resending, and the actual fix is for it to drop those blocks when the credential changes instead of replaying them forever.
listen instead of that look at this python code that fixed the issue that i have having