[BUG] no such file or directory: `.claude/config/shell-snapshots/*.sh`

Resolved 💬 36 comments Opened Jul 16, 2025 by moltar Closed Jul 24, 2025
💡 Likely answer: A maintainer (wolffiex, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.53 (Claude Code)
  • Operating System: macOS
  • Terminal: iTerm2

Bug Description

After an upgrade today, the agent is failing a lot with:

⏺ Bash(pwd)
  ⎿  Error: zsh:source:1: no such file or directory: .claude/config/shell-snapshots/snapshot-zsh-1752654921563-7yrdsa.sh

When I ls -lA .claude/config/shell-snapshots, I do see the file is there.

Steps to Reproduce

Not sure.

Expected Behavior

It to work.

Actual Behavior

Not working.

Additional Context

I'm using .claude/config (project scoped) config folder, not global user folder.

View original on GitHub ↗

36 Comments

t-e-lawrence · 1 year ago

same here:
ver - 1.0.53
OS: gentoo linux
term: kitty

when i tell claude to run something i get:

error: ENOENT: no such file or directory, stat '/home/{user}/.claude/shell-snapshots/snapshot-bash-*.sh.lock'
path: "/home/{user}/.claude/shell-snapshots/snapshot-bash-*.sh.lock",
syscall: "stat",
errno: -2,
code: "ECOMPROMISED"

running ls -la shows no file of the same name

claude doctor:
Claude CLI Diagnostic
Currently running: native (1.0.53)
Path: /home/{user}/.local/bin/claude
Invoked: /$bunfs/root/claude
Config install method: native
Auto-updates enabled: true
Warning: Multiple installations found

  • npm-global at /home/{user}/.local/bin/claude
  • native at /home/{user}/.local/bin/claude
abazabaaa · 1 year ago

I get the same error, but it only occurs when I try to open two claudes at once. ver 1.0.53 OS RHEL8 term warp
Using native install.

t-e-lawrence · 1 year ago
I get the same error, but it only occurs when I try to open two claudes at once. ver 1.0.53 OS RHEL8 term warp Using native install.

okay i've verified that this is the cause. when running 2 claudes at once, i tell one of them to run something, then the other one immediately exits with:

error: ENOENT: no such file or directory, stat '/home/{user}/.claude/shell-snapshots/snapshot-bash-*.sh.lock'
    path: "/home/{user}/.claude/shell-snapshots/snapshot-bash-*.sh.lock",
 syscall: "stat",
   errno: -2,
    code: "ECOMPROMISED"


Bun v1.2.15 (Linux x64 baseline)
tommedema · 1 year ago

same here, any workaround?

t-e-lawrence · 1 year ago
same here, any workaround?

post if you come up with anything. thx

t-e-lawrence · 1 year ago

workaround 1. you can just re-install claude. idk why but wiping everything seems to have fixed the issue entirely, but it might come back l8r

workaround 2. (pretty bad ngl) it sucks bc you have to re-login but should work i think:

#!/bin/bash
INSTANCE_ID=$RANDOM
export CLAUDE_CONFIG_DIR=~/.claude-$INSTANCE_ID
$HOME/.claude/local/node_modules/.bin/claude "$@"
rm -rf ~/.claude-$INSTANCE_ID  # Cleanup on exit

both are kinda low iq so idk, you might wanna wait for an official patch

moltar · 1 year ago

I am not running two CC instances, btw.

wolffiex collaborator · 12 months ago

Hi everyone, I'm really sorry for this trouble. It seems we found the limit of our lockfile implementation 😅

We switched to an in-memory implementation of the snapshot in 1.0.54. If you need to see it for debugging purposes, claude will write to a file when you run with --debug

Please let us know if you have any more trouble!

wolffiex collaborator · 12 months ago

sorry, we had to revert 1.0.54 due to an issue with the in-memory implementation. we are working on this and will try again tomorrow

nitzel · 12 months ago

workaround, especially if you - like me - thought deleting .claude directory would help (it doesn't) and you get

zsh: no such file or directory: /Users/user/.claude/local/claude
# maybe no re-install is necessary, try this first:
npm exec claude

/migrate-installer # move installer to the linked `~/.claude`
npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code
npm exec claude
wolffiex collaborator · 12 months ago

Ok 1.0.55 is out with the fix. Please let us know how it goes for you.

sachit-menon · 12 months ago

Still seeing the same error when using multiple instances.

[Error: ENOENT: no such file or directory, stat 'CONFIG_PATH/shell-snapshots/snapshot-zsh-1752864230812-ug4m3g.sh.lock'] {
  errno: -2,
  code: 'ECOMPROMISED',
  syscall: 'stat',
  path: 'CONFIG_PATH/shell-snapshots/snapshot-zsh-1752864230812-ug4m3g.sh.lock'
}

Node.js v20.19.3
wolffiex collaborator · 12 months ago

yes, we had to rollback the version due to #3891
stay tuned

sachit-menon · 12 months ago

In the meantime, how can I roll back and disable automatic update to 1.0.53? claude config set -g autoUpdates disabled isn't working, it's still auto updating even when I install a previous version.

wolffiex collaborator · 12 months ago

sorry about that, DISABLE_AUTOUPDATER=1 claude should work

https://docs.anthropic.com/en/docs/claude-code/settings#environment-variables

wolffiex collaborator · 12 months ago

thanks for everyone's patience here. we have a new build. if anyone wants to help verify it, please do npm i -g @anthropic-ai/claude-code@1.0.56 and report back

t-e-lawrence · 12 months ago
thanks for everyone's patience here. we have a new build. if anyone wants to help verify it, please do npm i -g @anthropic-ai/claude-code@1.0.56 and report back

its working well. havent seen it since the update

tamaratran · 12 months ago
> thanks for everyone's patience here. we have a new build. if anyone wants to help verify it, please do npm i -g @anthropic-ai/claude-code@1.0.56 and report back its working well. havent seen it since the update

I've updated to 1.0.56 and still seeing this error

moltar · 12 months ago

I'm still seeing the same problem on the latest version.

tamaratran · 11 months ago

Can you reopen the issue?

dbir0 · 11 months ago

I'm coming across this issue as well, also seems to be related to multiple instances on the same device, even if it's not actively doing anything in the 2nd instance.

npm install -g @anthropic-ai/claude-code

In project:
● Bash(mkdir -p /home/xxx/repo/xxx/tools/xxx)
⎿  Error: /bin/bash: line 1: /home/xxx/.claude/shell-snapshots/snapshot-
bash-1753201179803-txrzul.sh: No such file or directory

Linux Mint 22.1, Claude Code v1.0.57 installed via NPM. Tried converting to a local install with no luck fixing the issue.

/doctor

Claude CLI Diagnostic
Currently running: npm-local (1.0.57)
Path: /usr/bin/node
Invoked: /home/xxx/.claude/local/node_modules/.bin/claude
Config install method: local
Auto-updates enabled: true
Press Enter to continue…

moltar · 11 months ago

This is getting extemely annoying. I have to restart claude code all the time so it can work for a bit, only eventually to start failing again over and over on the same error.

⏺ Now let's run the build to make sure everything still works:

⏺ Bash(pnpm run build)
  ⎿  Error: zsh:source:1: no such file or directory: .claude/config/shell-snapshots/snapshot-zsh-1753283459150-3fwf0s.sh

⏺ Bash(pnpm run build)
  ⎿  Error: zsh:source:1: no such file or directory: .claude/config/shell-snapshots/snapshot-zsh-1753283459150-3fwf0s.sh

⏺ Bash(pnpm run build)
  ⎿  Error: zsh:source:1: no such file or directory: .claude/config/shell-snapshots/snapshot-zsh-1753283459150-3fwf0s.sh

⏺ Bash(pnpm run build)
  ⎿  Error: zsh:source:1: no such file or directory: .claude/config/shell-snapshots/snapshot-zsh-1753283459150-3fwf0s.sh
moltar · 11 months ago

I am NOT using multiple instances.

wolffiex collaborator · 11 months ago

Ok sorry for the continued trouble here. I just merged a change that:

  • Disables cleanup of orphaned snapshots
  • Recreates missing snapshots instead of failing

Should go out tomorrow

wolffiex collaborator · 11 months ago

The fix described above went out with 1.0.60. Let me know if you're still having problems after update.

cosmastech · 11 months ago

Still having the problem. I used the instructions from @nitzel and we're back in business.

tamaratran · 11 months ago
The fix described above went out with 1.0.60. Let me know if you're still having problems after update.

Please re-open

tamaratran · 11 months ago
Still having the problem. I used the instructions from @nitzel and we're back in business.

With this workaround, now my Claude code session seems to terminate quickly, ending the session.

wolffiex collaborator · 11 months ago

@tamaratran can you please paste your console output here?

moltar · 11 months ago

Btw, still getting this on 1.0.68

moltar · 11 months ago

This is still ONGOING today even on the most latest versions. This is getting beyond ridiculous and completely unusable. I am about to start using other competitor products and advise our whole team to do the same, if this is not fixed.

<img width="2200" height="274" alt="Image" src="https://github.com/user-attachments/assets/bb7fbc24-f0a4-4e2a-a60f-49212b723065" />

Unravl · 11 months ago

this is still an issue. I was in Rider IDE, opened claude code, realized I was in the wrong project. closed the claude terminal tab. Clicked on the other project, and wrote the claude command and suddenly it didnt work, in either tab or any terminals now.

/Users/username/.claude/local/claude: line 2: /Users/haydenevan/.claude/local/node_modules/.bin/claude: No such file or directory
/Users/username/.claude/local/claude: line 2: exec: /Users/haydenevan/.claude/local/node_modules/.bin/claude: cannot execute: No such file or directory

im guessing I need to reinstall now?

JPBarringer · 11 months ago

Who here is using homebrew? Asking because I just ran into this issue. Still digging into it but I think it might be dueling install methods in my case.

JPBarringer · 11 months ago

Here's the most useful error I'm able to find:

~/.claude/local via  v24.5.0
❯ npm install
npm error code ENOTEMPTY
npm error syscall rename
npm error path /Users/user/.claude/local/node_modules/@anthropic-ai/claude-code
npm error dest /Users/user/.claude/local/node_modules/@anthropic-ai/.claude-code-ecmSQutl
npm error errno -66
npm error ENOTEMPTY: directory not empty, rename '/Users/user/.claude/local/node_modules/@anthropic-ai/claude-code' -> '/Users/user/.claude/local/node_modules/@anthropic-ai/.claude-code-ecmSQutl'

The immediate fix (works from any folder):
rm -rf ~/.claude/local/node_modules && cd ~/.claude/local && npm install

(then claude -c from the project directory you were in)

Edit: here's a one-liner you can run from the directory you are trying to run Claude in:
rm -rf ~/.claude/local/node_modules && cd ~/.claude/local && npm install && claude -c

isIbra · 11 months ago

@JPBarringer You're a life saver 🙏

github-actions[bot] · 11 months ago

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.