claude-code - 💡(How to fix) Fix Feature request: allow named subagents to surface permission prompts to the parent terminal in non-blocking mode [1 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#58835Fetched 2026-05-14 03:38:16
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

Currently, Claude Code users have to choose two of these three:

  • Specialized named subagent (custom system prompt, tools, model)
  • Non-blocking execution (parent can keep working)
  • Permission prompts surface to the user instead of auto-deny

The three combinations available are documented in https://code.claude.com/docs/en/subagents:

ModeNon-blockingPrompts surfaceCustom prompt/tools
Foreground named subagent
Background named subagent❌ (auto-deny)
Fork (`CLAUDE_CODE_FORK_SUBAGENT=1`, no `subagent_type`)❌ (parent's prompt)

The relevant doc text:

When fork mode is enabled, every subagent spawn runs in the background regardless of the `background` field. Forks still surface permission prompts in your terminal as they occur; named subagents auto-deny anything that would prompt, as described above.

Root Cause

Currently, Claude Code users have to choose two of these three:

  • Specialized named subagent (custom system prompt, tools, model)
  • Non-blocking execution (parent can keep working)
  • Permission prompts surface to the user instead of auto-deny

The three combinations available are documented in https://code.claude.com/docs/en/subagents:

ModeNon-blockingPrompts surfaceCustom prompt/tools
Foreground named subagent
Background named subagent❌ (auto-deny)
Fork (`CLAUDE_CODE_FORK_SUBAGENT=1`, no `subagent_type`)❌ (parent's prompt)

The relevant doc text:

When fork mode is enabled, every subagent spawn runs in the background regardless of the `background` field. Forks still surface permission prompts in your terminal as they occur; named subagents auto-deny anything that would prompt, as described above.

Fix Action

Fix / Workaround

When dispatching multiple named subagents in parallel for different specialized tasks, with fork mode on:

  • Forks bubble prompts but lose the named subagent's custom system prompt and tools
  • Named subagents preserve their config but auto-deny anything not pre-allowlisted

Workarounds tried

Both runs were dispatched from the same parent session with identical fork mode and permission settings. The behavior difference is solely in the named-vs-fork distinction.

RAW_BUFFERClick to expand / collapse

Summary

Currently, Claude Code users have to choose two of these three:

  • Specialized named subagent (custom system prompt, tools, model)
  • Non-blocking execution (parent can keep working)
  • Permission prompts surface to the user instead of auto-deny

The three combinations available are documented in https://code.claude.com/docs/en/subagents:

ModeNon-blockingPrompts surfaceCustom prompt/tools
Foreground named subagent
Background named subagent❌ (auto-deny)
Fork (`CLAUDE_CODE_FORK_SUBAGENT=1`, no `subagent_type`)❌ (parent's prompt)

The relevant doc text:

When fork mode is enabled, every subagent spawn runs in the background regardless of the `background` field. Forks still surface permission prompts in your terminal as they occur; named subagents auto-deny anything that would prompt, as described above.

Use case

When dispatching multiple named subagents in parallel for different specialized tasks, with fork mode on:

  • Forks bubble prompts but lose the named subagent's custom system prompt and tools
  • Named subagents preserve their config but auto-deny anything not pre-allowlisted

This forces a choice between pre-allowlisting every conceivable command (broad attack surface) or accepting silent denials when an unanticipated permission is needed mid-run. Debugging "why did my background subagent silently fail?" becomes a recurring friction point.

Proposed solution

A permission mode for named subagents, or a per-call flag on the `Agent` tool, that:

  • Runs the named subagent non-blocking (concurrent with the parent)
  • Routes permission prompts back to the parent's terminal
  • Includes the subagent's identity and the specific tool call in the prompt UI so the user has context to decide

For example:

```typescript Agent({ subagent_type: "my-specialized-agent", prompt: "...", run_in_background: true, permission_mode: "ask" // or a new field: bubble_prompts: true }) ```

The UI design challenge is real — multiple concurrent prompts need queueing or stacking — but the value is high: parallelism + specialized subagent behavior + approval instead of silent failure.

Workarounds tried

  • Pre-allowlisting common patterns: works but encourages broad rules over least-privilege
  • Foreground subagents: block the parent, defeating parallelism
  • Forks: lose the specialized system prompt and incur a higher token cost from inheriting full parent context

Verified empirically

Tested in Claude Code v2.x with `CLAUDE_CODE_FORK_SUBAGENT=1`:

  • Fork (no `subagent_type`) + non-allowlisted `mkdir`: prompt bubbled to terminal, user could approve, command succeeded.
  • Named subagent + `run_in_background: true` + non-allowlisted `mkdir`: auto-denied with "Permission to use Bash has been denied", subagent reported failure.

Both runs were dispatched from the same parent session with identical fork mode and permission settings. The behavior difference is solely in the named-vs-fork distinction.

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 Feature request: allow named subagents to surface permission prompts to the parent terminal in non-blocking mode [1 comments, 2 participants]