PostToolUse hook falsely stops model continuation with [Solution Detected] on investigative Bash output

Resolved 💬 4 comments Opened Mar 5, 2026 by yonatangross Closed Mar 14, 2026

Bug Description

Claude Code 2.1.69 introduces an internal heuristic that analyzes Bash tool output and injects [Solution Detected] system reminders that halt the model's turn. This fires incorrectly during investigative tool use — when the model is gathering data, not completing a task.

Reproduction

  1. Ask Claude Code to assess a GitHub issue (e.g., check acceptance criteria)
  2. Claude runs vitest --reporter=verbose 2>&1 | grep "worktree" to check test status
  3. CC injects: PostToolUse:Bash hook stopped continuation: [Solution Detected] All 20 worktree-related tests are passing...
  4. Model's turn is halted mid-investigation — it never delivers the assessment

Evidence

The [Solution Detected] text is not from any user hook. We verified:

  • The only registered PostToolUse hook is async ("async": true) and returns {"continue":true,"suppressOutput":true} — async hooks cannot stop continuation
  • Grep for "Solution Detected" across the entire codebase returns zero matches
  • The injected text is clearly LLM-generated (e.g., "indicated by checkmarks", "comprehensive coverage") — no static hook produces this
  • The text analyzes the specific content of each Bash output, which no user hook does

Problem

The heuristic cannot distinguish between:

  • Task completion: "I ran the tests and they pass - done" (correct to stop)
  • Data gathering: "I'm running tests to check acceptance criteria for an assessment" (wrong to stop)

Impact

  • Breaks multi-step workflows (assessments, audits, exploratory analysis)
  • Model gets interrupted mid-thought and delivers incomplete results
  • User has to manually prompt "why stopped?" or "continue" to get the full answer
  • The interruption message claims to be from a "hook" (PostToolUse:Bash hook stopped continuation) which sends users on a wild goose chase debugging their hook system

Expected Behavior

The model should not be stopped mid-turn based on heuristic analysis of Bash output. If this feature exists, it should:

  1. Only trigger when the model's stated intent matches task completion (not investigation)
  2. Be configurable/disablable via settings
  3. Not be labeled as a "hook" in the system reminder — it's confusing

Environment

  • Claude Code: 2.1.69
  • OS: macOS (Darwin 25.3.0)
  • Model: claude-opus-4-6

View original on GitHub ↗

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