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:

  1. The Agent tool is invoked with mode: "acceptEdits"
  2. The parent session's settings.local.json has explicit allow rules:

``json
"Edit(/path/to/project/**)",
"Write(/path/to/project/**)"
``

  1. 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

  1. Ensure settings.local.json allow list does NOT have a bare Edit / Write (only path-scoped versions)
  2. Spawn an Agent with subagent_type: php-developer and mode: "acceptEdits", ask it to create files inside the allowed path
  3. 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/**) and Write(/abs/path/**) to project settings.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)

View original on GitHub ↗

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