claude-code - 💡(How to fix) Fix [BUG] Standalone auto-updater writes to CWD instead of ~/.local/share/claude, creates relative symlink [2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45260Fetched 2026-04-09 08:09:32
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×4commented ×2

Error Message

Error Messages/Logs

Trying to run claude with broken symlink raises the error "too many layers of symbolic links".

Code Example

Trying to run claude with broken symlink raises the error "too many layers of symbolic links".
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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:

  1. Creates $CWD/claude/versions/ and downloads the new binary there instead of ~/.local/share/claude/versions/
  2. 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

extent analysis

TL;DR

The auto-updater should be modified to resolve install paths absolutely, writing to ~/.local/share/claude/ and creating an absolute symlink to fix the issue.

Guidance

  • The issue arises from the auto-updater using a relative path for the symlink, which breaks when claude is launched from a directory other than $HOME.
  • To verify the issue, run claude from a project directory (not ~) and check if the auto-updater creates a claude/versions/ directory in the current working directory.
  • A potential workaround is to manually create an absolute symlink to the latest claude version in ~/.local/share/claude/versions/.
  • The updater's code should be reviewed to ensure it uses absolute paths when creating the claude/versions/ directory and the symlink in ~/.local/bin/claude.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The issue is not a regression and has been present since the observed versions (2.1.2 through 2.1.96). The fix requires modifying the auto-updater's behavior to use absolute paths.

Recommendation

Apply a workaround by manually creating an absolute symlink until the auto-updater is modified to resolve install paths absolutely. This is because the issue has been present for a long time, and a proper fix would require changes to the auto-updater's code.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING