[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

  1. Create a PreToolUse hook
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Edit|Write|Bash",
        "hooks": [
          {
            "type": "command",
            "command": "node auto-approve-test.js"
          }
        ]
      }
    ]}
}
  1. 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,
    };
}
  1. Ask claude to edit a file.
  2. 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

View original on GitHub ↗

16 Comments

klunejko · 3 months ago

Still broken in 2.1.81

yurukusa · 3 months ago

This is the same class of bug as #37210 — permissionDecision: "deny" is ignored for certain tool types.

Workaround using chmod defense-in-depth:

#!/bin/bash
# edit-guard.sh — makes file read-only before deny, so even if deny is ignored the write fails
INPUT=$(cat)
TOOL=$(echo "$INPUT" | jq -r '.tool_name // empty')
FILE=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')

if [[ "$TOOL" == "Edit" || "$TOOL" == "Write" ]]; then
    if should_deny "$FILE"; then
        chmod 444 "$FILE" 2>/dev/null
        exit 2
    fi
fi
exit 0

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).

Khodunov · 3 months ago

This is probably connected to the PreToolUse hook permissionDecision no longer overrides ask rules issue, but with a VS Code Extension interface

klunejko · 3 months ago

And still not working in 2.1.83

klunejko · 3 months ago

Not working in 2.1.84 either.

klunejko · 3 months ago

And same for 2.1.85

klunejko · 3 months ago

2.1.86
2.1.87
2.1.88
2.1.89
2.1.90

Not working in any of them.

klunejko · 3 months ago

Same issue with 2.1.92

klunejko · 3 months ago

No change in either 2.1.94 or 2.1.96

klunejko · 3 months ago

Ditto for 2.1.98 and 2.1.100

klunejko · 3 months ago

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}})

Khodunov · 3 months ago

Well, PermissionRequest works for me, I switched to it when PreToolUse
stopped working and use it now

Ср, 15 апр. 2026 г. в 23:38, klunejko @.***>:

klunejko left a comment (anthropics/claude-code#36286) <https://github.com/anthropics/claude-code/issues/36286#issuecomment-4255713359> 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. — Reply to this email directly, view it on GitHub <https://github.com/anthropics/claude-code/issues/36286#issuecomment-4255713359>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AK6YXYRS6SOXTY3JS3KFXHD4V76L7AVCNFSM6AAAAACWYGCZYGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DENJVG4YTGMZVHE> . You are receiving this because you commented.Message ID: @.***>
klunejko · 3 months ago

@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?

klunejko · 3 months ago

Right, the required hook output is also different:

{
  "hookSpecificOutput": {
    "hookEventName": "PermissionRequest",
    "decision": {
      "behavior": "allow"
    }
  }
}

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

klunejko · 2 months ago

Still doesn't work with the latest version..

github-actions[bot] · 1 month ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.