[BUG] Session permission mode 'acceptEdits' not persisting - repeated Edit permission prompts on Linux
STDIN
Bug Description
When selecting "Yes, and accept all for this session" for Edit operations, Claude Code continues to request permission for every subsequent Edit operation instead of honoring the session-level permission mode.
Environment
- Version: Claude Code 2.0.49
- Platform: Linux (Fedora)
- Installation: Native
Steps to Reproduce
- Start Claude Code session
- Perform an Edit operation
- When prompted, select "Yes, and accept all for this session"
- Perform another Edit operation on the same or different file
- Permission prompt appears again (should not happen)
Expected Behavior
After selecting "accept all for this session", all subsequent Edit operations in the same session should execute without permission prompts. The acceptEdits mode should persist for the entire session.
Actual Behavior
Every Edit operation triggers a new permission request, despite the mode being set to acceptEdits after each approval.
Evidence from Debug Logs
The debug logs clearly show the pattern:
2025-11-21T09:14:31.598Z [DEBUG] executePermissionRequestHooks called for tool: Edit
2025-11-21T09:14:33.695Z [DEBUG] Applying permission update: Setting mode to 'acceptEdits'
2025-11-21T09:14:46.526Z [DEBUG] executePermissionRequestHooks called for tool: Edit
2025-11-21T09:14:49.583Z [DEBUG] Applying permission update: Setting mode to 'acceptEdits'
2025-11-21T09:14:56.259Z [DEBUG] executePermissionRequestHooks called for tool: Edit
2025-11-21T09:14:58.697Z [DEBUG] Applying permission update: Setting mode to 'acceptEdits'
The mode is being SET after each approval but NOT CHECKED before the next permission request.
Root Cause Analysis
The executePermissionRequestHooks function is being called for every Edit operation without first checking if the current permission mode (acceptEdits) allows the operation. The session state is being updated but not consulted.
Impact
- Severe productivity impact when making multiple file edits
- User frustration with repetitive permission dialogs
- Defeats the purpose of "accept all for this session" option
Related Issues
- #7104 - Similar Windows-specific bug (fixed in v1.0.105, but potentially regressed in v2.0.x for Linux)
- #11073 - Feature request for cycleable permission scopes (related workflow)
Suggested Fix
Before calling executePermissionRequestHooks for Edit operations, check if the current session permission mode is acceptEdits. If so, skip the permission request and allow the operation.
Configuration Details
Global settings (~/.claude/settings.local.json):
{
"permissions": {
"defaultMode": "acceptEdits"
}
}
The defaultMode: "acceptEdits" setting also appears to be ignored at session startup.
---
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
Showing cached comments. Read the full discussion on GitHub ↗
12 Comments
Same here for macOS as well. It's so annoying und makes the permission system completely useless.
For every batch command, which is allowed in the .claude/settings.local.json, Claude Code asks EVERY time, when it wants to execute it.
How on earth can this not be fixed for three weeks?! This makes Claude UNUSABLE!!
Running into this a lot today too.
@bcherny Is this in development? It seems like the old issue is was automatically closed due to inactivity (https://github.com/anthropics/claude-code/issues/11206)
Same problem on Windows. Makes Claude Code CLI almost usable. I have to babysit every single edit on text files for example
I love how the bot closes the new duplicates then closes the original issue due to no activity
Still experiencing this issue on Arch Linux with Claude Code 2.1.5.
Environment
Reproduction
Same as OP - selecting "Yes, and apply to all edits in this chat" does not persist. Every subsequent Edit operation prompts again.
Workaround
Adding explicit
Edit(**/*)to.claude/settings.local.jsonbypasses the issue:This confirms the bug is in the session mode check, not the permission system itself.
Still experiencing this issue.
Environment
Same behavior as described - selecting "Yes, allow all edits during this session" does not persist. The very next edit to the same file still prompts for permission.
Same on 2.1.7/macos arm64/brew install.
Only way to get around it is bypass permissions mode. Cycling permissions mode back to accept edits doesn't fix it either.
Worth noting that I always run claude with this flag, and my default mode is acceptEdits, but I have seen it _sometimes_ follow the accept edits permissions setting.
this has been happening for weeks now on my machines - both windows and linux. i've been so hoping it would have been fixed by now. relying on --dangerously-skip-permissions is not a good solution as its a bit aggressive.
happening using native CLI on both linux (arch linux) and windows 11. please fix! there is nothing better than having it ask me to accept edits 20 times for the same file in under 2 minutes.
Confirming this also occurs on Windows (not just Linux/WSL). Filed #21835 as duplicate before finding this issue.
Environment: Windows 11, Claude Code 1.0.29 (Opus 4)
Same behavior: selecting "Yes, and don't ask again for this session" for Edit/Bash operations does not persist - permission prompts reappear on subsequent tool calls within the same session.
+1 for a fix. This creates significant friction in longer sessions.
+1 — also reproduces in the VS Code extension, not just the CLI. Same root symptom (mode silently reverts to "Ask before edits"), but the trigger here is
Developer: Reload Window/ VS Code restart rather than mid-session.All four settings layers (
.vscode/settings.jsoninitialPermissionMode+allowDangerouslySkipPermissions, project.claude/settings.json, global~/.claude/settings.json) declarebypassPermissionsand are all ignored on reload. Reproducible for ~1 week on this setup.If the root cause analysis in the OP holds (session mode being set but not consulted), it'd be worth checking whether the VS Code extension's startup path has the same "set, never check" flaw when reading
initialPermissionMode.