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

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

Open myakove opened this issue 1 month ago • 2 comments

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 [email protected]

myakove avatar Nov 21 '25 09:11 myakove

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.

kinglycodes avatar Nov 24 '25 13:11 kinglycodes

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

aspiers avatar Dec 12 '25 20:12 aspiers

Running into this a lot today too.

tonydehnke avatar Dec 16 '25 09:12 tonydehnke

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

nadavsec avatar Dec 17 '25 12:12 nadavsec

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

SamuelMiller avatar Dec 17 '25 16:12 SamuelMiller