[BUG] Session permission mode 'acceptEdits' not persisting - repeated Edit permission prompts on Linux

Status Open
Maintainer reply None cached
Activity 13 comments · opened Nov 21, 2025

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

  1. Start Claude Code session
  2. Perform an Edit operation
  3. When prompted, select "Yes, and accept all for this session"
  4. Perform another Edit operation on the same or different file
  5. 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>

View original on GitHub ↗

12 Comments

kinglycodes · 9 months ago

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.

aspiers · 8 months ago

How on earth can this not be fixed for three weeks?! This makes Claude UNUSABLE!!

tonydehnke · 8 months ago

Running into this a lot today too.

nadavsec · 8 months ago

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

SamuelMiller · 8 months ago

Same problem on Windows. Makes Claude Code CLI almost usable. I have to babysit every single edit on text files for example

keithdv · 8 months ago

I love how the bot closes the new duplicates then closes the original issue due to no activity

gebeer · 7 months ago

Still experiencing this issue on Arch Linux with Claude Code 2.1.5.

Environment

  • Platform: Arch Linux (kernel 6.18.3-zen1-1-zen)
  • Claude Code version: 2.1.5
  • Installation: Native CLI

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.json bypasses the issue:

{
  "permissions": {
    "allow": [
      "Edit(**/*)"
    ]
  }
}

This confirms the bug is in the session mode check, not the permission system itself.

skinnyandbald · 7 months ago

Still experiencing this issue.

Environment

  • Platform: macOS (Darwin 25.1.0)
  • Claude Code version: 2.1.6
  • Installation: Native CLI

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.

nsheaps · 7 months ago

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.

bigshiny90 · 7 months ago

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.

RobSB2 · 7 months ago

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.

xhiroga · 4 months ago

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

  • VS Code: 1.115.0 (41dd792b5e652393e7787322889ed5fdc58bd75b, x64)
  • Claude Code extension: 2.1.101
  • Claude CLI: 2.1.104
  • OS: Debian 13 inside a Dev Container on WSL2 (Windows host)

All four settings layers (.vscode/settings.json initialPermissionMode + allowDangerouslySkipPermissions, project .claude/settings.json, global ~/.claude/settings.json) declare bypassPermissions and 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.

Showing cached comments. Read the full discussion on GitHub ↗