[BUG] PermissionDecision in PreToolUse is ignored in latest VS Code Extension
Resolved 💬 16 comments Opened Mar 19, 2026 by klunejko Closed Jun 11, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
I have an auto-approve hook that allows certain operations in .claude/skills or .claude/agents files. Starting with 2.1.78, the output from the hook is ignored and I'm seeing a permission prompt for every single operation that used to be approved automatically.
What Should Happen?
Editing skill files is automatically approved, so there should be no permission prompt and the edit should go through.
Downgrading to 2.1.77 or any later version restores the previous behaviour.
Steps to Reproduce
- Create a PreToolUse hook
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit|Write|Bash",
"hooks": [
{
"type": "command",
"command": "node auto-approve-test.js"
}
]
}
]}
}
- Create a script that always allows all requests
#!/usr/bin/env node
async function main() {
return console.log(
JSON.stringify({
hookSpecificOutput: {
hookEventName: "PreToolUse",
permissionDecision: "allow",
permissionDecisionReason: `dummy test allow`,
},
}),
);
}
if (require.main === module) {
main();
} else {
module.exports = {
COMMAND_PATTERNS,
FILE_PATTERNS,
SAFE_PIPE_FILTERS,
LEVELS,
SAFETY_LEVEL,
checkPatterns,
};
}
- Ask claude to edit a file.
- Instead of it being approved automatically, a permission prompt is displayed
<img width="445" height="207" alt="Image" src="https://github.com/user-attachments/assets/634efcc9-39e2-4902-b93e-297de0650c1b" />
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.77
Claude Code Version
2.1.79
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
Windows 10
VS Code 1.111.0
Claude Code Extension v2.1.79
16 Comments
Still broken in 2.1.81
This is the same class of bug as #37210 —
permissionDecision: "deny"is ignored for certain tool types.Workaround using chmod defense-in-depth:
For the standard destructive command hooks:
npx cc-safe-setup— 8 hooks that use exit code 2 (which does work reliably for Bash tool blocks).This is probably connected to the PreToolUse hook permissionDecision no longer overrides ask rules issue, but with a VS Code Extension interface
And still not working in 2.1.83
Not working in 2.1.84 either.
And same for 2.1.85
2.1.86
2.1.87
2.1.88
2.1.89
2.1.90
Not working in any of them.
Same issue with 2.1.92
No change in either 2.1.94 or 2.1.96
Ditto for 2.1.98 and 2.1.100
Just tried 2.1.109 and also tried using hooks on PermissionRequest instead of PreToolUse, neither of which made a change. So both PermissionRequest and PreToolUse ignore PermissionDecision and the permissions request is still shown to the user. Annoying.
Also tried the flat format, same issue ({permissionDecision: "allow",permissionDecisionReason:
[${p.id}] ${p.reason}})Well, PermissionRequest works for me, I switched to it when PreToolUse
stopped working and use it now
Ср, 15 апр. 2026 г. в 23:38, klunejko @.***>:
@Khodunov on Windows with the VS Code extensions? and for approving requests? If so, would you mind sharing your hooks setup and what your hook script returns?
Right, the required hook output is also different:
Unfortunately, using PermissionRequest automatically opens the diff viewer each time claude makes an edit, so I'm stuck on <2.1.77 until they change/fix it on approved requests, similar to how it worked with PreToolUse
https://github.com/anthropics/claude-code/issues/25018
Still doesn't work with the latest version..
Closing for now — inactive for too long. Please open a new issue if this is still relevant.