Repository navigation
Description
Summary
Hook detection accepts the native inline hook only when the command string is exactly rtk hook claude. Adding any argument — including the two flags documented in rtk hook --help, --ultra-compact and --skip-env — makes RTK consider the hook absent.
The hook itself still works perfectly; only the detection is wrong. The result is a permanent SKIP RTK hook not installed in rtk verify plus the recurring [rtk] /!\ No hook installed — run 'rtk init -g' banner, on an installation that is correct and active.
This is distinct from #913 / #1734 / #3731, which are about other agents (OpenCode, Codex, Cursor) not being recognised. Here it is the Claude native hook, in the very form rtk init -g writes, that is rejected as soon as it carries a documented flag.
Environment
- RTK
0.49.0(rtk-x86_64-unknown-linux-musl.tar.gz, binary in~/.local/bin/rtk) - Linux 6.1.0 (Debian), Claude Code 2.1.280
- Hook installed in
~/.claude/settings.json:{ "hooks": { "PreToolUse": [ { "matcher": "Bash", "hooks": [ { "type": "command", "command": "rtk hook claude --ultra-compact --skip-env" } ] } ] } }
Reproduction
probe() { # $1 = command string to put in settings.json
H=$(mktemp -d); mkdir -p "$H/.claude"
printf '{"hooks":{"PreToolUse":[{"matcher":"Bash","hooks":[{"type":"command","command":"%s"}]}]}}' "$1" \
> "$H/.claude/settings.json"
printf '%-45s -> %s\n' "$1" "$(HOME=$H rtk verify 2>&1 | grep -E 'native binary hook|not installed' | head -1)"
}
probe 'rtk hook claude'
probe 'rtk hook claude --ultra-compact'
probe 'rtk hook claude --skip-env'
probe 'rtk hook claude --ultra-compact --skip-env'
probe '/usr/local/bin/rtk hook claude'
probe 'rtk hook claude'
probe 'rtk --ultra-compact hook claude'Observed on 0.49.0:
command in settings.json |
result |
|---|---|
rtk hook claude |
PASS native binary hook registered in settings.json |
rtk hook claude (doubled spaces) |
PASS |
/usr/local/bin/rtk hook claude (absolute path) |
PASS |
rtk hook claude --ultra-compact |
SKIP RTK hook not installed |
rtk hook claude --skip-env |
SKIP |
rtk hook claude --ultra-compact --skip-env |
SKIP |
rtk --ultra-compact hook claude (flag before subcommand) |
SKIP |
A path prefix and repeated whitespace are tolerated, so the matcher does normalise somewhat — but any extra token, in any position, fails. There is no placement of the flags that keeps both the flags and the detection.
Meanwhile the hook is demonstrably live:
$ echo '{"tool_name":"Bash","tool_input":{"command":"git status"}}' \
| rtk hook claude --ultra-compact --skip-env
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecisionReason":"RTK auto-rewrite",
"updatedInput":{"command":"rtk git status"},"permissionDecision":"allow"}}Expected
Any command whose resolved invocation is rtk hook claude should be recognised regardless of the flags it carries — --ultra-compact and --skip-env are documented options of that exact subcommand, so a hook using them is a supported configuration, not an unknown one.
The same predicate appears to back the [rtk] /!\ No hook installed banner, so fixing it once should silence both.
Impact
Low severity, but it is self-defeating in two ways: the warning tells users to run rtk init -g, which would overwrite their flagged hook with the bare form and silently drop --ultra-compact/--skip-env; and the banner itself spends tokens on every affected install, which is the opposite of what RTK is for. It also makes rtk verify unusable as a health check for anyone who tuned their hook.
Activity
KuSh commentedon Sep 24, 2026
The same detector (
hook_check::binary_hook_registered) also fails the other way. It ignores the groupmatcherand the hooktype, so a registration Claude Code never runs onBashcounts as installed and the banner stays silent. With #4151,rtk init --showchecks both and reports it correctly, so once it merges the two disagree.Probed with
rtk ls .(banner) andrtk init --show,LC_ALL=C, freshHOME, on develop f5e104e and on #4151's head:~/.claude/settings.json--showdevelop--show#4151{}(control)[warn][warn]matcher: "Bash",rtk hook claude[ok][ok]matcher: "Read",rtk hook claude[ok][warn]matcher: "Bash",type: "prompt",command: "rtk hook claude"[ok][warn]Reading through
hook_already_present(which after #4151 applies Claude's matcher rules and the command/type check) would make the banner and--showagree on matcher and type; the flag handling this issue is about still needs its own fix.