Repository navigation
Description
rtk hook vibe: no rewrite when tool_name is namespaced (file_system.bash)
Summary
rtk hook vibe (v0.50.0) silently passes through — exit 0, empty stdout — when the
tool_name field in the hook stdin JSON is file_system.bash instead of bash.
This is exactly what the Mistral Vibe CLI sends when running on its Unified
Harness backend, so the pre_tool rewrite hook never fires on those sessions,
with no warning or diagnostic.
Context
-
rtk version: 0.50.0 (Homebrew,
rtk --version), macOS arm64 (/opt/homebrew/bin/rtk) -
Host tool: Mistral Vibe CLI (vibe 2.25.8), hook type
pre_tool, matcherbash -
Hook config:
[[hooks]] name = "rtk-rewrite" type = "pre_tool" match = "bash" command = "rtk hook vibe" timeout = 10.0 strict = false
Vibe's hook wire protocol sends a JSON object on stdin containing, among other
fields: hook_event_name, session_id, transcript_path, cwd, tool_name,
tool_call_id, tool_input.
On the legacy harness backend the bash tool is named bash and the hook works
as expected. On the Unified Harness backend (current default for new
sessions), built-in tools are namespaced group.function, so the bash tool is
file_system.bash and that value is what appears in tool_name in the hook
payload.
Problem
rtk hook vibe compares tool_name strictly against "bash". When it receives
"file_system.bash" it treats the event as out of scope and exits 0 with empty
stdout — which Vibe interprets as "pass through", so the command runs unrewritten
and no token savings happen. There is no stderr, no warning, nothing to diagnose.
Note the asymmetry: Vibe's own hook matcher normalizes match = "bash" so that
the binding does fire for file_system.bash (confirmed in the session journal:
the hook action records hook_binding_ids: ["user:rtk-rewrite"] and
hook_run_started / hook_run_completed), but the rewrite is silently dropped
inside rtk. The net effect looks to the user like "the hook never runs".
Reproduction
# Control — bare tool name (legacy harness): rewritten
echo '{"hook_event_name":"pre_tool","session_id":"s","parent_session_id":null,
"transcript_path":"/tmp/t","cwd":"/tmp","tool_name":"bash",
"tool_call_id":"c1","tool_input":{"command":"git status"}}' | rtk hook vibe
# -> {"hook_specific_output":{"tool_input":{"command":"rtk git status"}},
# "system_message":"rtk: rewrote to `rtk git status`"}
# Bugged — namespaced tool name (Unified Harness): silent pass-through
echo '{"hook_event_name":"pre_tool","session_id":"s","parent_session_id":null,
"transcript_path":"/tmp/t","cwd":"/tmp","tool_name":"file_system.bash",
"tool_call_id":"c1","tool_input":{"command":"git status"}}' | rtk hook vibe
# -> (no output, exit 0)Same command string, same JSON shape, only tool_name differs. Verified with
rtk 0.50.0; the same behavior reproduces for other subcommands (git -C <path> status, git log …).
Expected behavior
rtk hook vibe should rewrite the command for tool_name: "file_system.bash"
exactly as it does for tool_name: "bash".
Suggested fix
Normalize tool_name before the scope check in the vibe hook handler:
- strip a leading
group.segment (i.e. accept<anything>.bash), and/or - explicitly accept
bashandfile_system.bashin the set of recognized
tool names.
Case-insensitive comparison would also be consistent with Vibe's matcher
semantics. Keeping the match list extensible (e.g. a small set of known
namespaced variants) avoids surprises if Vibe renames groups again — the
Windows managed shell tools use bare names (git_bash, powershell), so the
normalization should not break those.
An alternative would be a flag or env var to extend the accepted tool names,
but the namespaced name is what Vibe actually sends today, so accepting it by
default seems right.
Workaround (used in the meantime)
Normalize the payload with jq before rtk:
command = "jq -c 'if .tool_name == \"file_system.bash\" then .tool_name = \"bash\" else . end' | rtk hook vibe"This is fragile (it hardcodes the group name) and why an upstream fix is
preferred.
Activity
rtk-wshm-sync-bot commentedon Sep 30, 2026
🔍 Automated Triage
bughighSummary
rtk hook vibe silently no-ops when tool_name is namespaced (file_system.bash) under Vibe's Unified Harness, defeating command rewriting without any diagnostic.
📁 Relevant files
src/hooks/vibe.rsSuggested Actions
group.or match a known-alias set (bash, file_system.bash)Triaged automatically by wshm · This is an automated analysis, not a human review.