claude-code - 💡(How to fix) Fix [Bug Report] Stop hook (goal condition) loops with no user input when the condition is subjective/unverifiable

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…

Error Message

  • Lower the default block cap, and/or warn that subjective goal conditions can loop.

Code Example

[goal: 완벽하게 해줘]
   (assistant) Waiting on your decision: "canonical 적용해" or /goal clear.
   Goal not yet met… continuing
   (assistant) Holding. No further action without explicit go-ahead.
   Goal not yet met… continuing
   (assistant) Awaiting your instruction...
Goal not yet met… continuing
     ... (repeats) ...
A hook blocked the turn from ending 9 consecutive times — overriding and ending turn.
RAW_BUFFERClick to expand / collapse

Title

subjective/unverifiable

Summary

A session-scoped goal with a subjective condition "make it perfect" caused the Stop hook to block turn-end and re-inject near-identical feedback every turn. The user gave no input — the assistant and hook ping-ponged on their own for 9 consecutive turns until the runtime force-ended it ("A hook blocked the turn from ending 9 consecutive times — overriding and ending turn"). /goal clear correctly stopped it afterward.

Environment

  • Claude Code, model: Opus 4.8 (1M context)
  • Feature: session-scoped goal / Stop hook (/goal <condition>)

Steps to reproduce

  1. Set a goal with a subjective/unverifiable condition: /goal make it perfect.
  2. Complete the in-scope work; the hook judges the (subjective) condition unmet.
  3. Observe the hook block turn-end and re-inject feedback repeatedly with no user input.

Expected

A subjective condition the model cannot objectively satisfy should not produce an unbounded assistant↔hook loop with no user in the loop.

Actual

Hook fired ~9x with no user turns in between, then the runtime force-ended the turn.

Impact

  • Burns turns/tokens on machine-vs-machine repetition.
  • The hook's interpretation pressured actions that contradicted explicit user instructions (the assistant refused correctly, but a worse-behaved agent could be pushed into unwanted changes).

Notes / possible fixes

  • For Stop hooks, honor stop_hook_active and return success while true.
  • Lower the default block cap, and/or warn that subjective goal conditions can loop.

Evidence (verbatim, repetition)

The Stop hook re-injected the same feedback every turn with no user input in between. Abbreviated transcript:

[goal: 완벽하게 해줘]
⏺ (assistant) Waiting on your decision: "canonical 적용해" or /goal clear.
◯ Goal not yet met… continuing
⏺ (assistant) Holding. No further action without explicit go-ahead.
◯ Goal not yet met… continuing
⏺ (assistant) Awaiting your instruction...
◯ Goal not yet met… continuing
   ... (repeats) ...
⏺ A hook blocked the turn from ending 9 consecutive times — overriding and ending turn.

Each Stop hook feedback: payload was byte-for-byte near-identical: "Canonical bugs C1–C5 ... remain unfixed ... condition '완벽하게 해줘' ... objectively unsatisfied." — repeated ~9× back-to-back with zero user turns.

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 [Bug Report] Stop hook (goal condition) loops with no user input when the condition is subjective/unverifiable