Installer does not update launcher symlink when upgrading versions

Status Fixed / completed
Reported on v2.1.97
Maintainer reply None cached
Activity 4 comments · opened Apr 17, 2026 · closed Apr 17, 2026

Description

When upgrading Claude Code via the install script, the new binary is downloaded and placed in ~/.local/share/claude/versions/<version>, but the launcher symlink at ~/.local/bin/claude is not updated to point to the new version.

Steps to reproduce

# Starting from 2.1.97, install 2.1.112
curl -fsSL https://claude.ai/install.sh | bash -s -- 2.1.112

Installer output says success:

Setting up Claude Code...
✔ Claude Code successfully installed!
  Version: 2.1.112
  Location: ~/.local/bin/claude

But:

$ claude --version
2.1.97 (Claude Code)

$ ls -l ~/.local/bin/claude
lrwxr-xr-x  lance  staff  ~/.local/bin/claude -> ~/.local/share/claude/versions/2.1.97

$ ls ~/.local/share/claude/versions/
2.1.92   2.1.97   2.1.112

The new binary exists on disk but the symlink still points to the old version.

Expected behavior

After a successful install, ~/.local/bin/claude should be a symlink to the newly installed version (~/.local/share/claude/versions/2.1.112).

Workaround

ln -sfn ~/.local/share/claude/versions/2.1.112 ~/.local/bin/claude

Environment

  • macOS (Darwin arm64)
  • Shell: zsh
  • Claude Code 2.1.97 -> 2.1.112 upgrade

View original on GitHub ↗

4 Comments

pythoninthegrass · 6 months ago

Version-agnostic workaround that handles lexicographic sorting correctly (macOS ls -v does NOT do version sorting like GNU ls):

# Fix the symlink to the latest version
ln -sfn "$(ls ~/.local/share/claude/versions/* | sort -V | tail -1)" ~/.local/bin/claude

# Remove old versions to prevent the buggy installer from reverting
ls ~/.local/share/claude/versions/* | sort -V | head -n -1 | xargs rm -f

sort -V does proper version sorting so 2.1.112 sorts after 2.1.97.

github-actions[bot] · 6 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/41602
  2. https://github.com/anthropics/claude-code/issues/40987

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

pythoninthegrass · 6 months ago
github-actions[bot] · 5 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.