| name | claude-version |
| description | Manage Claude Code CLI versions across official installer and npm global installs. |
| version | 1.0.0 |
Claude CLI Version Management
Manage Claude Code CLI versions — install, switch, rollback, list.
Two install methods
| Method | How it works | Version switch |
|---|
Official installer (curl -fsSL https://claude.ai/install.sh | sh) | Standalone binary at ~/.local/share/claude/versions/<ver>, symlinked from ~/.local/bin/claude | Re-point the symlink |
npm global (npm i -g @anthropic-ai/claude-code) | Lives in the active Node prefix ($(npm prefix -g)/bin/claude) | npm i -g @anthropic-ai/claude-code@<ver> |
Detect which method is in use:
which claude
file $(readlink -f $(which claude))
Official installer method
Layout
| Path | Purpose |
|---|
~/.local/bin/claude | Symlink → active version |
~/.local/share/claude/versions/<ver> | Binary (≥ ~2.1.80) or wrapper script |
~/.local/share/claude/versions/<ver>-node/ | Unpacked npm package (for older Node-based versions) |
List / check
ls ~/.local/share/claude/versions/
readlink ~/.local/bin/claude
claude --version
Switch to an installed version
ln -sf ~/.local/share/claude/versions/<VERSION> ~/.local/bin/claude
Install a specific older version (< ~2.1.80, Node-based)
Recent versions (≥ ~2.1.80) are standalone ELF binaries. Older versions are Node.js packages and need a wrapper. Requires Node ≥ 18.
npm pack @anthropic-ai/claude-code@<VERSION> --pack-destination /tmp/
mkdir -p ~/.local/share/claude/versions/<VERSION>-node
tar xzf /tmp/anthropic-ai-claude-code-<VERSION>.tgz -C /tmp
cp -r /tmp/package/* ~/.local/share/claude/versions/<VERSION>-node/
cat > ~/.local/share/claude/versions/<VERSION> << 'EOF'
exec "$HOME/.nvm/versions/node/$(ls "$HOME/.nvm/versions/node" | sort -V | tail -1)/bin/node" \
"$HOME/.local/share/claude/versions/<VERSION>-node/cli.js" "$@"
EOF
chmod +x ~/.local/share/claude/versions/<VERSION>
ln -sf ~/.local/share/claude/versions/<VERSION> ~/.local/bin/claude
claude --version
Cleanup
Each binary release is ~220 MB. Remove old ones with:
rm ~/.local/share/claude/versions/<OLD>
rm -rf ~/.local/share/claude/versions/<OLD>-node
npm global method
Switch version
npm i -g @anthropic-ai/claude-code@<VERSION>
claude --version
Rollback
Same command with the older version number.
List available versions
npm view @anthropic-ai/claude-code versions --json | tail -20
Notes
- Switching versions does NOT affect the currently running Claude session — only new invocations.
- The two methods can coexist but
$PATH order determines which claude binary wins.
- When using npm method, ensure the active Node version is ≥ 18 (e.g. via nvm).