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
Hook output should include permissionDecision: "allow" so rewritten commands don't trigger Claude Code permission prompts (Mac desktop app) #1771
When using rtk hook claude as a PreToolUse Bash hook in Claude Code (Mac desktop app), every rewritten command triggers a permission prompt — even with permissions.defaultMode: "bypassPermissions" in settings.json.
The CLI version of Claude Code does honor bypassPermissions, but the Mac desktop app appears to re-evaluate permissions against the rewritten command (rtk git status) instead of the original (git status). Since rtk isn't on any allowlist by default, every command prompts.
Add "permissionDecision": "allow" to the JSON returned by rtk hook claude whenever the hook successfully rewrites a command. The user already opted into rtk by running rtk init -g; reprompting them per-command defeats the transparent-rewrite design.
Workaround for affected users
Add to ~/.claude/settings.json:
{
"permissions": {
"allow": ["Bash(rtk *)"]
}
}
But this is a workaround — the fix belongs in the hook output itself, since rtk is the only thing that knows the rewrite happened and that it should be auto-trusted.
The same issue occurs in GitHub Copilot CLI (v1.0.60), which shares the same copilot-agent-runtime as Claude Code.
Copilot CLI specifics
Copilot CLI reads hooks from ~/.claude/settings.json (shared runtime)
The /allow-all command calls session.permissions.setAllowAll, which covers standard tool/path/URL permissions
However, hook-generated permission requests (PermissionPromptRequestHook kind) are not covered by /allow-all — they are treated as plugin-initiated confirmations that override the allow-all state
Result: every RTK-rewritten bash command still triggers "Do you want to allow this tool call?" even after /allow-all
rtk hook copilot explicitly returns "ask"
$ echo'{"tool_name":"bash","tool_input":{"command":"ls -la"}}'| rtk hook copilot
{"hookSpecificOutput":{"hookEventName":"PreToolUse","permissionDecision":"ask","permissionDecisionReason":"RTK auto-rewrite","updatedInput":{"command":"rtk ls -la"}}}
The copilot subcommand explicitly sets "permissionDecision":"ask", while the claude subcommand omits it (both result in a prompt).
Workaround
Wrapper script that forces "permissionDecision":"allow" in the hook output:
#!/usr/bin/env bash
output=$(rtk hook claude "$@")
rc=$?if [ $rc-ne 0 ] || [ -z"$output" ];thenecho"$output";exit$rc;fiifecho"$output"| grep -q '"updatedInput"';thenifecho"$output"| grep -q '"permissionDecision":"ask"';thenecho"$output"| sed 's/"permissionDecision":"ask"/"permissionDecision":"allow"/'elseecho"$output"| sed 's/"hookEventName":"PreToolUse"/"hookEventName":"PreToolUse","permissionDecision":"allow"/'fielseecho"$output"fi
I'm having this issue, but wouldn't the proposed fix be similar to having Bash(*) in the allowed commands?
This seems indicative of a potential flaw in either RTK's hook model or Claude Code's handling of Process Wrappers, wherein custom wrappers can't be registered, and hooks don't appear to allow permission-opaque rewrites.
There may be a possible workaround if RTK and other such wrappers can somehow call out to the permissions API to explicitly request permission for the rewrite, then pass that permission along in the hook response.
It looks like #1809 attempts this through check_command_with_rules reading over the existing claude ruleset, but pushing for first-party support for custom process wrappers from Anthropic may be a better solution long-term.
Confirming this on macOS with rtk 0.49.0 and Claude Code 2.1.266, with one detail that I think
explains why reports of this vary so widely: whether you see the prompt depends on the Bash
sandbox, and when the sandbox is on, it only surfaces for commands containing an = token.
With the sandbox disabled
Every rewritten command prompts, exactly as the issue describes.
With the sandbox enabled
sandbox.enabled: true plus autoAllowBashIfSandboxed (which defaults to true) silently clears
almost every rewritten command, so the fallthrough is invisible. It becomes visible only when all
three of these hold at once:
rtk rewrites at least one segment of the command
the command has two or more chained segments
some token in the command contains =
Minimal pair, run in the same session on the same file:
echo"hello world"; cat FILE # no promptecho"=== test ==="; cat FILE # prompts
The banner is not special — echo "a=b"; cat FILE prompts too. Dropping any one of the three
conditions removes the prompt:
Command
rewrite
chained
=
prompt
cat FILE
yes
no
no
no
cat FILE; echo x; cat FILE2
yes
yes
no
no
echo "hello world"; cat FILE
yes
yes
no
no
echo "=== x ==="
no
no
yes
no
echo "a=b"; echo done
no
yes
yes
no
echo "a=b"; cat FILE
yes
yes
yes
yes
echo "=== test ==="; cat FILE
yes
yes
yes
yes
Why I think this happens
Omitting permissionDecision is legal per the hooks docs — updatedInput still applies and the
call proceeds through normal permission evaluation. So rtk's rewrite always routes the command
through the normal permission path. With the sandbox on, auto-allow absorbs that for nearly
everything; an =-bearing token in a multi-segment chain looks like an env-assignment prefix
(PATH=/tmp/evil cat x), which the classifier will not clear, and the prompt appears.
So = is not the bug. It is the one crack through which the permanent fallthrough becomes
visible to sandbox users.
Note on the proposed fix
Two upstream issues are worth checking before assuming permissionDecision: "allow" resolves this:
Prompt observations above were made by me watching the dialogs, since the approve/deny outcome
is not visible to the agent issuing the command. This whole comment was written by claude opus 5 though ;-)
Activity
dedsm commentedon May 12, 2026
I'm having this issue, but wouldn't the proposed fix be similar to having Bash(*) in the allowed commands?
pszymkowiak commentedon May 27, 2026
🔍 Automated Triage
bugmediumSummary
Hook output missing
permissionDecision: allowcauses Mac desktop app to re-prompt on rewritten commands; fix PR #1809 already in progress.📁 Relevant files
src/hooks/claude.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
wufloor commentedon Jun 8, 2026
Also affects GitHub Copilot CLI (
/allow-allmode)The same issue occurs in GitHub Copilot CLI (v1.0.60), which shares the same copilot-agent-runtime as Claude Code.
Copilot CLI specifics
~/.claude/settings.json(shared runtime)/allow-allcommand callssession.permissions.setAllowAll, which covers standard tool/path/URL permissionsPermissionPromptRequestHookkind) are not covered by/allow-all— they are treated as plugin-initiated confirmations that override the allow-all state/allow-allrtk hook copilotexplicitly returns"ask"The
copilotsubcommand explicitly sets"permissionDecision":"ask", while theclaudesubcommand omits it (both result in a prompt).Workaround
Wrapper script that forces
"permissionDecision":"allow"in the hook output:Environment
Dessix commentedon Jul 17, 2026
This seems indicative of a potential flaw in either RTK's hook model or Claude Code's handling of Process Wrappers, wherein custom wrappers can't be registered, and hooks don't appear to allow permission-opaque rewrites.
There may be a possible workaround if RTK and other such wrappers can somehow call out to the permissions API to explicitly request permission for the rewrite, then pass that permission along in the hook response.
It looks like #1809 attempts this through
check_command_with_rulesreading over the existing claude ruleset, but pushing for first-party support for custom process wrappers from Anthropic may be a better solution long-term.Support for this looks to have already been requested upstream on the Claude Code repo, but it was killed off by a staleness bot.
simonryf commentedon Sep 12, 2026
Confirming this on macOS with rtk 0.49.0 and Claude Code 2.1.266, with one detail that I think
explains why reports of this vary so widely: whether you see the prompt depends on the Bash
sandbox, and when the sandbox is on, it only surfaces for commands containing an
=token.With the sandbox disabled
Every rewritten command prompts, exactly as the issue describes.
With the sandbox enabled
sandbox.enabled: trueplusautoAllowBashIfSandboxed(which defaults totrue) silently clearsalmost every rewritten command, so the fallthrough is invisible. It becomes visible only when all
three of these hold at once:
=Minimal pair, run in the same session on the same file:
The banner is not special —
echo "a=b"; cat FILEprompts too. Dropping any one of the threeconditions removes the prompt:
=cat FILEcat FILE; echo x; cat FILE2echo "hello world"; cat FILEecho "=== x ==="echo "a=b"; echo doneecho "a=b"; cat FILEecho "=== test ==="; cat FILEWhy I think this happens
Omitting
permissionDecisionis legal per the hooks docs —updatedInputstill applies and thecall proceeds through normal permission evaluation. So rtk's rewrite always routes the command
through the normal permission path. With the sandbox on, auto-allow absorbs that for nearly
everything; an
=-bearing token in a multi-segment chain looks like an env-assignment prefix(
PATH=/tmp/evil cat x), which the classifier will not clear, and the prompt appears.So
=is not the bug. It is the one crack through which the permanent fallthrough becomesvisible to sandbox users.
Note on the proposed fix
Two upstream issues are worth checking before assuming
permissionDecision: "allow"resolves this:permissionDecision: "allow"does notsuppress the prompt in interactive mode (filed against 2.1.119; current status unclear).
updatedInputfrom anallowhook is silently discarded when a sibling hook returnsaskand the user approves anthropics/claude-code#75915 reports that when one hook returnsallowwithupdatedInputand asibling hook returns
ask, approving the prompt runs the original command and the rewrite issilently dropped. That would affect anyone running rtk's hook alongside another Bash hook.
Prompt observations above were made by me watching the dialogs, since the approve/deny outcome
is not visible to the agent issuing the command. This whole comment was written by claude opus 5 though ;-)