claude-code - 💡(How to fix) Fix bypassPermissions: session startup reads flat pref, GUI toggle writes per-account pref — they never sync

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Claude Desktop has two parallel bypass-permissions gates that are never synchronized. The result: the session startup path silently downgrades bypassPermissions to acceptEdits even when the GUI toggle is enabled.

Root Cause

Claude Desktop has two parallel bypass-permissions gates that are never synchronized. The result: the session startup path silently downgrades bypassPermissions to acceptEdits even when the GUI toggle is enabled.

Fix Action

Fix / Workaround

Fix (workaround until app-side fix)

Code Example

const f = Bi("bypassPermissionsModeEnabled") === true;  // reads FLAT pref only
const h = d === sn.Bypass && !f;                        // true if bypass requested but flat pref is false
const y = h ? sn.AcceptEdits : d;                      // silently downgrades to AcceptEdits

---

{
  "preferences": {
    "bypassPermissionsModeEnabled": true
  }
}
RAW_BUFFERClick to expand / collapse

Summary

Claude Desktop has two parallel bypass-permissions gates that are never synchronized. The result: the session startup path silently downgrades bypassPermissions to acceptEdits even when the GUI toggle is enabled.

Gates

GatePref keyWhat sets it
GUI togglepreferences.bypassPermissionsGateByAccount[accountId]Clicking the bypass toggle in the Desktop UI
Session startup checkpreferences.bypassPermissionsModeEnabled (flat boolean)Not exposed in the UI — defaults to false if missing

Startup path logic (from .vite/build/index.js)

const f = Bi("bypassPermissionsModeEnabled") === true;  // reads FLAT pref only
const h = d === sn.Bypass && !f;                        // true if bypass requested but flat pref is false
const y = h ? sn.AcceptEdits : d;                      // silently downgrades to AcceptEdits

Bi("bypassPermissionsGateByAccount") is never consulted in this code path. The GUI toggle and the startup-path check are entirely independent.

Symptom

  1. User enables bypass permissions via the Desktop GUI toggle.
  2. New session opens — status bar shows Bypass permissions.
  3. First tool use fires an orange toast: "Bypass Permissions mode isn't enabled."
  4. Mode silently reverts to Accept Edits.

Fix (workaround until app-side fix)

Set the flat pref directly in ~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "preferences": {
    "bypassPermissionsModeEnabled": true
  }
}

This must be done while the app is not running (it holds prefs in memory and writes them back on quit, potentially overwriting manual edits).

How this was found

Extracted app.asar with @electron/asar, grepped the bundled JS for the pref name, read the surrounding startup code. Pref names are unobfuscated string literals — greppable directly.

Suggested fix

In the session startup path, check EITHER bypassPermissionsModeEnabled OR bypassPermissionsGateByAccount[accountId] — or better, have the GUI toggle write BOTH prefs atomically so they stay in sync.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING