claude-code - 💡(How to fix) Fix [Bug] Rating prompt triggers in fork subagents and deadlocks them

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…

Root Cause

Summary The automatic in-session rating prompt (the numeric "rate this response" UI) was triggered inside a running fork agent. Because the fork has no interactive user attached, the prompt cannot be answered and the agent becomes stuck — effectively halted until the parent intervenes.

Fix Action

Fix / Workaround

Repro

  1. From a parent session, dispatch a fork via the Agent tool (with CLAUDE_CODE_FORK_SUBAGENT=1) — isolation: "worktree" in my case.
  2. Let the fork run a non-trivial multi-step task (substantial tool use, file edits, test runs).
  3. At some point during the fork's run, the rating UI surfaces inside the fork's loop.

Env

  • Claude Code (Opus 4.7)
  • macOS (Darwin 25.5.0)
  • CLAUDE_CODE_FORK_SUBAGENT=1
  • Fork dispatched with isolation: "worktree"

Code Example

[]
RAW_BUFFERClick to expand / collapse

Bug Description Title: Automatic rating/feedback prompt triggers inside fork (sub)agents and blocks them

Summary The automatic in-session rating prompt (the numeric "rate this response" UI) was triggered inside a running fork agent. Because the fork has no interactive user attached, the prompt cannot be answered and the agent becomes stuck — effectively halted until the parent intervenes.

Repro

  1. From a parent session, dispatch a fork via the Agent tool (with CLAUDE_CODE_FORK_SUBAGENT=1) — isolation: "worktree" in my case.
  2. Let the fork run a non-trivial multi-step task (substantial tool use, file edits, test runs).
  3. At some point during the fork's run, the rating UI surfaces inside the fork's loop.

Observed

  • The fork's progress halts at the rating prompt.
  • The parent has no way to dismiss/answer it on the fork's behalf.
  • The work the fork had in flight is suspended; the worktree is left in an intermediate state.

Expected Fork / subagent runs should be exempt from the automatic rating prompt entirely. Forks are background, non-interactive workers — any UI that requires user input from inside them will deadlock them. The rating system should only trigger on the foreground/parent session that the user is actively interacting with.

Impact

  • Breaks fan-out workflows (parallel forks) — any of the forks can lock up unpredictably.
  • Loses progress / wastes tokens already spent in the fork's context.
  • Makes long-running orchestration patterns (worktree-isolated parallel forks, federation patterns) unreliable.

Suggested fix Gate the rating prompt on "is the active loop the top-level user-attached session?" — when the loop is a subagent / fork (detectable via the same mechanism that injects the no-recursion directive), suppress the prompt unconditionally.

Env

  • Claude Code (Opus 4.7)
  • macOS (Darwin 25.5.0)
  • CLAUDE_CODE_FORK_SUBAGENT=1
  • Fork dispatched with isolation: "worktree"

Environment Info

  • Platform: darwin
  • Terminal: ghostty
  • Version: 2.1.163
  • Feedback ID: e9979b27-ed61-4504-80ef-f75c9af4e019

Errors

[]

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