Problem
rtk hook claude parses tool_name / tool_input from stdin, but Claude Code now sends tool / input.
Result: hook exits 0 with no output → no rewrite → commands (grep, head, cat) bypass RTK.
Reproduction
# ❌ What Claude Code sends (no rewrite)
echo '{"tool":"Bash","input":{"command":"grep -r hello ."}}' | rtk hook claude
# exit 0, empty output
# ✅ What RTK expects (rewrite works)
echo '{"tool_name":"Bash","tool_input":{"command":"grep -r hello ."}}' | rtk hook claude
# {"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecisionReason":"RTK auto-rewrite","updatedInput":{"command":"rtk grep -r hello ."}}}
Version
- rtk 0.42.4 (Homebrew)
- Claude Code — latest (June 2026)
Suggested fix
Accept both key formats in the JSON parser — fall back from tool_name to tool (and tool_input to input).
Workaround
Wrapper script that remaps keys before piping to rtk hook claude:
#!/bin/bash
cat | python3 -c "
import sys, json
d = json.load(sys.stdin)
if 'tool_name' not in d and 'tool' in d:
d['tool_name'] = d.pop('tool')
if 'tool_input' not in d and 'input' in d:
d['tool_input'] = d.pop('input')
print(json.dumps(d))
" | rtk hook claude
Problem
rtk hook claudeparsestool_name/tool_inputfrom stdin, but Claude Code now sendstool/input.Result: hook exits 0 with no output → no rewrite → commands (
grep,head,cat) bypass RTK.Reproduction
Version
Suggested fix
Accept both key formats in the JSON parser — fall back from
tool_nametotool(andtool_inputtoinput).Workaround
Wrapper script that remaps keys before piping to
rtk hook claude: