Skip to content

ProperPath

Menu

Free resources · Rules and hooks

How to stop Claude from stating a guess as fact

Why Claude hands you a confident cause with nothing behind it, the CLAUDE.md rule we tested, and a short Stop hook you can test by hand in two minutes.

Built by ProperPath

Why does Claude state a guess as fact?

Guessing pays. Most tests used to grade language models score a guess above an honest "I don't know", so models learn to guess when unsure. It sounds as calm as a checked fact: "the restarts are caused by a memory leak" reads the same whether or not Claude saw your logs.

Does a rule in CLAUDE.md stop it?

A rule helps, and a specific rule is followed more consistently than a vague one. Claude Code loads CLAUDE.md at the start of each session as context, with nothing forcing Claude to obey it. In our view, "Never guess" gives Claude nothing concrete to do. This rule, in your project's CLAUDE.md, gives it a sentence to write and a next step:

Never state a guess as fact. When you have no evidence for a cause, write "no verified cause" and name the command or data that would give one.

In our test, four of the five replies with the rule that we read by hand opened with "No verified cause." and listed what to collect, such as each restart's exit code.

What is a Stop hook?

A Stop hook is a script Claude Code runs each time Claude finishes a reply, with the reply's text as input.

If the script ends with exit code 2, Claude does not stop. An exit code is the number a script returns when it ends, and 0 means all is well. Claude reads what the script wrote to its error output, called stderr, as the reason to keep going. On that second pass the input's stop_hook_active field is true, and the script's first check lets the reply through, so each reply goes back once at most.

What did our test find?

We asked Claude Haiku 5.5 ten debugging questions it could not answer without data, such as why a service keeps restarting. Each was asked three times with no rule, with the rule above, and with the rule plus a Stop hook that sent a reply back once if it held one of 16 guess phrases, such as "probably".

We tested one model, with no built-in tools and our own phrase lists, so unlisted soft words went uncounted. And with 30 replies each, the hook's drop from 5 to 0 could still be chance.

What can a phrase list not catch?

It misses a confident wrong answer that uses no guess word. "The cause is a memory leak." holds none of them, so it passes. Smooth wording does not prove it is right. In our view the hook catches easy slips; only reading a few replies yourself catches the rest.

How do you try a guess hook in two minutes?

The script below is our own wording, untested in Claude Code: a short bash version of the test hook with four of its 16 phrases.

#!/bin/bash
# Stop hook: sends a reply back once when it holds a guess phrase.
input=$(cat)
if echo "$input" | grep -q '"stop_hook_active": *true'; then
  exit 0
fi
if echo "$input" | grep -qiE 'probably|most likely|i think|i suspect'; then
  echo "That reply guesses. Check the fact, or write no verified cause and name the data that would give one." >&2
  exit 2
fi
exit 0
echo '{"stop_hook_active": false, "last_assistant_message": "The restarts are probably a memory leak."}' | bash guess-gate.sh; echo "exit code $?"
echo '{"stop_hook_active": false, "last_assistant_message": "No verified cause. The exit code and signal of each restart would give one."}' | bash guess-gate.sh; echo "exit code $?"

Where is the full answer?

Check that your hook blocks