claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] VSCode Extension: `.claude/settings.local.json` permissions not respected for Bash/Write/Edit operations (even with `bypassPermissions` mode)

Open elliottgaryusa opened this issue 11 months ago • 4 comments

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?

GitHub Issue Draft for Claude Code Team

Related Work Item: BUGFIX-003 Target Repository: https://github.com/anthropics/claude-code/issues Created: 2025-12-31 Status: Draft - Ready to submit


Issue Title

[Bug] VSCode Extension: .claude/settings.local.json permissions not respected for Bash/Write/Edit operations (even with bypassPermissions mode)


Issue Type

Bug Report


Environment

Claude Code Version: Latest (VSCode Extension) VSCode Version: Latest OS: Windows 11 Extension Environment: VSCode Claude Code Extension


Summary

The .claude/settings.local.json permission configuration system appears to only work for Read-type tools (Read, Glob, Grep) but does NOT respect allow/deny rules for Bash commands, Write operations, or Edit operations in the VSCode extension environment.

Critical Finding: Even with bypassPermissions mode enabled (which should bypass ALL permission checks), users still receive approval prompts for Bash, Write, and Edit operations.


Expected Behavior

When .claude/settings.local.json contains:

{
  "permissions": {
    "defaultMode": "dontAsk",
    "allow": [
      "Read(**)",
      "Glob",
      "Grep",
      "Task",
      "Bash(dir:*)"
    ],
    "deny": [
      "Read(.env)",
      "Read(.env.*)",
      "Read(secrets/**)",
      "Read(credentials.json)",
      "Read(.aws/**)",
      "Read(.git/config)",
      "Read(../**)"
    ]
  }
}

AND VSCode setting claudeCode.initialPermissionMode is set to "acceptEdits" or "bypassPermissions",

Expected: All allowed operations should execute without approval prompts, including:

  • Bash commands matching Bash(dir:*)
  • Write operations (creating files)
  • Edit operations (modifying files)

Actual Behavior

What Works (No Prompts):

  • ✅ Read(**) tool
  • ✅ Glob tool
  • ✅ Grep tool

What Still Prompts (Despite Configuration):

  • ❌ Bash commands - ALL types (simple commands, pipelines, git operations)
  • ❌ Write tool - Creating new files
  • ❌ Edit tool - Modifying existing files

Critical Issue: Even with VSCode initialPermissionMode set to "bypassPermissions" (which should bypass ALL permission checks), the following still prompted:

  • Bash command: cat thoughts/project/work/doing/.limit
  • Write operation: Creating new file
  • Edit operation: Modifying existing file

Reproduction Steps

Configuration Setup

  1. Create .claude/settings.local.json in project root:
{
  "permissions": {
    "defaultMode": "dontAsk",
    "allow": [
      "Read(**)",
      "Glob",
      "Grep",
      "Task",
      "Bash(dir:*)"
    ],
    "deny": [
      "Read(.env)",
      "Read(.env.*)",
      "Read(secrets/**)",
      "Read(credentials.json)",
      "Read(.aws/**)",
      "Read(.git/config)",
      "Read(../**)"
    ]
  }
}
  1. Open VSCode Settings (Ctrl+,)
  2. Search for "claude"
  3. Set Claude Code: Initial Permission Mode to "acceptEdits"
  4. Restart Claude Code session

Test Case 1: Read Operations (These Work)

  1. Use Read tool to read any project file
    • Result: No prompt ✅
  2. Use Glob tool to search files
    • Result: No prompt ✅
  3. Use Grep tool to search content
    • Result: No prompt ✅

Test Case 2: Bash Commands (These Fail)

  1. Execute: cat thoughts/project/work/doing/.limit
    • Result: Approval prompt appears ❌
  2. Execute: ls -la
    • Result: Approval prompt appears ❌
  3. Execute: git status
    • Result: Approval prompt appears ❌

Test Case 3: Write/Edit Operations (These Fail)

  1. Use Write tool to create new file
    • Result: Approval prompt appears ❌
  2. Use Edit tool to modify existing file
    • Result: Approval prompt appears ❌

Test Case 4: bypassPermissions Mode (Critical Finding)

  1. Change VSCode setting to "bypassPermissions"
  2. Repeat Bash/Write/Edit tests
    • Result: ALL still prompt ❌

This suggests the permission system is not properly integrated for these operation types.


Root Cause Analysis

Based on extensive testing, the VSCode extension appears to have two separate permission pathways:

Pathway 1 (Works): Read-type tools (Read, Glob, Grep, Task)

  • These properly respect .claude/settings.local.json allow/deny rules
  • Correctly work with defaultMode: "dontAsk"

Pathway 2 (Broken): Bash/Write/Edit operations

  • These do NOT respect .claude/settings.local.json allow/deny rules
  • Do NOT respect VSCode initialPermissionMode setting
  • Even bypassPermissions mode (which should skip ALL checks) still prompts

Hypothesis: Bash/Write/Edit operations may use a different permission check mechanism that is not connected to the configuration system.


Impact

Severity: Medium-High

User Impact:

  • Users cannot configure non-destructive read-only operations (like checking WIP limits) without approval prompts
  • Workflow friction persists despite correct configuration
  • bypassPermissions mode not working as expected is particularly concerning

Workaround:

  • None available for Bash/Write/Edit operations
  • Users must manually approve each operation

Additional Context

Testing Environment Details

  • Tested with fresh VSCode restart after each configuration change
  • Verified only one .claude/settings.local.json file exists (no conflicts)
  • Tested all four initialPermissionMode values: default, acceptEdits, plan, bypassPermissions
  • Bash patterns tested: Bash(cat:*), Bash(ls:*), Bash(pwd), Bash(git status), Bash(dir:*)

Configuration Files Verified

.claude/settings.local.json:

{
  "permissions": {
    "defaultMode": "dontAsk",
    "allow": [
      "Read(**)",
      "Glob",
      "Grep",
      "Task",
      "Bash(dir:*)"
    ],
    "deny": [
      "Read(.env)",
      "Read(.env.*)",
      "Read(secrets/**)",
      "Read(credentials.json)",
      "Read(.aws/**)",
      "Read(.git/config)",
      "Read(../**)"
    ]
  }
}

VSCode settings.json:

{
    "claudeCode.initialPermissionMode": "acceptEdits"
}

Expected vs Actual Permission Matrix

Tool/Operation .claude/settings.local.json acceptEdits Mode bypassPermissions Mode Expected Actual
Read(**) ✅ Configured N/A N/A No prompt ✅ No prompt
Glob ✅ Configured N/A N/A No prompt ✅ No prompt
Grep ✅ Configured N/A N/A No prompt ✅ No prompt
Bash(dir:*) ✅ Configured ✅ Enabled ✅ Bypass ALL No prompt ❌ Still prompts
Write N/A ✅ Enabled ✅ Bypass ALL No prompt ❌ Still prompts
Edit N/A ✅ Enabled ✅ Bypass ALL No prompt ❌ Still prompts

Suggested Fix

  1. Verify Bash/Write/Edit operations use the same permission check pathway as Read/Glob/Grep tools
  2. Ensure bypassPermissions mode actually bypasses all permission checks (currently not working)
  3. Document permission system architecture so users understand which settings control which operations

Related Issues

(Search for similar issues - #15772 ]


Questions for Claude Code Team

  1. Is .claude/settings.local.json supposed to work for Bash/Write/Edit operations in VSCode extension?
  2. Should bypassPermissions mode eliminate ALL prompts? (Currently it doesn't for Bash/Write/Edit)
  3. Is there separate configuration needed for Bash/Write/Edit permissions in VSCode?
  4. Is this behavior expected, or is it a bug?

Reported By: SpearIT Project Framework Team Date: 2025-12-31 Contact: (Add your GitHub username when submitting)

What Should Happen?

Expected: All allowed operations should execute without approval prompts, including:

  • Bash commands matching Bash(dir:*)
  • Bash commands like (cat, ls, grep)

Error Messages/Logs


Steps to Reproduce

See description above.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

Model: Claude Sonnet 4.5 (model ID: claude-sonnet-4-5-20250929) - VSCode ext 2.0.75

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

No response

elliottgaryusa avatar Dec 31 '25 18:12 elliottgaryusa

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/13028
  2. https://github.com/anthropics/claude-code/issues/12261
  3. https://github.com/anthropics/claude-code/issues/13340

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

github-actions[bot] avatar Dec 31 '25 18:12 github-actions[bot]

No, don't close this is a terrible issue and none of the duplicates have been assigned.

keithdv avatar Jan 02 '26 15:01 keithdv

Related to #15772

stewartadam avatar Jan 12 '26 09:01 stewartadam

+1 - Experiencing the same issue. Edit/Write permissions in .claude/settings.local.json are not respected, still prompts for every edit operation. Read permissions work fine.

MarcinDudekDev avatar Jan 14 '26 23:01 MarcinDudekDev

+1 #15772 was closed remarkably quickly so weighing in to say this issue is real. Claude CLI works as expected

kcd83 avatar Jan 25 '26 23:01 kcd83

Just ran into this issue, and took me a really long time to get here (Claude flailed for a LONG time adding patterns, suggesting different settings files to edit)

ZebGirouard avatar Jan 29 '26 20:01 ZebGirouard

Same here. Having this issue and Claude ran circles around itself trying to fix until it found this.

nikhilsitaram avatar Feb 02 '26 21:02 nikhilsitaram

This is not just a VSCode extension issue. I have the same issue on the command line with Claude Code on windows.

losjoe avatar Feb 09 '26 21:02 losjoe

Can this be fixed please, it's hard to create a fully autonomus SDLC pipeline if the permissions are not respected

RoboLagoon avatar Feb 14 '26 21:02 RoboLagoon

OH MY GOD ITS STILL NOT FIXED FOR MONTHS, ITS SUCH AN EASY FIX WHY ARE THEY IGNORING THIS?

CrewXI avatar Feb 15 '26 19:02 CrewXI

Same here.. almost makes the extension unusable

rowanseymour avatar Feb 16 '26 19:02 rowanseymour

Hey guys FYI I was able to work around this by using a pretooluse hook. I created a script with safe commands and pass that to the agent whenever it uses a tool (which includes Bash).

nikhilsitaram avatar Feb 16 '26 20:02 nikhilsitaram

I did the same 1h after posting my first message here because I was so frustrated with it. I created hooks with python rules. Added allowed instructions, hundreds of them, created also another one with banned harmful disallowed commands like command chaining and heredocs and any commands leading to configuration or removal outside of specified and allowed folders and I also banned any acces to certain folders on my hdd. Claude configured them for itself. Now I have fully autonomous pipeline with no questions asked! Worked like a charm. Claude can follow SDLC pipeline and implement any feature end to end automatically. Different specialised agents are invoked one by one or in parallel to do the job done. Crazy if you ask me, it's like coding in star trek holodeck now. Lol.

On Mon, 16 Feb 2026, 20:47 nikhilsitaram, @.***> wrote:

nikhilsitaram left a comment (anthropics/claude-code#15921) https://github.com/anthropics/claude-code/issues/15921#issuecomment-3910450791

Hey guys FYI I was able to work around this by using a pretooluse hook. I created a script with safe commands and pass that to the agent whenever it uses a tool (which includes Bash).

— Reply to this email directly, view it on GitHub https://github.com/anthropics/claude-code/issues/15921#issuecomment-3910450791, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQMYAQNY5DOQMWB4CBHFDDT4MIUHLAVCNFSM6AAAAACQNDWWVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTSMJQGQ2TANZZGE . You are receiving this because you commented.Message ID: @.***>

RoboLagoon avatar Feb 16 '26 22:02 RoboLagoon

Hooks really are the secret sauce to get Claude to do anything reliably!

nikhilsitaram avatar Feb 16 '26 22:02 nikhilsitaram

Same here, Claude is set to "ask before edit" mode, yet reliably does the modifications directly. When asked, it tells me it'll ask next time and then proceeds to completely ignore that with the next prompt.

Kraechtshammer avatar Mar 05 '26 14:03 Kraechtshammer

Same issue:

  • MacOS Tahoe 26.3
  • Microsoft VS Code 1.116.0
  • Claude Code extension for VS Code: Opus [email protected].
    • "Edit Automatically" also still prompting for permission.

rpringadi avatar Apr 15 '26 19:04 rpringadi

Same here on Linux CLI (Claude Code 2.x, Opus 4.6) — bypassPermissions mode in ~/.claude/settings.json does not suppress Edit/Write prompts.

Workaround that actually works: a PermissionRequest hook that unconditionally approves. Added to settings.json:

"PermissionRequest": [{
  "matcher": "",
  "hooks": [{"type": "command", "command": "/path/to/allow_all.sh"}]
}]

allow_all.sh:

#!/bin/bash
echo '{"hookSpecificOutput": {"hookEventName": "PermissionRequest", "decision": {"behavior": "allow"}}}'

Confirms this isn't VSCode-specific — the permission-mode plumbing is broken across platforms. The fact that users need a hook to make bypassPermissions behave as documented suggests the mode flag isn't reaching the Edit/Write/Bash gate.

Kieldro avatar Apr 15 '26 19:04 Kieldro

Works @Kieldro https://github.com/anthropics/claude-code/issues/15921#issuecomment-4255032042 but kind of risky.

The PermissionRequest hook in VS Code is fundamentally broken — deny doesn't deny, ask doesn't prompt, it just auto-allows everything regardless. That's another data point for the bug report: the workaround from that GitHub comment doesn't work safely for selective approval.

rpringadi avatar Apr 15 '26 20:04 rpringadi

Still having this issue and this was opened in December.

VS Code Studio extension running on Arch Linux. Latest versions.

jimdawdy-hub avatar Apr 26 '26 20:04 jimdawdy-hub

The VS Code interface is basically unusable with it asking to grep all the time. The docs clearly state that read-only commands should not prompt, but they do. Is that covered by this issue? Why don't Anthropic just have Claude Code fix this (recommend using CLI so it can actually work without stopping all the time).

ryanolf avatar May 02 '26 12:05 ryanolf