[BUG] /goal stop hook fires after every assistant turn, interrupting user mid-message

Open 💬 2 comments Opened May 29, 2026 by cfairbanks

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When /goal is active, the stop hook evaluator fires after every assistant response — including while the
user is actively typing their next message. This creates an unrecoverable loop:

The assistant hits an obstacle and needs information from the user to proceed. The user begins typing — the
stop hook fires mid-message, interrupting input. The assistant responds, the hook fires again. This repeats
indefinitely. The user cannot finish a sentence because every turn triggers the evaluator.

Because the goal condition isn't met, the hook keeps blocking. The user has no way to communicate a fix to
the assistant, making it impossible to actually reach the goal. The exit path (/goal stop) is not surfaced
anywhere in the blocked state.

What Should Happen?

The stop hook should not interrupt the user while they are composing a message. It should only evaluate
after a full user-turn + assistant-turn cycle completes with no user input pending.

At minimum, when the hook fires and blocks, the UI should surface /goal stop as an escape hatch.

Error Messages/Logs

No error messages — the hook silently re-evaluates every turn, returning "goal not met" each time and re-blocking the session.

Steps to Reproduce

  1. Start a Claude Code session in a workspace with a yarn build step that fails due to Typescript compilation errors that can't be easily solved. In my case, it was a failing import for a class that had been moved from one package to another.
  2. Run: /goal get yarn build to pass
  3. Run the build — it fails with TypeScript compilation errors
  4. Begin typing a message to tell the assistant where the missing type is defined
  5. Observe: the stop hook fires mid-message, interrupting input before you can finish
  6. Assistant responds asking for info — hook fires again immediately
  7. Session loops indefinitely; /goal stop is the only exit but is not surfaced anywhere

Claude Model

Sonnet (default)

Is this a regression?

First time I tried to use /goal - so have not experienced this in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.156 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Related issues:

  • #59827 — similar infinite loop symptom in a different scenario
  • #61337 — /goal blocking indefinitely via AskUserQuestion

View original on GitHub ↗

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