I thought about connecting rtk to Kimi Code CLI, but the current PreToolUse hook protocol makes it less efficient to do. To change a call, a hook can only block it with permissionDecision: "deny" and hope that the model tries again with the right command. It would be great to have a way to change the tool input and still let execution go on.
The idea
Instead of blocking and suggesting a fix:
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "deny",
"permissionDecisionReason": "Use `rtk git status` instead"
}
}
I'd like to return the rewritten input directly:
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"permissionDecision": "allow",
"updatedInput": {
"command": "rtk git status"
}
}
}
The tool runs with the mutated parameters. No block, no retry loop, no wasted tokens.
Claude Code supports this. Their hook protocol has updatedInput alongside permissionDecision — the decision controls permission flow, while updatedInput independently mutates tool parameters.
Would love to hear if this fits; I'm happy to create PR if needed 😄
I thought about connecting rtk to Kimi Code CLI, but the current PreToolUse hook protocol makes it less efficient to do. To change a call, a hook can only block it with
permissionDecision: "deny"and hope that the model tries again with the right command. It would be great to have a way to change the tool input and still let execution go on.The idea
Instead of blocking and suggesting a fix:
{ "hookSpecificOutput": { "hookEventName": "PreToolUse", "permissionDecision": "deny", "permissionDecisionReason": "Use `rtk git status` instead" } }I'd like to return the rewritten input directly:
{ "hookSpecificOutput": { "hookEventName": "PreToolUse", "permissionDecision": "allow", "updatedInput": { "command": "rtk git status" } } }The tool runs with the mutated parameters. No block, no retry loop, no wasted tokens.
Claude Code supports this. Their hook protocol has
updatedInputalongsidepermissionDecision— the decision controls permission flow, whileupdatedInputindependently mutates tool parameters.Would love to hear if this fits; I'm happy to create PR if needed 😄