Fix claude update downloading 226 MB every time

Every time you run claude update, it downloads the full release tarball (~226 MB) — even when your installation is already the latest version. On typical WSL2 connections this is ~30 s of wall time and ~226 MB of silently-metered bandwidth per check.

Upstream report (#51243): Opened 2026-04-20 by @phil71x on Claude Code 2.1.114. Confirmed via strace that the command receives ~226 MB across 6,915 socket reads, then prints "Claude Code is up to date." Labels: area:packaging, bug, has repro, platform:wsl. Status: open, no upstream fix yet.

What the wrapper does

Before calling claude update, it asks the npm registry (~2 KB response) for the latest version and compares against claude --version. If they match it prints "up to date" and exits without downloading anything. If a newer version actually exists, it calls the real claude update as usual.

pathwall timebytes down
claude update~30 s~226 MB
wrapper, up-to-date~0.3 s~2 KB (first run), 0 B (cache hit)
wrapper, update exists~30 s~226 MB (only when the release actually changed)
Safe by design: if neither the npm registry nor the GitHub Releases API can be reached, the wrapper falls through to the real claude update. You never end up without an update path.

Install

Option A — from cc-guard

npx @gaebalai/cc-guard --install-example claude-update-smart

Option B — download the one file

curl -fsSL https://raw.githubusercontent.com/gaebalai/cc-guard/main/examples/claude-update-smart.sh \
  -o ~/bin/claude-update-smart
chmod +x ~/bin/claude-update-smart

Option C — shadow the command

Add to your ~/.bashrc or ~/.zshrc:

alias claude-update='bash ~/bin/claude-update-smart'

Tested with

WSL2 Ubuntu 22.04, claude 2.1.118 + 2.1.119, against the npm registry and api.github.com/repos/anthropics/claude-code/releases/latest. 15 automated assertions covering up-to-date skip, update-available path, stale-cache handling, missing-binary fallthrough, no-network fallthrough.

Environment knobs

variabledefaultpurpose
CLAUDE_UPDATE_SMART_CACHE~/.cache/claude-update-smart.jsonWhere to cache the registry response
CLAUDE_UPDATE_SMART_TTL3600Cache lifetime in seconds
CLAUDE_UPDATE_SMART_NO_EXEC(unset)Print the decision only, do not call the real updater (for scripting and testing)

Why publish this as a separate page

Issue #51243 has been open for four days with no upstream response. A separate landing page makes the workaround discoverable from search engines before a package-level fix lands. If Anthropic ships a proper HEAD-request or metadata-endpoint fix, this page and the wrapper become unnecessary — and that will be a good day.