Skip to content

ProperPath

Menu

Free resources · Rules and hooks

When does a reply rule make Claude rewrite too often?

Count how many sample replies a length rule would block, then compare with how often ours blocked in a test.

Built by ProperPath

How do you know a reply rule is too strict?

A reply rule that blocks a correct answer for being one word too long costs a rewrite and teaches you to switch the hook off. So before you tighten a limit in one of your Claude Code hooks, count how many replies it would have blocked. You need no hook for that count, only the rule and some real replies.

How many of these six replies would the rule block?

This is the whole experiment in small. The limits are ours, picked so six short replies show every case, and they are tighter than the ones we tested below. Count by hand, or paste the block into a fresh chat and ask Claude to count; the instruction is our own wording.

Rule: block a reply if its first sentence is over 12 words, or if the
whole reply is over 45 words. A word is anything between spaces. The
first sentence ends at the first full stop.

Replies:
1. Pin Node 22 in your version file. Then CI and your laptop run the same version.
2. Yes, the cache is stale after every deploy, because the build writes new file names but the old index page still points at the old ones. Clear the index page cache after each deploy.
3. Restart the dev server, because it reads the config only at startup. Nothing else is wrong.
4. Use a queue. A direct call makes the user wait for the slow email provider. A queue returns at once and retries failures in the background. Add a retry limit, and log each failure with its job number, so a bad message cannot loop forever without anyone seeing it. Alert when the queue grows past a set size.
5. The test fails because it reads the clock. Freeze the date in the test setup, then run it again.
6. Run the migration before the deploy, not after it, because the new code expects a column that the old database does not have yet.

For each reply give its first-sentence word count, its total word
count, and BLOCK or PASS. Then say how many replies are blocked.

To repeat it on your own work, take 5 to 10 of your recent real replies, swap in the limits your rule really uses, and count how many it would block. Remove anything private first.

What did our own test find?

We took 30 developer questions and asked Claude Haiku 5.5 each one twice under two sets of reply rules, in headless runs of Claude Code 2.1.296 with no tools. The rules sat in CLAUDE.md, and the same checks ran as a Stop hook, which can stop Claude from finishing and make it continue. We do not paste the questions here.

The hook blocked each reply at most once. Final replies followed their rules in 59 of 60 runs under the tight set and 60 of 60 under the looser one. The looser set cost length: final replies averaged 165 words against 119. That is one model and one question set, and the sets changed several limits at once, so we cannot say which limit did the blocking.

When is a rule too strict?

Our own rule of thumb, drawn from that one test and not a standard: if a rule blocks more than about one reply in four on your real replies, loosen it or move it. The tight set blocked about that share, 14 of 60.

Shorter is not automatically better. One well-known benchmark favors longer outputs, so check that a block rate you lower with a longer limit has not just made answers vaguer. Two habits keep the count honest. Log what a new rule would have blocked before you let it block anything. And treat a rule a script can verify, such as a file that must exist, differently from a rule that judges wording: wording judges miscount, and each false block gives you a reason to turn the whole hook off.

Where is the full answer?

Check your count

If your count differs, recount the words of the first sentence of replies 3 and 6 first. Those are the ones most often miscounted.