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
rtk init --gemini treats any BeforeTool group whose first hook contains "rtk" as RTK's: uninstall deletes user hooks, install skips #4227
patch_gemini_settings and uninstall_gemini (src/hooks/init.rs) decide ownership with h.pointer("/hooks/0/command")...contains("rtk") on each BeforeTool group. This has two consequences:
A user hook that shares a group with RTK's hook is deleted on uninstall. The whole group is dropped.
A user hook whose path merely contains rtk counts as RTK's hook. Install then skips adding the real one, and uninstall deletes the user's.
Reproduced on develop f5e104e with LC_ALL=C and a fresh HOME:
#4151 moves Claude, Codex, Cursor and Trae onto one presence/removal implementation, which matches the exact RTK command and removes only RTK's hook from a group. Moving Gemini onto it, or at least onto an exact-command, per-hook rule, closes both cases.
Gemini hook ownership detection in patch_gemini_settings/uninstall_gemini uses a substring match on the group's first hook, causing user hooks to be deleted on uninstall and RTK's hook to be skipped on install when they share a group or path substring.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
The warning check added in #4343 (gemini::is_configured(), read by rtk gain and the daily reminder) uses the same rule: a run_shell_command or * group whose first hook's command contains rtk counts as an RTK install. Two more consequences, both measured on #4343's head merged onto develop 2dabd83 (LC_ALL=C, fresh HOME, ~/.claude without a hook):
# G3: user hook whose path contains "rtk", no RTK hook
~/.gemini/settings.json = {"hooks":{"BeforeTool":[{"matcher":"run_shell_command","hooks":[
{"type":"command","command":"/home/u/src/rtk/tools/audit.sh"}]}]}}
$ rtk gain -> no warning (v1.0.1 and develop: "No hook installed")
# G4: RTK registered, script deleted
$ rtk init -g --gemini --auto-patch; rm ~/.gemini/hooks/rtk-hook-gemini.sh
$ rtk gain -> no warning (v1.0.1 and develop: "No hook installed")
An exact-command rule for install and uninstall, shared with the probe, would close G3 as well. G4 additionally needs the probe to check that the registered script exists; Claude's hook_status() reports a settings entry for a deleted legacy script as Missing.
Activity
rtk-wshm-sync-bot commentedon Sep 25, 2026
🔍 Automated Triage
bugmediumSummary
Gemini hook ownership detection in patch_gemini_settings/uninstall_gemini uses a substring match on the group's first hook, causing user hooks to be deleted on uninstall and RTK's hook to be skipped on install when they share a group or path substring.
📁 Relevant files
src/hooks/init.rsSuggested Actions
.pointer("/hooks/0/command").contains("rtk")with an exact match against RTK's known command string, checked …Triaged automatically by wshm · This is an automated analysis, not a human review.
KuSh commentedon Oct 23, 2026
The warning check added in #4343 (
gemini::is_configured(), read byrtk gainand the daily reminder) uses the same rule: arun_shell_commandor*group whose first hook's command containsrtkcounts as an RTK install. Two more consequences, both measured on #4343's head merged onto develop 2dabd83 (LC_ALL=C, freshHOME,~/.claudewithout a hook):An exact-command rule for install and uninstall, shared with the probe, would close G3 as well. G4 additionally needs the probe to check that the registered script exists; Claude's
hook_status()reports a settings entry for a deleted legacy script as Missing.