[BUG] Auto-update drops ~/.local/bin/claude symlink on Linux (standalone installer), leaving CLI unavailable

Resolved 💬 2 comments Opened Jun 18, 2026 by rkaunismaa Closed Jun 22, 2026

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?

After Claude Code auto-updates, the symlink at \~/.local/bin/claude\ goes missing, leaving the CLI completely unavailable (\command not found\). The versioned binaries under \~/.local/share/claude/versions/\ are intact — only the symlink is gone.

This is distinct from issue #57178 (macOS/npm, wrong symlink target). This is Linux with the standalone binary installer, and the symlink is entirely absent.

Environment

  • OS: Ubuntu 22.04, kernel 6.8.0-124-generic
  • Install method: Standalone binary installer (curl -fsSL https://claude.ai/install.sh | sh) — NOT npm-based
  • Shell: bash

Timeline

| Date | Event |
|------|-------|
| Jun 4 | Installed Claude Code 2.1.163 (standalone installer) |
| Jun 5 | Auto-update downloaded 2.1.165 to ~/.local/share/claude/versions/2.1.165 |
| Jun 5–18 | Claude not actively used |
| Jun 18 | Attempted to run claude — got command not found |
| Jun 18 | Diagnosed: ~/.local/bin/claude symlink was absent; version binaries still present |
| Jun 18 | Reinstalled → 2.1.181, new symlink created, issue resolved |

What Should Happen?

The symlink at ~/.local/bin/claude should survive an auto-update. If the updater replaces it, the new symlink should be written atomically so an interrupted update does not leave the CLI unusable.

Diagnosis

After reinstalling:

$ ls -la ~/.local/bin/claude
lrwxrwxrwx 1 rob rob 46 Jun 18 12:40 /home/rob/.local/bin/claude -> /home/rob/.local/share/claude/versions/2.1.181

$ ls ~/.local/share/claude/versions/
2.1.163  2.1.165  2.1.181

All three version binaries are present, confirming the binaries themselves were never missing — only the symlink was gone.

Workaround

Added a shell wrapper to ~/.bashrc that detects a missing symlink and re-runs the installer automatically:

claude() {
    if [ ! -e "$HOME/.local/bin/claude" ]; then
        echo "Claude Code symlink broken — reinstalling..."
        curl -fsSL https://claude.ai/install.sh | sh
    fi
    command claude "$@"
}

Steps to Reproduce

  1. Install Claude Code via standalone installer on Linux.
  2. Allow an auto-update to run (or trigger one).
  3. Do not use the CLI for several days.
  4. Attempt to run claude — observe command not found.
  5. Check ~/.local/bin/claude — symlink is absent; ~/.local/share/claude/versions/ still contains all binaries.

View original on GitHub ↗

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