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

Open 💬 12 comments Opened Nov 21, 2025 by myakove

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 ↗

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