Repository navigation
Closed
Labels
area:clibugSomething isn't workinghelp wantedExtra attention is neededpriority:highresolved-pending-closeAnswered/resolved — will close if no response
Description
🤖 This was written by an AI agent on behalf of @paolomainardi.
Summary
Since Copilot CLI v1.0.24 (April 10, 2026), preToolUse hooks support modifiedArgs for transparent command rewriting — the same capability Claude Code has had via updatedInput. The official docs now list modifiedArgs as a supported output field.
However, rtk hook copilot (tested on RTK 0.39.0) is a complete no-op: it returns empty stdout + exit 0 for every command, regardless of whether a rewrite exists.
Reproduction
# Claude hook — works (transparent rewrite)
echo '{"tool_name":"bash","tool_input":{"command":"git status"}}' | rtk hook claude
# → {"hookSpecificOutput":{"hookEventName":"PreToolUse",...,"updatedInput":{"command":"rtk git status"}}}
# Copilot hook — no-op (empty output, exit 0)
echo '{"toolName":"terminal","toolInput":{"command":"git status"}}' | rtk hook copilot
# → (nothing)
# But the rewrite engine knows what to do:
rtk hook check --agent copilot git status
# → rtk git statusExpected behavior
rtk hook copilot should output modifiedArgs in the Copilot CLI format:
{"modifiedArgs":{"command":"rtk git status"}}This would make the Copilot hook functionally equivalent to the Claude Code hook, enabling transparent rewrite instead of the current no-op behavior.
Context
- The older deny-with-suggestion approach (from Add support for github copilot cli #593) was designed before Copilot CLI supported
modifiedArgs. Now that it does, the hook should use it. exclude_commandsshould also be respected in the copilot hook path, same as for Claude Code.- Related:
rtk init -g --copilotdoes nothing, no global setup, no feedback #1774 (rtk init -g --copilotglobal setup),[Bug] rtk hook copilotdoes not trigger for VS Code Copilot Chat —"run_in_terminal"not recognized indetect_format()#1425 (run_in_terminalnot recognized) - The current no-op means Copilot RTK integration relies entirely on instructions ("always prefix with
rtk"), which teaches the AI to bypass safety patterns in tools like OpenCode that match on command prefixes.
Environment
- RTK: 0.39.0
- Copilot CLI: tested against v1.0.44 docs (installed version 0.0.405)
- OS: Linux (Arch)
Metadata
Metadata
Assignees
Labels
area:clibugSomething isn't workinghelp wantedExtra attention is neededpriority:highresolved-pending-closeAnswered/resolved — will close if no response
Activity
[-]rtk hook copilot is a no-op — does not output modifiedArgs despite Copilot CLI v1.0.24+ support[/-][+]github copilot (v1.0.24) now support modifiedArgs[/+]fix(hooks): Copilot CLI modifiedArgs 対応と VsCode/CopilotCli の分割
fix(hooks): split HookFormat into VsCode/CopilotCli, add modifiedArgs…
pszymkowiak commentedon May 27, 2026
🔍 Automated Triage
bughighSummary
rtk hook copilot is a no-op (empty stdout, exit 0) instead of emitting modifiedArgs as supported by Copilot CLI v1.0.24+; fix should output the rewrite in Copilot's format and respect exclude_commands.
📁 Relevant files
src/hooks/copilot.rssrc/hooks/mod.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
fix(hooks): split HookFormat into VsCode/CopilotCli, add modifiedArgs…
aeppling commentedon Jun 8, 2026
Hey, should be solved on 0.42.3 since the Copilot CLI update
fix(hooks): split HookFormat into VsCode/CopilotCli, add modifiedArgs…
daleksandrov-qontigo commentedon Jun 12, 2026
It seems like is doesn't work for 0.42.3
KuSh commentedon Sep 5, 2026
This looks resolved on the current code (commit 4b0bbf2, v0.42.x), but it could not be fully reproduced here. Marking it resolved-pending-close: it will be closed in a while unless someone reports it still happening on the latest version.
KuSh commentedon Sep 13, 2026
This has carried the resolved-pending-close label with no new report of it happening, so closing it. The Copilot hook now emits modifiedArgs for transparent rewriting; it landed in 4b0bbf2 and shipped in v0.42.3. The reason the reproduction in this thread stayed empty is the test payload: Copilot CLI sends
toolNameplustoolArgsas a JSON-encoded string, soecho '{"toolName":"bash","toolArgs":"{\"command\":\"git status\"}"}' | rtk hook copilotreturns {"modifiedArgs":{"command":"rtk git status"}} on the current version. Please comment or reopen if rewriting still does not happen for you with a real Copilot CLI session on the latest release.