Never manually update Claude Code again! This plugin automatically checks for and installs updates whenever you start a new session.
- Automatic updates - Updates install silently on session start
- Cross-platform - Works on macOS, Windows, and Linux
- Smart detection - Auto-detects your package manager (brew, winget, apk, or npm)
- Non-blocking - Updates run in the background, just restart to apply
| Platform | Package Manager | Install Command |
|---|---|---|
| macOS | Homebrew | brew install claude-code |
| Windows | winget | winget install Anthropic.ClaudeCode |
| Linux | apk (Alpine) | apk add claude-code |
| All | npm | npm install -g @anthropic-ai/claude-code |
git clone https://github.com/yusufsaber/claude-code-auto-update.gitEdit your settings file:
- macOS/Linux:
~/.claude/settings.json - Windows:
%USERPROFILE%\.claude\settings.json
Add the SessionStart hook (merge with existing hooks if you have any):
{
"hooks": {
"SessionStart": [
{
"matcher": ".*",
"hooks": [
{
"type": "command",
"command": "node /path/to/claude-code-auto-update/hooks/auto-update.js"
}
]
}
]
}
}Note: Replace
/path/to/claude-code-auto-updatewith the actual path where you cloned this repo.
Since this plugin handles updates automatically, you can hide Claude's "Update available!" message.
macOS/Linux - Add to your ~/.zshrc or ~/.bashrc:
export DISABLE_AUTOUPDATER=1Windows - Add to your PowerShell profile:
$env:DISABLE_AUTOUPDATER = "1"Then restart your terminal.
┌─────────────────────────────────────────────────────────┐
│ Claude Code Starts │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ SessionStart hook triggers plugin │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Detect package manager (brew/winget/apk/npm) │
└─────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────┐
│ Check if update is available │
└─────────────────────────────────────────────────────────┘
│
┌───────────┴───────────┐
│ │
▼ ▼
┌───────────┐ ┌───────────────┐
│ No update │ │ Update found! │
│ Continue │ │ Run upgrade │
└───────────┘ └───────────────┘
│
▼
┌───────────────┐
│ Restart Claude│
│ to apply │
└───────────────┘
Every time you start a new Claude Code session.
The check is fast (< 1 second). Updates only download when available.
The plugin fails silently and lets Claude Code continue normally. You can always update manually.
Package managers (brew, winget) may take up to 24 hours to publish new releases after they're available on npm. This is normal.
MIT © Yusuf Saber