[Bug] Rating prompt triggers in fork subagents and deadlocks them

Resolved 💬 2 comments Opened Jun 5, 2026 by Kirchlive Closed Jul 14, 2026

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.

  1. Let the fork run a non-trivial multi-step task (substantial tool use, file

edits, test runs).

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

[]

View original on GitHub ↗

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