check_update.sh: direction-less version compare + stale 24h cache produce backwards "update available" banners
What happened
On 2026-07-02 the SessionStart hook (.claude-plugin/check_update.sh) displayed:
Installed: v0.1.13
Available: v0.1.12
i.e. it urged an "upgrade" to an older version. The live remote VERSION on main was already 0.1.13 — no update existed.
Root cause (two interacting issues)
-
Direction-less compare — the banner fires on any string mismatch, not just a real upgrade:
# check_update.sh, line 51 if [ -n "$remote_ver" ] && [ "$remote_ver" != "$local_ver" ]; then -
Stale cache —
~/.ai-dev-kit/.update-checkis trusted for 24h. Ours heldREMOTE_VERSION=0.1.12from a fetch made shortly beforemain'sVERSIONmoved to0.1.13. After a local update to 0.1.13, every session for the rest of the cache TTL compared fresh-local against stale-remote and produced the backwards banner. (rm ~/.ai-dev-kit/.update-checkclears it.)
A local version can legitimately be ahead of the cached remote for up to 24h after any upgrade — so this reproduces for anyone who updates within the cache window.
Suggested fix
-
Only fire when remote is strictly newer, e.g.:
newest=$(printf '%s\n%s\n' "$local_ver" "$remote_ver" | sort -V | tail -1) if [ "$newest" = "$remote_ver" ] && [ "$remote_ver" != "$local_ver" ]; then -
Optionally: invalidate/refresh the cache when
local_veris newer than the cached remote, since that state proves the cache is stale.
Aware this file is on death row
#548 retires .claude-plugin/ (including this script) after the #547 soak — if that lands soon, feel free to close this as overtaken. Two notes while the window is open:
- During the soak, every user who upgrades will hit the backwards banner for up to 24h (the buggy compare ships in the same window that generates version churn).
- #548's test plan explicitly does not garbage-collect the
SessionStarthook entry thatinstall.shpreviously wrote into existing users'~/.claude/settings.json— once the script is deleted, those users get a dangling hook (bash: .../check_update.sh: No such file or directory) at every session start until they remove it by hand. A note in the release/migration docs would help.
Environment: global install (install.sh --global), macOS, ai-dev-kit 0.1.13.
Fixed — and fixed the way you suggested.
.claude-plugin/check_update.sh now gates on sort -V -C so the banner only fires when the remote is strictly newer, with an inline comment describing this exact backwards-nudge scenario. The script is also deprecated now: skills install through databricks aitools, so the whole update-check path is on its way out as you anticipated.
Thanks for tracing the cache/compare interaction — the 24h stale-cache window was the non-obvious half.