bypassPermissions resets to acceptEdits when editing files under nested .claude/ directories
Description
When working in a monorepo with multiple nested .claude/ directories (git subtree packages), editing any file under a package's .claude/ directory causes the permission mode to reset from bypassPermissions to acceptEdits.
Steps to Reproduce
- Create a monorepo with multiple packages, each containing their own
.claude/settings.json:
````
.claude/settings.json # root — defaultMode: "bypassPermissions"
packages/pkg-a/.claude/settings.json # subtree — defaultMode: "bypassPermissions"
packages/pkg-b/.claude/settings.json # subtree — defaultMode: "bypassPermissions"
packages/pkg-c/.claude/settings.local.json # local override
- Launch Claude Code from the monorepo root in
bypassPermissionsmode - Edit any file under a nested
.claude/directory (e.g.,packages/pkg-a/.claude/hooks/some-hook.jsorpackages/pkg-b/.claude/settings.json) - Observe that permission mode switches to
acceptEdits
Expected Behavior
Permission mode should remain bypassPermissions since all settings.json files have "defaultMode": "bypassPermissions" set.
Actual Behavior
Permission mode resets to acceptEdits after the edit. This happens consistently on every edit to any file under a nested .claude/ directory.
Analysis
- The issue does NOT occur in standalone repos with a single
.claude/directory - All 7
settings.jsonfiles in the project have"defaultMode": "bypassPermissions"— the reset happens regardless - Adding
"defaultMode": "bypassPermissions"to asettings.local.jsondoes not prevent it - The file watcher appears to detect changes under any
.claude/path in the project tree and triggers a settings reload, which resets the permission mode to the default (acceptEdits)
Environment
- Claude Code version: 2.1.80
- OS: macOS (Darwin 25.3.0)
- Model: claude-opus-4-6
- Repo structure: monorepo with git subtree packages, each bringing their own
.claude/directory
Workaround
None — the user must manually re-enable bypass mode after each edit to a .claude/ file. This is especially disruptive in monorepos where framework packages contain hooks, skills, and agent definitions under .claude/ that are frequently edited.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗