[BUG] Claude stops with snapshot error
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [x] Other: Pro max plan, not billed per API usage
- Claude CLI version: 1.0.24 (Claude Code)
- Operating System: macOS 15.5 (24F74)
- Terminal: Terminal 2.14
Bug Description
Steps to Reproduce
- I have not been able to reproduce the issue
Expected Behavior
Claude does not get stuck in a loop with:
⏺ Bash(npm test client-server)
⎿ Error: zsh:source:1: no such file or directory: /var/folders/qc/hn57tpxs7tg5842pdqg075vc0000gn/T/claude-shell-snapshot-c1b9
⏺ Bash(npm test client-server)
⎿ Error: zsh:source:1: no such file or directory: /var/folders/qc/hn57tpxs7tg5842pdqg075vc0000gn/T/claude-shell-snapshot-c1b9
⏺ Bash(npm test client-server)
⎿ Error: zsh:source:1: no such file or directory: /var/folders/qc/hn57tpxs7tg5842pdqg075vc0000gn/T/claude-shell-snapshot-c1b9
⏺ Bash(npm test client-server)
⎿ Error: zsh:source:1: no such file or directory: /var/folders/qc/hn57tpxs7tg5842pdqg075vc0000gn/T/claude-shell-snapshot-c1b9
Actual Behavior
Claude was no longer able to execute any shell commands, every shell command attempted produce the "no such file or directory.
Additional Context
I did have 104GB free on my drive. I suspect there is some cleanup operation, and it seems unlikely to be a macOS one from my naive understanding, but I really know nothing about this.
d0e33c75-2e65-425a-8bb5-146e87c1d570.jsonl.txt
relevant text from claude from my perspective.txt
<img width="1582" alt="Image" src="https://github.com/user-attachments/assets/6c5c5e24-e573-4d1a-9e8e-1558616a7d69" />
<img width="1582" alt="Image" src="https://github.com/user-attachments/assets/400e49e9-c910-40c0-a38c-652835a6cc0b" />
As seen in the screenshot, Claude said "You could report this as a bug", so I did.
43 Comments
I've noticed the same thing. It seems to happen when you return to an old session. Restarting the session fixes it.
Interesting.
In my case there was a less than 30 minute, perhaps 5 minute (just guessing based on memory) delay between when the shell was working and when it stopped working. It was all within one prompt response from Claude. It was working when Claude first started responding and part way through the response its "shell" broke.
The .jsonl log I attached might confirm this? I don't know what all is included in those logs, or if there is a different one I should attach.
I'm experiencing the same issue. For me, it happens even in fresh sessions and is often so persistent that opening new sessions doesn't resolve it.
Details
I initially suspected it was due to working with multiple Claude Code sessions simultaneously (using git worktrees), but testing after killing all Claude processes showed this wasn't the cause. I also found stale processes in Activity Monitor after closing sessions, but killing them didn't help either.
Honestly, this happens more often than not for me.
The only reason I'm still using Claude Code is my recent Max plan subscription - Cursor seems more expensive currently, but that might change.
I also suspected it might be related to using ZSH with oh-my-zsh (saw someone mention this), but it occurs in bash too.
Actually, I didn't know how to switch to bash in my particular scenario.
Solution
I created a completely separate, streamlined environment specifically for Claude Code:
It's not ideal, but it works reliably, and I'll keep it this way until this gets resolved in Claude Code.
Also suffering this issue when claude code shells are left idle.
Feels good to know I'm not alone. If I restart the terminal window and Claude code, does it still have access to the prior session context?
You can use
/resumecommand to continue one of the previous sessions.There's even
-cflag (claude -c) to resume the very last one.It worked for a while, but since one of the latest updates (maybe 1.0.38), it doesn't work even with the fix (https://github.com/anthropics/claude-code/issues/2139#issuecomment-2994060105).
Sometimes it runs a command, but after a few commands, it stops working. Or sometimes doesn't work at all. Only restarting helps, but that's far from ideal for any longer work.
!Image
I can confirm I run into this error. It appears to only happen when CC is updated in the background, and your active session is using an old version.
I'm seeing this error too, but it seems to happen all the time (after a minute or two of coding) - not just when CC is updated in the background. I've tried to use bash as the shell (rather than zsh) and this doesn't seem to make any difference
Same for me. After a few minutes of usage, Claude Code becomes pretty much useless to me.
Can't wait for opencode to reach feature parity. I won't touch Claude Code. I'm even considering going back to Cursor at this point :/
I switched from Cursor to Claude Code 2-3 weeks ago, and in total, I've had it working for maybe 3 days in total. Everything else was a struggle. I'll try using Docker containers. If that doesn't work, bye bye Claude Code.
It took me a while to set Docker containers up, but even there, I have this issue.
It's crazy. I've tried 3 kinda completely different environments and I still get this issue. And I'm not the only one.
So I'm pretty sure now it's not PEBCAK.
Let me know if you need any additional info about my environment. Until then, I'll be using opencode.
This happens to me anytime I close the session and reopen it without restarting the entire terminal. Would nice to be able to manually clear those snapshot temp files or something. For reference, I use Kitty terminal
Guys, I think you need to hear this.
As someone who's been struggling with this for the past few weeks, this morning I switched to opencode and I have the same feeling of leveling up like I've had when I moved from Cursor's Chat to Claude Code.
<details>
<summary>Ramble</summary>
The reason I hesitated switching so much was that I have a pretty complex automated workflow.
It involves creating a new Cursor/VS Code workspace for every feature I work on, deals with memory files (plans, contexts...), and runs tests/code checks as part of the feedback loop.
So I asked opencode to convert my scripts. After like 15 minutes and just one small manual change, I can now switch from Claude Code to opencode and back easily. I don't even care what's driving the agent as long as it works.
Hopefully, one day, this bug in Claude Code gets fixed, and then I'll only care which model I'll be using, not the terminal tooling.
But if all goes well with opencode, I don't think I'll come back.
</details>
Anyway, try opencode. You'll thank me later.
Thanks Almir. I just heard about this: https://github.com/NomenAK/SuperClaude - seems to sit on top of Claude code - maybe through this you may not have the same issues...
As of v1.0.48 we moved the shell snapshot to
~/.claude/shell-snapshotsThis should make it easier to inspect and even edit the shell snapshot.
It should also prevent the OS from cleaning up the snapshot while you're using it.
Can you please test and let us know how it goes?
Doesn't show up anymore.
Thanks!
still shows up for me even after repeated restarts
@shallow-alchemy can you post the new error message?
Yeah. I just noticed its slightly different now
<img width="949" height="158" alt="Image" src="https://github.com/user-attachments/assets/e3d6b3b9-f964-40f6-9b37-c3bc87e5413c" />
Want me to open a new issue? (to be clear, the missing error seems resolved)
interesting, can you please post the relevant line from that file? here's fine
line 4415:
export PATH='^[[31m^[[1mUsage Error^[[22m^[[39m: The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin insteadok @shallow-alchemy you probably have something like this in your path, which is broken in yarn 2.x
export PATH="$(yarn global bin):$PATH"I can fix it so bad PATH values don't break the shell snapshot though
Received this over and over. Have encountered this numerous times in the last week.
Only fix is to terminate the process and then resume the conversation from a new instance. Would really be lovely if this would stop happening so frequently though.
This fixed after 1.0.52. Can you please update and let me know if you are still having problems?
Yes, I am on 1.0.52 and have encountered this error about a dozen times today.
It is possible, depending on when 1.0.52 released, that I still had active instances on the previous version. I can verify that prior to working today I had 1.0.52 but not all instances were restarted when I began work. I'll update if I hit this on a session that I know I've restarted today.
1.0.52 writes snapshot files in
$CLAUDE_CODE_CONFIG_DIR/shell-snapshotsFor now I'm assuming that 1.0.52 released, auto-updated, and borked all of my existing ~~conversations~~ sessions, in which case, no big deal plus a one-time issue.
I will report back if I continue to see this behavior in new sessions. Thanks for your efforts.
Ubuntu user here. It worked for me when I switched from Gnome Console to Gnome Terminal, not sure why.
I am also using Claude Code in the native installation.
For me, it seems to only be triggered by launching another claude code session (2 running at once) and crashes claude code entirely.
You are correct, that causes it. Switching terminal didn't help.
Also, I would like to add that this happens to me using version 1.0.53.
This issue is worse for me in 1.0.53.
Can confirm that this started happening to me in 1.0.53 pretty often. @wolffiex Can you consider re-opening this issue?
I downgraded to 1.0.52 and continue to had issues. I then downgraded again
to 1.0.51 and have been using it without issues.
On Wed, Jul 16, 2025 at 2:12 PM Germano Eichenberg @.***>
wrote:
Downgrading to 1.0.51 worked for me as well. Don't forget to disable auto-update when doing this!
Thanks ! 1.0.51 works for me too ! I didnt use claude for a week and started having this issue today... running 1.0.56.
FYI: Disable autoupdate:
claude config set -g autoUpdates disabledThis should not be marked as closed @wolffiex :)
EDIT: Well, it worked for 5 minutes and then:
Which make claude code unusable. In two vscode window, one worked 6 hours ago for ~4 hours and then started bugging, while that happened I opened another instance of vscode for another folder and the problem got even worst. Pretty much all command it tries to run fails.
@Extarys can you please paste the error? Can you run with -d and paste the output?
@wolffiex Hmm, my bad - this will need investigating on my side.
I think I found the culprit: claude-swarm. I didn't realise it happens only while using it. I'll keep my eyes open today and report back here if I notice the same behaviour with
claudedirectly.https://github.com/parruda/claude-swarm/issues/93
Yes, finally :)
Any traction on this? It is a constant (bigger than a) paper cut for me and others.
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.