Subagents don't inherit bypassPermissions mode from parent session
Status Closed — not planned
Reported on v2.1.81
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 11 comments · opened Mar 22, 2026 · closed May 28, 2026
Description
When the parent session is configured with "defaultMode": "bypassPermissions" in ~/.claude/settings.json, subagents spawned via the Agent tool still prompt for tool permissions. This defeats the purpose of bypass mode and creates a disruptive experience — every subagent invocation can trigger permission prompts that the user has already opted out of.
Steps to Reproduce
- Set
"defaultMode": "bypassPermissions"in~/.claude/settings.json - Also set
"skipDangerousModePermissionPrompt": true - Start a Claude Code session — main agent correctly bypasses all permission prompts
- Invoke a task that uses the
Agenttool (subagent) - The subagent prompts for permissions on tools the parent session would silently allow
Expected Behavior
Subagents should inherit the parent session's permission mode, including bypassPermissions and all allow patterns.
Actual Behavior
Subagents prompt for permissions as if running in a more restrictive mode.
Environment
- Claude Code version: 2.1.81
- OS: Windows 11 Pro (10.0.26200)
- Shell: bash (Git Bash)
Notes
Persistent issue across multiple sessions over several days. Adding broad allow patterns (e.g., Bash(*)) as a workaround doesn't fully resolve it since bypassPermissions should already cover everything.
11 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The Agent tool has a
modeparameter that can explicitly set the permission mode for spawned subagents. Until the inheritance bug is fixed, you can work around this by instructing Claude to usemode: "bypassPermissions"when spawning agents.In your CLAUDE.md, add:
This tells Claude to pass the mode explicitly on every Agent invocation, bypassing the broken inheritance.
If you want a more enforceable approach, a PreToolUse hook on
Agentcan inject the mode:This won't block the call, but will warn when agents are spawned without an explicit mode, helping you catch the inconsistency.
Still repros on claude-opus-4-6 (1M context) via VSCode extension on darwin 25.4.0. Confirming from a real multi-repo scenario where this blocked a 7-blocker pre-launch sprint:
Setup
/repo-front/repo-api(listed inadditionalDirectories)/repo-apiat/repo-api-be1and/repo-api-be2(also inadditionalDirectories).claude/settings.local.json(project scope):```
json
{
"permissions": {
"defaultMode": "bypassPermissions",
"allow": [
"Bash(git:)", "Bash(gh:)", "Bash(pytest:*)",
"Bash(python:)", "Bash(npm:)", "Bash(ruff:)", "Bash(mypy:)"
],
"additionalDirectories": [
"/repo-api", "/repo-api-be1", "/repo-api-be2", "/repo-front"
]
}
}
Confirming this still reproduces as of Claude Code 2.x on WSL2 Ubuntu.
Setup:
~/.claude/settings.jsonhas"defaultMode": "bypassPermissions"at user levelsettings.jsonhas"Bash(*)"inpermissions.allowandTaskallowed--auto, which dispatches up to 7 Task/Agent subagents per spec: 2 review-doc phases + 1 implement + up to 4 review-code iters)Symptom: parent session correctly bypasses all prompts. Every subagent spawned via the Agent/Task tool re-prompts for tool permissions — including on commands the parent already pre-approved via
Bash(*). Accumulating exact-match entries likeBash(PGPASSWORD=... psql -h ...)insettings.local.jsonper-command is a whack-a-mole workaround that doesn't scale to long pipelines.Workaround tried: broadening the allowlist in
settings.jsonso subagents inherit it at load time. Insufficient for heredoc and complex-quoted commands, which appear not to matchBash(*)cleanly in the restrictive default mode that subagents start in — possibly a separate matcher issue layered on top of the inheritance gap here.Upstream effect: users with long, Task-heavy workflows get 20–40 permission prompts per spec run, making automation skills like
orchestrate --autopractically unusable despite bypass mode being intentionally enabled at the user level.Multi-agent coordination broken by permission re-prompting in subagents
Setup: Opus window acts as PM/coordinator and spawns 6-8 Sonnet subagents in parallel via the Task tool. Subagents perform basic filesystem work: reading and writing markdown files in .claude/plans/, docs/, and similar directories.
The problem: Every Sonnet subagent re-prompts for read/write permissions on each file, even though the parent Opus window already has bypassPermissions or acceptEdits configured. The permission grant does not propagate to Task-spawned subagents.
Reproduction steps:
Downstream impact: Overnight autonomous runs are completely broken. With 6-8 workers all blocking simultaneously on permission prompts, nothing executes, but API quota burns the entire time. By morning there is zero output and a full quota burn. This started around v2.1.116 and is still present in v2.1.117.
The parent window's permission state should be inherited by Task-spawned subagents, or at minimum there should be a flag to propagate it explicitly. Right now the multi-agent coordination pattern is non-functional for any unattended run.
Clarifying the repro: the user clicks "Allow Always" in the permission dialog, but it does not stick across subagent boundaries -- the next spawned subagent hits the same prompt again for the same tool/path combination. Either "Allow Always" is not writing to settings.local.json at all (UI is lying), or it is writing but subagents are not reading the parent's settings.local.json. Either way, "Allow Always" is effectively broken in multi-agent contexts.
To clarify the reproduction case: the user is clicking "Allow Always" multiple times for the same tool on the same path within a single session -- meaning "Allow Always" is functionally identical to "Allow Once" with zero persistence even within the current session. This is not a subagent inheritance issue; if "Allow Always" were writing correctly to settings.local.json, the same session would not re-prompt for the same operation. The button itself appears broken at the write step.
Diagnostic finding that strongly isolates the bug: the project-level settings.local.json already contains broad wildcard allow rules for Bash(), Read(), Write(), Edit(), Glob(), and Grep() -- as permissive as possible, nothing left to allow. Despite this, subagents spawned via the Task/Agent tool continue to prompt for permissions on every basic file operation. The issue is NOT about what rules are written in settings.local.json -- the subagent process is simply not reading or honoring the file that is present. Clicking 'Allow Always' in the permission prompt apparently appends redundant wildcard entries that were already there, so the UI feedback is misleading: the file write succeeds, but the subagent reads nothing from it.
This bug isn't just user friction. It's actively destabilizing safety infrastructure.
Cascade chain just observed in production:
The PreToolUse hook that should have blocked the script BEFORE allocation was wiped out by a sync commit. Recovery: had to git-archaeology the prior settings.json, identify the deleted block, and manually restore it with $CLAUDE_PROJECT_DIR-prefixed paths.
Root cause is the permission churn making settings.local.json a constantly-mutated file that other writes can clobber. Fix the permission persistence bug and you remove an entire class of safety regressions downstream.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.