Subagent Write/Edit denied even with mode: "acceptEdits" / scoped permissions
Resolved 💬 3 comments Opened May 6, 2026 by DS-Matt Closed May 10, 2026
Summary
Spawned subagents (subagent_type: php-developer) repeatedly hit "Permission to use Write/Edit has been denied" even when:
- The Agent tool is invoked with
mode: "acceptEdits" - The parent session's
settings.local.jsonhas explicit allow rules:
``json``
"Edit(/path/to/project/**)",
"Write(/path/to/project/**)"
- The parent session has working Write/Edit on the same paths
I hit this three times in a row across two different agent invocations. The agents reported the denial as silent at session start — only surfacing when an actual Write/Edit was attempted.
Reproduction
- Ensure
settings.local.jsonallow list does NOT have a bareEdit/Write(only path-scoped versions) - Spawn an Agent with
subagent_type: php-developerandmode: "acceptEdits", ask it to create files inside the allowed path - Subagent's Write call fails with "Permission to use Write has been denied"
Parent agent in the same session can write to those paths fine.
Expected
mode: "acceptEdits" on the Agent tool should auto-accept Write/Edit in the spawned subagent, OR path-scoped allow rules in settings.local.json should be inherited by spawned subagents.
Workarounds tried (none worked)
- Adding
Edit(/abs/path/**)andWrite(/abs/path/**)to projectsettings.local.json - Passing
mode: "acceptEdits"on the Agent tool call
Workarounds that would help
- Documented
mode: "bypassPermissions"behavior, with security caveats - Make subagents inherit parent session's permission grants
- Make path-scoped allow rules apply to subagents
Environment
- Claude Code CLI on macOS (Darwin 25.3.0)
- Worktree-based workflow (parent session in
.claude/worktrees/foo) subagent_type: php-developer(custom agent definition)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗