[BUG] claude was corrupted/removed durring an active session and unable to re-install

Resolved 💬 10 comments Opened Jun 6, 2025 by michael-hedgineer Closed Jan 5, 2026

Environment

  • Platform (select one):
  • [X ] Anthropic API
  • Claude CLI version: 1.0.15 / 1.0.16
  • Operating System: Windows 11
  • Terminal: WSL

Bug Description

Claude was just removed while I was in the middle of a session. I was calling claude within claude and then it failed. Below is what I was doing:

Inside a claude session:

 Bash(claude --version)
  ⎿  1.0.16 (Claude Code)

● Bash(claude -p "What is 2+2?" --output-format stream-json --verbose)
  ⎿  Error: /bin/bash: line 1: claude: command not found

● Bash(which claude)
  ⎿  Error: Error

! claude --version
  ⎿  /bin/bash: line 1: claude: command not found

Then when I close out and try to resume the session with claude -c I get the following:

● Bash(claude -p "What is 2+2?" --output-format stream-json --verbose)
  ⎿  Error: /bin/bash: line 1: claude: command not found

● Bash(which claude)
  ⎿  Error: Error

! claude --version
  ⎿  /bin/bash: line 1: claude: command not found

Ctrl + C

$ claude -c
-bash: /home/USERl/.nvm/versions/node/v20.14.0/bin/claude: No such file or directory

I am now getting an error when trying to re-install:

$ npm install -g @anthropic-ai/claude-code
npm error code ENOTEMPTY
npm error syscall rename
npm error path /home/USER/.nvm/versions/node/v20.14.0/lib/node_modules/@anthropic-ai/claude-code
npm error dest /home/USER/.nvm/versions/node/v20.14.0/lib/node_modules/@anthropic-ai/.claude-code-sNHQ5nKh
npm error errno -39
npm error ENOTEMPTY: directory not empty, rename '/home/USER/.nvm/versions/node/v20.14.0/lib/node_modules/@anthropic-ai/claude-code' -> '/home/USER/.nvm/versions/node/v20.14.0/lib/node_modules/@anthropic-ai/.claude-code-sNHQ5nKh'

npm error A complete log of this run can be found in: /home/USER/.npm/_logs/2025-06-06T15_59_33_570Z-debug-0.log

What is interesting is that I have another session currently open on the same machine. When I run /status it gives me version Claude Code Status v1.0.15 which seems like it was updating while I was in the prior session, may have failed and not failed gracefully. It is possible that calling claude sdk within a session that is updating claude caused an error because that is exactly when this happened.

Steps to Reproduce

Explained above

Expected Behavior

Explained above

Actual Behavior

Explained above

Additional Context

I was actively calling out to claude -p while in a claude session which is when claude failed. I have been doing this same action for a couple weeks now without any issues. However I do notice you push bigger changes on Fridays so this may be related. Had an outage with the sdk about a month ago also on a Friday.

View original on GitHub ↗

This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗