[BUG] Standalone auto-updater writes to CWD instead of ~/.local/share/claude, creates relative symlink
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?
The standalone auto-updater creates a claude/versions/ directory in the current working directory instead of ~/.local/share/claude/versions/, and updates the ~/.local/bin/claude symlink to a relative path that breaks.
When the auto-updater triggers, it:
- Creates $CWD/claude/versions/ and downloads the new binary there instead of ~/.local/share/claude/versions/
- Updates ~/.local/bin/claude to a relative symlink like claude/versions/2.1.96 instead of an absolute path like /home/user/.local/share/claude/versions/2.1.96
The relative symlink only works if you happen to launch claude from $HOME. From any other directory, the symlink is broken.
The upshot is stray claude/versions/ directories scattered across project directories, each containing ~230MB binaries matching the version that was current when I last ran claude from that directory, for example:
~/projects/<redacted0>/claude/versions/2.1.74
~/projects/<redacted1>/claude/versions/2.1.81
~/projects/<redacted2>claude/versions/2.1.81
~/projects/<redacted3>claude/versions/2.1.58, 2.1.74
What Should Happen?
The updater should resolve install paths absolutely, writing only to ~/.local/share/claude/ and creating an absolute symlink.
Error Messages/Logs
Trying to run claude with broken symlink raises the error "too many layers of symbolic links".
Steps to Reproduce
Use Linux (Ubuntu, kernel 6.8.0), standalone claude code install (not npm).
Claude Code versions affected: 2.1.2 through 2.1.96 (observed over months).
cd into a project dir (not ~) and run 'claude'. expect the misbehavior when it triggers the auto-updater.
Claude Model
None
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
observed in 2.1.2 through 2.1.96
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗