Skip to content

feat: warn when installed hook is outdated (#344)#350

Merged
pszymkowiak merged 1 commit intomasterfrom
fix/hook-outdated-warning
Mar 5, 2026
Merged

feat: warn when installed hook is outdated (#344)#350
pszymkowiak merged 1 commit intomasterfrom
fix/hook-outdated-warning

Conversation

@pszymkowiak
Copy link
Collaborator

Summary

  • Add # rtk-hook-version: 2 header to the hook file for version tracking
  • New hook_check module: detects outdated hook at startup, prints warning to stderr (max 1/day via marker file)
  • Homebrew caveats updated: remind users to run rtk init -g after upgrade

Closes #344

How it works

  1. On every rtk invocation, hook_check::maybe_warn() reads ~/.claude/hooks/rtk-rewrite.sh
  2. Parses # rtk-hook-version: N from the first 5 lines
  3. If missing or < current version: prints [rtk] Hook outdated — run rtk init -g to update
  4. Warning is rate-limited to once per 24h via marker file

Test plan

  • 3 unit tests for version parsing (present, missing, future)
  • 620 tests pass
  • Manual: old hook (no tag) → warning shown
  • Manual: updated hook (version 2) → no warning
  • Manual: rtk init -g updates hook with version tag

@pszymkowiak pszymkowiak force-pushed the fix/hook-outdated-warning branch 2 times, most recently from 41c9556 to fbf1bf8 Compare March 5, 2026 21:16
- Add `# rtk-hook-version: 2` header to hook file
- New `hook_check` module: detect outdated hook on startup, warn 1/day
- Homebrew caveats: remind users to run `rtk init -g` after upgrade
@pszymkowiak pszymkowiak force-pushed the fix/hook-outdated-warning branch from fbf1bf8 to bc61cf3 Compare March 5, 2026 21:24
@pszymkowiak pszymkowiak merged commit 3141fec into master Mar 5, 2026
2 of 3 checks passed
FlorianBruniaux added a commit that referenced this pull request Mar 5, 2026
Version mentions (README.md, CLAUDE.md, ARCHITECTURE.md) were still
on 0.25.0. Module count was 56 (missed hook_check module added in #350).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
dragonGR pushed a commit to dragonGR/rtk that referenced this pull request Mar 5, 2026
- Add `# rtk-hook-version: 2` header to hook file
- New `hook_check` module: detect outdated hook on startup, warn 1/day
- Homebrew caveats: remind users to run `rtk init -g` after upgrade
dragonGR pushed a commit to dragonGR/rtk that referenced this pull request Mar 5, 2026
Version mentions (README.md, CLAUDE.md, ARCHITECTURE.md) were still
on 0.25.0. Module count was 56 (missed hook_check module added in rtk-ai#350).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Hook auto-update: warn when rtk-rewrite.sh is outdated

1 participant