[BUG] Prompt-type Stop hook returns {"ok": false} but stop is not blocked

Resolved 💬 4 comments Opened Mar 9, 2026 by christophercolumbusdog Closed Apr 3, 2026

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 a prompt-type Stop hook correctly returns {"ok": false, "reason": "..."}, Claude Code logs "Prompt hook condition was not met" but still allows the stop. The agent does not continue working — it stops, and the reason is surfaced as feedback in the next user turn instead.

Steps to Reproduce

  1. Add a prompt-type Stop hook to ~/.claude/settings.json:
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "prompt",
            "prompt": "Does this message ask the user whether to commit or push?\n\nMessage: $LAST_ASSISTANT_MESSAGE\n\nIf yes: {\"ok\": false, \"reason\": \"Do not ask — proceed with committing.\"}\nIf no: {\"ok\": true}",
            "timeout": 30
          }
        ]
      }
    ]
  }
}
  1. Ask Claude to respond with a message like "Want me to commit these changes?"
  2. Claude stops after outputting the message
  3. The Stop hook evaluates and correctly returns {"ok": false}

Debug Log Evidence

2026-03-09T21:40:02.599Z [DEBUG] Hooks: Model response: {"ok": false, "reason": "Do not ask — proceed with committing and pushing to Gerrit."}
2026-03-09T21:40:02.599Z [DEBUG] Hooks: Prompt hook condition was not met: Do not ask — proceed with committing and pushing to Gerrit.
...
2026-03-09T21:40:02.605Z [DEBUG] Stopped caffeinate, allowing sleep

The hook correctly parses, correctly identifies the condition was not met, but the stop proceeds anyway.

What Should Happen?

When a prompt-type Stop hook returns {"ok": false}, Claude should not stop and should continue working, using the reason as guidance — the same behavior as when a command-type Stop hook blocks a stop. This is consistent with the documentation on Prompt Hooks and their output schemas.

Additional Context

  • Related but distinct from #11947 (which is about Haiku returning malformed JSON). In this case the JSON is valid and correctly parsed.
  • Claude Code version: 2.1.71
  • Platform: macOS (Darwin 25.4.0)
  • The prompt hook is evaluated by Haiku (claude-haiku-4-5-20251001 per debug logs)
  • Note: Haiku also intermittently fails to return valid JSON for prompt hooks (lines 490-491 in debug log show error parsing response as JSON), but that is covered by #11947. This issue is specifically about the case where parsing succeeds but the result is ignored.

View original on GitHub ↗

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