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
delegates call rtk rewrite <cmd> without --, so a command of --help or -h comes back as rtk's help text with exit 0 #5127
rtk rewrite takes the command as one positional argument. When that argument reads as an option of rtk rewrite itself, clap handles it as one (rtk 1.2.0 and develop):
Exit 0 with non-empty stdout is the "rewrite, allowed" answer, so a delegate hands the usage text to the shell as the command to run. The Claude Code and Cursor shell hooks also mark it auto-allowed, since exit 0 is their allow case. Six call sites pass the command without --:
--help or -h is not a valid shell command on its own, so the practical harm is small: the agent gets "command not found" errors from usage lines instead of the same error for --help. The fix is to pass -- before the command at each site. rtk rewrite -- "<cmd>" works on 1.1.0, 1.2.0 and develop. The embedding guide (#3918) now documents the -- form.
rtk rewrite <cmd> passes the command without a -- separator, so clap parses --help/-h as rtk's own help flags and exits 0 with usage text, which delegates misread as an allowed-rewrite result.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
hooks/pi/rtk.ts
hooks/hermes/rtk-rewrite/__init__.py
openclaw/index.ts
hooks/claude/rtk-rewrite.sh
hooks/cursor/rtk-rewrite.sh
.claude/hooks/rtk-rewrite.sh
Suggested Actions
Add -- before the command argument at all six call sites listed in the issue
I'd like to take this one. Plan: pass -- before the command at the six call sites you listed (pi, hermes, openclaw and the three rtk-rewrite.sh hooks), and add a test per site that a command of --help / -h reaches rtk rewrite as the positional argument (non-zero exit, no usage text on stdout) while git status still rewrites. I'll send the PR against develop.
Activity
rtk-wshm-sync-bot commentedon Nov 16, 2026
🔍 Automated Triage
bugmediumSummary
rtk rewrite <cmd>passes the command without a--separator, so clap parses--help/-has rtk's own help flags and exits 0 with usage text, which delegates misread as an allowed-rewrite result.📁 Relevant files
hooks/pi/rtk.tshooks/hermes/rtk-rewrite/__init__.pyopenclaw/index.tshooks/claude/rtk-rewrite.shhooks/cursor/rtk-rewrite.sh.claude/hooks/rtk-rewrite.shSuggested Actions
--before the command argument at all six call sites listed in the issue--help/-has the literal command stringrtk rewritewithout a deadline from PreToolUse — see correction, rtk was NOT the cause of our timeouts #3589's PreToolUse hook-call hardening discussion for contextTriaged automatically by wshm · This is an automated analysis, not a human review.
LeviReisJs commentedon Nov 16, 2026
I'd like to take this one. Plan: pass
--before the command at the six call sites you listed (pi, hermes, openclaw and the threertk-rewrite.shhooks), and add a test per site that a command of--help/-hreachesrtk rewriteas the positional argument (non-zero exit, no usage text on stdout) whilegit statusstill rewrites. I'll send the PR againstdevelop.