ai newsDo., 29. Okt.

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. Puttin

dev.toDonnerstag 00:19 · 29.10.1 Min. Lesezeit
Bild: dev.to

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.

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 is about 100 lines of Python built on that idea:

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.

Quelle: dev.to (dev.to). Original öffnen