[BUG] [VSCode Extension] "Yes, and don't ask again" erases all existing permissions

Resolved 💬 5 comments Opened Oct 21, 2025 by ImirSun Closed Jan 15, 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?

When clicking "Yes, and don't ask again" for a command permission prompt in the VSCode extension, the entire .claude/settings.local.json file is completely overwritten, losing all previously configured permissions.

For example, if I had 80+ permissions in the "allow" array, 10+ in "deny", and 1+ in "ask", after clicking "Yes, and don't ask again" for a single new command, the file becomes:

{
"permissions": {
"allow": [
"Bash(ver:*)"
],
"deny": [],
"ask": []
}
}

All previous permissions are permanently deleted. This is a critical data loss bug.

Environment:

  • Extension: Claude Code for VS Code v2.0.24
  • VSCode: 1.105.1 (user setup)
  • Electron: 37.6.0
  • Node.js: 22.19.0
  • OS: Windows_NT x64 10.0.26200

What Should Happen?

When clicking "Yes, and don't ask again", the extension should:

  1. Read the existing .claude/settings.local.json file
  2. Parse the JSON structure
  3. Add the new permission to the existing "allow" array
  4. Save the file with ALL previous permissions preserved

Expected result:
{
"permissions": {
"allow": [
"Read(*)",
"Glob(*)",
"Edit(*)",
// ... all 80+ previous permissions
"Bash(ver:*)" // ← newly added
],
"deny": [
// ... all previous deny rules preserved
],
"ask": [
// ... all previous ask rules preserved
]
}
}

The new permission should be ADDED, not REPLACE all existing permissions.

Error Messages/Logs

Steps to Reproduce

  1. Create .claude/settings.local.json with multiple permissions:

{
"permissions": {
"allow": [
"Read(*)",
"Glob(*)",
"Edit(*)",
"Write(*)",
"Bash(git status:)",
"Bash(npm:)"
],
"deny": [
"Bash(rm -rf:)"
],
"ask": [
"Bash(git push:)"
]
}
}

  1. In VSCode with Claude Code extension active, start a conversation
  1. Execute a bash command that's not in the permissions list, for example:
  • Ask Claude to run: "Execute the 'ver' command"
  • Or: "Run 'whoami' command"
  1. When the permission dialog appears with options:
  • Yes
  • Yes, and don't ask again
  • No

Click "Yes, and don't ask again"

  1. Check .claude/settings.local.json

Actual result: File now contains ONLY the new permission, all previous permissions are gone.

Note: This can be verified by keeping the settings file in git and checking git diff after the action.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

VSCode Extension v2.0.24

Platform

Other

Operating System

Windows

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗