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 claims any Claude or Cursor hook command that mentions rtk-rewrite.sh #4427
Claude and Cursor recognise the legacy hook with cmd.contains("rtk-rewrite.sh"): hook_already_present and remove_legacy_hook_entries_from_json in src/hooks/init/claude.rs, is_cursor_hook_entry and remove_legacy_cursor_hook_entries_from_json in src/hooks/init/cursor.rs. A user hook that only mentions the name is treated as RTK's.
Repro on develop 6f5503d, with ~/.claude/settings.json holding one PreToolUseBash group:
rtk init -g --auto-patch prints settings.json: hook already present and registers nothing; the file is unchanged, so RTK is not installed.
rtk init -g --uninstall removes all three (settings.json: removed RTK hook entry).
The same uninstall, with ~/.cursor/hooks.json holding echo rtk-rewrite.sh, /custom/rtk-rewrite.sh.backup and my-guard under preToolUse, leaves only my-guard.
Expected: only the script run on its own (one word whose file name is rtk-rewrite.sh) is RTK's. The Codex installer is getting the same rule in #4309.
Related: #4227 (the same class for Gemini), #3036 (uninstall removes a whole matcher group), #3693 (legacy script deleted before the replacement is registered).
Claude/Cursor hook detection uses substring match on 'rtk-rewrite.sh', wrongly claiming unrelated user hooks that merely mention the name during init/uninstall.
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
src/hooks/init/cursor.rs
Suggested Actions
Fix hook_already_present/remove_legacy_hook_entries_from_json in src/hooks/init/claude.rs to match the command as a…
Apply same fix to is_cursor_hook_entry/remove_legacy_cursor_hook_entries_from_json in src/hooks/init/cursor.rs
Hi @KuSh , About this implementation
We'd decouple the OpenCode plugin installation from Claude side failures: always attempt the OpenCode install, then report any errors, with regression tests for the malformed CLAUDE.md and read-only ~/.claude cases.Is this design okay ? or anything ekse
About this implementation We'd decouple the OpenCode plugin installation from Claude side failures: always attempt the OpenCode install, then report any errors, with regression tests for the malformed CLAUDE.md and read-only ~/.claude cases.Is this design okay ? or anything ekse
Hi @TechWizard9999, that's not the subject of the issue. Most of what you're talking about is already handled in #4269. If something is missing there, either review/comment on it or push a separate PR for what's missing.
Activity
rtk-wshm-sync-bot commentedon Oct 3, 2026
🔍 Automated Triage
bugmediumSummary
Claude/Cursor hook detection uses substring match on 'rtk-rewrite.sh', wrongly claiming unrelated user hooks that merely mention the name during init/uninstall.
📁 Relevant files
src/hooks/init/claude.rssrc/hooks/init/cursor.rsSuggested Actions
hook_already_present/remove_legacy_hook_entries_from_jsonin src/hooks/init/claude.rs to match the command as a…is_cursor_hook_entry/remove_legacy_cursor_hook_entries_from_jsonin src/hooks/init/cursor.rsrtk init --geminitreats any BeforeTool group whose first hook contains "rtk" as RTK's: uninstall deletes user hooks, install skips #4227 (Gemini) since they share the same matching bugTriaged automatically by wshm · This is an automated analysis, not a human review.
TechWizard9999 commentedon Oct 5, 2026
Hi @KuSh , Could you please assign it to me
TechWizard9999 commentedon Oct 5, 2026
Hi @KuSh , About this implementation
We'd decouple the OpenCode plugin installation from Claude side failures: always attempt the OpenCode install, then report any errors, with regression tests for the malformed CLAUDE.md and read-only ~/.claude cases.Is this design okay ? or anything ekse
KuSh commentedon Oct 5, 2026
Hi @TechWizard9999, that's not the subject of the issue. Most of what you're talking about is already handled in #4269. If something is missing there, either review/comment on it or push a separate PR for what's missing.