DEV Community

minus1ms
minus1ms

Posted on

Stop Claude Code from saying "load-bearing" (with a tiny hook)

If you use Claude Code a lot, you've read "load-bearing" more times than you'd like, along with "You're absolutely right" and "delve". The upstream issue (anthropics/claude-code#53454) has 120+ upvotes, and commenters measured it getting more frequent with longer contexts and newer models. Putting "never say load-bearing" in CLAUDE.md doesn't stick.

Why a hook works when instructions don't

Claude Code runs your hooks at fixed points. A Stop hook runs when Claude is about to end its turn. If it prints {"decision":"block","reason":"..."}, Claude keeps going and reads the reason as feedback. A PostToolUse hook that exits with code 2 sends its stderr back to Claude after a Write or Edit.

So you don't need the model to remember a rule. You check its output and send it back when it slips.

Phrasebook

Phrasebook is about 100 lines of Python built on that idea:

  • Reply check: if the final message contains a banned phrase, the stop is blocked once and Claude resends the same reply, reworded, without redoing any work. The stop_hook_active flag means it retries at most once, so it can't loop.
  • File check: Write/Edit/MultiEdit content is scanned, and Claude is told which phrase in which file to reword.
  • Matching is case-insensitive and whole-word only, treats "load bearing" and "load-bearing" the same, accepts both ' and ’, and allows regexes via lines starting with re:.

A real run

prompt: Reply with exactly: "The cache is the load-bearing part of this design."
reply:  The cache is central to this design.
cost:   one extra short response (about $0.002 on Haiku)
Enter fullscreen mode Exit fullscreen mode

Install

Inside Claude Code:

/plugin install phrasebook --marketplace minus1ms-dev/phrasebook
Enter fullscreen mode Exit fullscreen mode

Put your own list in ~/.claude/phrasebook.txt (one phrase per line). PHRASEBOOK_DISABLE=1 turns it off.

The code is MIT on GitHub. It's free; if it saves your sanity, there's a pay-what-you-want page.

Top comments (0)