claude-code - 💡(How to fix) Fix Subagent dispatch: mid-session UI-accepted permission grants don't propagate to child subagents

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…

When the user accepts a permission prompt in the parent session (via the UI / --dangerously flag / etc.) and then the parent immediately dispatches a subagent, the child hits the same permission check and re-prompts as if the grant never happened.

Root Cause

"Restart the session is the only workaround" is the signature of this being a runtime bug, not a config issue. There appear to be two code paths for permissions:

  1. Persistent grants (read from settings.json at session start) → propagated to children correctly
  2. Session-state grants (accepted at runtime via UI/prompt) → NOT propagated to children

The fix is either: persist UI-accepted grants to settings.local.json in real time, OR include session-state grants in the child-dispatch payload.

Fix Action

Workaround

Declare every required permission in settings.json before dispatching children. Never rely on mid-session UI grants for a child's permission surface.

RAW_BUFFERClick to expand / collapse

Summary

When the user accepts a permission prompt in the parent session (via the UI / --dangerously flag / etc.) and then the parent immediately dispatches a subagent, the child hits the same permission check and re-prompts as if the grant never happened.

Setup

  • Parent session running
  • User is prompted for permission X in the parent and accepts it
  • Without restarting the session, parent dispatches a child subagent that needs permission X

Expected

Child inherits the just-granted permission.

Actual

Child re-prompts for permission X. The only consumer-side workaround is to restart the session so settings.json is re-read.

Reproducer

https://github.com/Regevba/FitTracker2/tree/main/docs/superpowers/plans/f6-f9-reproducer § F9

Analysis

"Restart the session is the only workaround" is the signature of this being a runtime bug, not a config issue. There appear to be two code paths for permissions:

  1. Persistent grants (read from settings.json at session start) → propagated to children correctly
  2. Session-state grants (accepted at runtime via UI/prompt) → NOT propagated to children

The fix is either: persist UI-accepted grants to settings.local.json in real time, OR include session-state grants in the child-dispatch payload.

Workaround

Declare every required permission in settings.json before dispatching children. Never rely on mid-session UI grants for a child's permission surface.

Related

Likely the same root cause as F8, just exposed by a different mutation-timing pattern.

extent analysis

TL;DR

To fix the issue, either persist UI-accepted grants to settings.local.json in real time or include session-state grants in the child-dispatch payload.

Guidance

  • Identify the code responsible for handling permission grants and modify it to update settings.local.json when a user accepts a permission prompt via the UI.
  • Consider including session-state grants in the child-dispatch payload to ensure children inherit the necessary permissions.
  • Review the reproducer provided in the issue to understand the specific scenario where the issue occurs.
  • Verify that the fix works by testing the child subagent dispatch after accepting a permission prompt in the parent session.

Example

No code snippet is provided as the issue does not contain specific code references.

Notes

The issue seems to be related to the timing of permission grants and the dispatch of child subagents. The provided workaround of declaring required permissions in settings.json before dispatching children may not be feasible in all scenarios.

Recommendation

Apply a workaround by declaring every required permission in settings.json before dispatching children, as this is a more immediate solution that can be implemented without modifying the underlying code. However, a permanent fix should still be pursued to handle mid-session UI grants properly.

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

claude-code - 💡(How to fix) Fix Subagent dispatch: mid-session UI-accepted permission grants don't propagate to child subagents