Today I investigated a strange issue: recently, Opus 4.8 has felt "off," with response quality fluctuating and occasionally mentioning things I never asked about.


After a long search, I found the problem was on my end—my 17 Hook scripts have been constantly injecting junk into the model's dialogue context.
Claude Code's Hooks have two output channels. One is visible to the model, and the other is only visible to your terminal. Most people writing Hooks don't notice this difference; the default output method happens to use the "visible to the model" channel.
As a result: every time you call a tool, the Hook inserts a reminder into the model's context that it doesn't need to see. In my case, a single conversation was injected 280 times, and a bug in a counter made the model think "this session has already called the tool 21,810 times."
The model isn't getting dumber; it's struggling amidst a bunch of noise you've injected yourself.
The fix is simple: change `echo "xxx"` to `echo "xxx" >&2` in the Hook, switching from "visible to the model" to "only visible to the terminal."
If you've written custom Hooks and feel the model's performance has worsened, check this first.
View Original
post-image
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
  • Reward
  • Comment
  • Repost
  • Share
Comment
Add a comment
Add a comment
No comments