You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With CLAUDE_CONFIG_DIR set, rtk init -g leaves the legacy hook script and "Hook outdated" never clears #4757
With CLAUDE_CONFIG_DIR set, rtk init -g does not remove a leftover legacy rtk-rewrite.sh from that directory, so rtk gain and the daily reminder keep printing Hook outdated — run rtk init -g to update after the user runs exactly that.
hook_check::status() reads the hook from resolve_claude_dir(), which honours CLAUDE_CONFIG_DIR. migrate_old_hook_script() (src/hooks/init/claude.rs) looks for the legacy script only under user_dirs::home().join(".claude"). With the binary hook registered and $CLAUDE_CONFIG_DIR/hooks/rtk-rewrite.sh still present, status is Outdated, and the migration never sees the file that causes it.
/x/settings.json = {"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"rtk hook claude"}]}]}}
/x/hooks/rtk-rewrite.sh = #!/bin/bash\n# rtk-hook-version: 4
$ rtk gain -> [warn] Hook outdated — run `rtk init -g` to update
$ rtk init -g --auto-patch
$ rtk gain -> [warn] Hook outdated — run `rtk init -g` to update
/x/hooks/rtk-rewrite.sh still present
Same on v1.0.1 and on develop 2dabd83. A fix passes when, after rtk init -g with CLAUDE_CONFIG_DIR set, the script under that directory and its settings entry are gone and rtk gain no longer warns, and the ~/.claude case keeps working as today.
migrate_old_hook_script() hardcodes ~/.claude instead of resolve_claude_dir(), so legacy rtk-rewrite.sh under CLAUDE_CONFIG_DIR is never removed and 'Hook outdated' persists after rtk init -g.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/hooks/init/claude.rs
Suggested Actions
In src/hooks/init/claude.rs, make migrate_old_hook_script() use resolve_claude_dir() instead of home().join(".claude")
Add regression test with CLAUDE_CONFIG_DIR set and a stale hooks/rtk-rewrite.sh present
Verify hook_check::status() reflects removal after fix so rtk gain stops warning
There are 2 open pull requests for this issue: #4774, #4798 (oldest first).
If you were about to start on it, reviewing or testing one of these helps more than another pull request: a note on which approach fits, or a test result on your setup, is welcome on the pull request itself.
Activity
rtk-wshm-sync-bot commentedon Oct 23, 2026
🔍 Automated Triage
bugmediumSummary
migrate_old_hook_script() hardcodes ~/.claude instead of resolve_claude_dir(), so legacy rtk-rewrite.sh under CLAUDE_CONFIG_DIR is never removed and 'Hook outdated' persists after rtk init -g.
📁 Relevant files
src/hooks/init/claude.rsSuggested Actions
Triaged automatically by wshm · This is an automated analysis, not a human review.
KuSh commentedon Oct 31, 2026
There are 2 open pull requests for this issue: #4774, #4798 (oldest first).
If you were about to start on it, reviewing or testing one of these helps more than another pull request: a note on which approach fits, or a test result on your setup, is welcome on the pull request itself.