Skip to content

Add version upgrade notification at session start#218

Open
calreynolds wants to merge 3 commits intomainfrom
feat/upgrade-checker
Open

Add version upgrade notification at session start#218
calreynolds wants to merge 3 commits intomainfrom
feat/upgrade-checker

Conversation

@calreynolds
Copy link
Collaborator

@calreynolds calreynolds commented Mar 5, 2026

Screenshot 2026-03-05 at 2 18 42 PM

Summary

  • Adds a non-blocking version check that runs via Claude Code SessionStart hook
  • Compares local installed version against latest on GitHub, notifies user if an update is available
  • Results cached for 24 hours to avoid repeated network requests
  • Silent on any failure (offline, timeout, missing files)

How it works

check_update.sh runs at session start. Its stdout is injected as context Claude sees, so it naturally relays the upgrade notice to the user before proceeding with their request.

Supports all install paths:

  • Plugin mode: reads $CLAUDE_PLUGIN_ROOT/VERSION
  • Project-scoped install: reads .ai-dev-kit/version in project dir
  • Global install: reads ~/.ai-dev-kit/version

What users see

When outdated (once per new session, max once per 24h network check):

╔══════════════════════════════════════════════════════════════╗
║                                                             ║
║   Databricks AI Dev Kit — update available!                 ║
║                                                             ║
║   Installed:  v0.1.2                                        ║
║   Available:  v0.1.3                                        ║
║                                                             ║
║   To upgrade, run:                                          ║
║   bash <(curl -sL https://raw.githubusercontent.com/        ║
║     databricks-solutions/ai-dev-kit/main/install.sh)        ║
║                                                             ║
╚══════════════════════════════════════════════════════════════╝

When up to date or offline: nothing.

Files changed

  • .claude-plugin/check_update.sh (new) — version check script with 24h cache
  • hooks/hooks.json (modified) — added check_update hook to SessionStart

Test plan

  • Install v0.1.2 in a temp folder, start Claude Code session — should see upgrade banner
  • Start another session — should still see banner (cached, versions still differ)
  • Update to v0.1.3, clear cache, start session — should see nothing
  • Disconnect from network, clear cache, start session — should see nothing (silent fail)
  • For install.sh users: add hook to .claude/settings.json pointing to check_update.sh

🤖 Generated with Claude Code

calreynolds and others added 3 commits March 5, 2026 14:21
Users don't know when a newer version of ai-dev-kit is available.
This adds a lightweight check that runs at Claude Code session start
and notifies the user if an update exists.

How it works:
- check_update.sh compares local version against GitHub latest
- Results cached for 24h to avoid repeated network requests
- Silent on any failure (offline, timeout, missing files)
- Hook stdout is injected as context Claude sees and relays

Supports multiple install paths:
- Plugin mode (CLAUDE_PLUGIN_ROOT/VERSION)
- Project-scoped install (.ai-dev-kit/version)
- Global install (~/.ai-dev-kit/version)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire the check_update.sh hook into .claude/settings.json during
install so that install.sh users (not just plugin users) get the
version notification at session start.

Uses Python JSON merge when possible to safely add the hook to
existing settings without overwriting other config. Falls back
to writing a new file if settings.json doesn't exist yet.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move the install command out of the ASCII box into its own code block
on a single line so users can select and copy it cleanly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@calreynolds calreynolds marked this pull request as ready for review March 5, 2026 19:41
@calreynolds calreynolds linked an issue Mar 5, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade available notification for current ai-dev-kit users

1 participant