-
Notifications
You must be signed in to change notification settings - Fork 331
Closed
Labels
P2-importantDevrait être fixé bientôtDevrait être fixé bientôtenhancementNew feature or requestNew feature or request
Description
Problem
Users who installed the hook before v0.25.0 (PR #241) still have the old 200+ line bash hook that:
- Duplicates all rewrite logic (instead of delegating to
rtk rewrite) - Ignores
[hooks] exclude_commandsconfig (Support exclude_commands config for auto-rewrite hook #243/fix: curl JSON size guard (#297) + exclude_commands config (#243) #342) - Won't benefit from any future rewrite rule changes without manual
rtk init -g
There's no mechanism to detect or update stale hooks. Users stay on the old version silently.
Proposal
Add a hook version check on rtk startup:
- Add a version comment at the top of the hook:
# rtk-hook-version: 2 - On startup (or on
rtk rewrite), check the installed hook file - If the hook is outdated (missing version tag or old version), print a one-line warning to stderr:
[rtk] Hook outdated — run `rtk init -g` to update - Show the warning at most once per day (marker file, same pattern as telemetry)
Why not auto-patch?
The hook file lives in user space (~/.claude/hooks/). Silently modifying it could break custom modifications. A warning is safer and lets the user decide when to update.
Acceptance criteria
- Hook file has a
# rtk-hook-version: Nheader -
rtk rewritechecks installed hook version - Warning printed to stderr if outdated (max 1/day)
-
rtk init -gbumps the version header -
rtk init --showdisplays hook version status
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2-importantDevrait être fixé bientôtDevrait être fixé bientôtenhancementNew feature or requestNew feature or request