Skip to content

[BUG] Claude stops with snapshot error #2139

Closed as not planned
Closed as not planned

Description

@derekbreden

Environment

  • Platform (select one):
    • Anthropic API
    • AWS Bedrock
    • Google Vertex AI
    • 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

  1. 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

Image Image

As seen in the screenshot, Claude said "You could report this as a bug", so I did.

Activity

  1. elyase commented on Jun 16, 2025

    @elyase

    I've noticed the same thing. It seems to happen when you return to an old session. Restarting the session fixes it.

  2. derekbreden commented on Jun 16, 2025

    @derekbreden
    Author

    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.

  3. changed the title [-][BUG][/-] [+][BUG] Claude stops with snapshot error[/+] on Jun 17, 2025
  4. self-assigned this
    on Jun 17, 2025
  5. almirsarajcic commented on Jun 22, 2025

    @almirsarajcic

    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:

    • Uses bash instead of zsh
    • No Homebrew or mise contamination
    • Only direct installations of required tools (Node.js, etc.)
    • Force Claude Code to run through bash with export SHELL=/bin/bash

    It's not ideal, but it works reliably, and I'll keep it this way until this gets resolved in Claude Code.

  6. markng commented on Jun 25, 2025

    @markng

    Also suffering this issue when claude code shells are left idle.

  7. amiperl commented on Jun 26, 2025

    @amiperl

    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?

  8. almirsarajcic commented on Jun 26, 2025

    @almirsarajcic

    You can use /resume command to continue one of the previous sessions.
    There's even -c flag (claude -c) to resume the very last one.

  9. almirsarajcic commented on Jul 3, 2025

    @almirsarajcic

    It worked for a while, but since one of the latest updates (maybe 1.0.38), it doesn't work even with the fix (#2139 (comment)).

    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

  10. PastaPastaPasta commented on Jul 6, 2025

    @PastaPastaPasta

    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.

  11. 25 remaining items

  12. germanoeich commented on Jul 16, 2025

    @germanoeich

    Can confirm that this started happening to me in 1.0.53 pretty often. @wolffiex Can you consider re-opening this issue?

  13. mweichert commented on Jul 16, 2025

    @mweichert
  14. wahve3 commented on Jul 17, 2025

    @wahve3

    Downgrading to 1.0.51 worked for me as well. Don't forget to disable auto-update when doing this!

  15. Extarys commented on Jul 21, 2025

    @Extarys

    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 disabled

    This should not be marked as closed @wolffiex :)

    EDIT: Well, it worked for 5 minutes and then:

    ● Bash(ls -la)
      ⎿  Error: /bin/bash: line 1: /home/user/.claude/shell-snapshots/snapshot-bash-1753059559185-swhw51.sh: No such file or directory
    

    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.

  16. wolffiex commented on Jul 21, 2025

    @wolffiex
    Collaborator

    @Extarys can you please paste the error? Can you run with -d and paste the output?

  17. Extarys commented on Jul 21, 2025

    @Extarys

    @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 claude directly.

    https://github.com/parruda/claude-swarm/issues/93

  18. Extarys commented on Jul 22, 2025

    @Extarys

    Yes, finally :)

    ● Now I'll run the Rust type checker using cargo check in the src-tauri directory,
      which is the standard way to typecheck Rust code:
    [DEBUG] executePreToolHooks called for tool: Bash
    [DEBUG] Executing hooks for PreToolUse:Bash
    [DEBUG] Getting matching hook commands for PreToolUse with query: Bash
    [DEBUG] Found 0 hook matchers in settings
    [DEBUG] Matched 0 unique hooks for query "Bash" (0 before deduplication)
    [DEBUG] Found 0 hook commands to execute
    [DEBUG] Getting matching hook commands for Notification with query: undefined
    [DEBUG] Found 0 hook matchers in settings
    [DEBUG] Matched 0 unique hooks for query "no match query" (0 before deduplication)
    [DEBUG] Bash tool invoked with command: cd src-tauri && cargo check
    [DEBUG] Bash tool description: Run Rust type checker on all source files
    [DEBUG] AutoUpdaterWrapper: Installation type: npm-local, using native: false
    
    ● Bash(cd src-tauri && cargo check)
      ⎿  Error: /bin/bash: line 1: 
         /home/user/.claude/shell-snapshots/snapshot-bash-1753148921648-xe43fp.sh: No 
         such file or directory
    [DEBUG] Stream started - received first chunk
    
    ● Let me try a different approach:
    [DEBUG] executePreToolHooks called for tool: Bash
    [DEBUG] Executing hooks for PreToolUse:Bash
    [DEBUG] Getting matching hook commands for PreToolUse with query: Bash
    [DEBUG] Found 0 hook matchers in settings
    [DEBUG] Matched 0 unique hooks for query "Bash" (0 before deduplication)
    [DEBUG] Found 0 hook commands to execute
    [DEBUG] Writing to temp file: /run/media/user/project/.claude/settings.local.json.tmp.3357173.1753181211124
    [DEBUG] Preserving file permissions: 100644
    [DEBUG] Temp file written successfully, size: 224 bytes
    [DEBUG] Applied original permissions to temp file
    [DEBUG] Renaming /run/media/user/project/.claude/settings.local.json.tmp.3357173.1753181211124 to /run/media/user/project/.claude/settings.local.json
    [DEBUG] File /run/media/user/project/.claude/settings.local.json written atomically
    [DEBUG] Bash tool invoked with command: cd /run/media/user/project/src-tauri && cargo check
    [DEBUG] Bash tool description: Run Rust type checker on all source files
    [DEBUG] AutoUpdaterWrapper: Installation type: npm-local, using native: false
    
    ● Bash(cd /run/media/user/project/sr
          c-tauri && cargo check)
      ⎿  Error: /bin/bash: line 1: 
         /home/user/.claude/shell-snapshots/snapshot-bash-1753148921648-xe43fp.sh: No 
         such file or directory
    [DEBUG] Stream started - received first chunk
    
    ● Let me check the current directory and run cargo check directly:
    [DEBUG] executePreToolHooks called for tool: Bash
    [DEBUG] Executing hooks for PreToolUse:Bash
    [DEBUG] Getting matching hook commands for PreToolUse with query: Bash
    [DEBUG] Found 0 hook matchers in settings
    [DEBUG] Matched 0 unique hooks for query "Bash" (0 before deduplication)
    [DEBUG] Found 0 hook commands to execute
    [DEBUG] Writing to temp file: /run/media/user/project/.claude/settings.local.json.tmp.3357173.1753181218204
    [DEBUG] Preserving file permissions: 100644
    [DEBUG] Temp file written successfully, size: 244 bytes
    [DEBUG] Applied original permissions to temp file
    [DEBUG] Renaming /run/media/user/project/.claude/settings.local.json.tmp.3357173.1753181218204 to /run/media/user/project/.claude/settings.local.json
    [DEBUG] File /run/media/user/project/.claude/settings.local.json written atomically
    [DEBUG] Bash tool invoked with command: pwd && ls -la
    [DEBUG] Bash tool description: Check current directory and list files
    [DEBUG] AutoUpdaterWrapper: Installation type: npm-local, using native: false
    
    ● Bash(pwd && ls -la)
      ⎿  Error: /bin/bash: line 1: 
         /home/user/.claude/shell-snapshots/snapshot-bash-1753148921648-xe43fp.sh: No 
         such file or directory
    
  19. megalithic commented on Nov 6, 2025

    @megalithic

    Any traction on this? It is a constant (bigger than a) paper cut for me and others.

  20. github-actions commented on Dec 12, 2025

    @github-actions

    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.

  21. github-actions commented on Jan 12, 2026

    @github-actions

    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.

  22. github-actions commented on Jan 19, 2026

    @github-actions

    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.

  23. locked as resolved and limited conversation to collaborators on Jan 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:toolsautocloseIssue will be closed automaticallybugSomething isn't workingplatform:macosIssue specifically occurs on macOS

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions