Back to skills
SKILL.md
Claude Version
FSecurityManage Claude Code CLI versions across official installer and npm global installs.
- 9 stars
- 0 votes
- 0 copies
- 1 view
- Added November 20, 2026
Works with
Security analysis
27/100- Pipes output to a shell interpreter
- Uses curl or wget to download content
- Performs destructive filesystem operations
- Downloads and executes remote scripts — classic supply chain attack
- Installs packages at runtime which could introduce malicious dependencies
npx -y skills add chnlich/charlie-bot --skill claude-version --agent claude-codeAre you the author of Claude Version?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/chnlich-claude-version)---
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:
```bash
which claude # ~/.local/bin/claude → official installer
# ~/.nvm/.../bin/claude → npm global
file $(readlink -f $(which claude)) # ELF = binary install, script/symlink = npm
```
## 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
```bash
ls ~/.local/share/claude/versions/ # installed versions
readlink ~/.local/bin/claude # active version
claude --version
```
### Switch to an installed version
```bash
ln -sf ~/.local/share/claude/versions/<VERSION> ~/.local/bin/claude
```
### Install a specific older version (< ~2.1.80, Node-based)
Requires Node ≥ 18.
```bash
# 1. Download & extract
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/
# 2. Create wrapper script
cat > ~/.local/share/claude/versions/<VERSION> << 'EOF'
#!/bin/bash
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>
# 3. Activate
ln -sf ~/.local/share/claude/versions/<VERSION> ~/.local/bin/claude
claude --version
```
### Cleanup
Each binary release is ~220 MB. Remove old ones with:
```bash
rm ~/.local/share/claude/versions/<OLD>
rm -rf ~/.local/share/claude/versions/<OLD>-node # if Node-based
```
## npm global method
### Switch version
```bash
npm i -g @anthropic-ai/claude-code@<VERSION>
claude --version
```
### Rollback
Same command with the older version number.
### List available versions
```bash
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.
Attribution
Related skills
View all in ai-agents →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.