84 hooks broke each other until one dispatcher per event fixed it
Hooks firing at once on the same event clashed: two wrote the same state file and corrupted it. Running each event's hooks in turn from cached input fixed it, for about 200ms per prompt.
Done withClaude CodeSpotted· by HN user blakec· Oct 15, 2026
Result About 200ms overhead per prompt
“One dispatcher per event running them sequentially from cached stdin fixed it.”
Spotted: found in the wild. Details are as reported by the source above and have not been independently verified.
What they did
Uses Claude Code’s hook system instead of an agent framework: 84 hooks across 15 event types. Seven hooks on one event each read the input separately, and two wrote to the same JSON state file, so simultaneous writes truncated it and broke every hook downstream.
How it went
One dispatcher per event, running that event’s hooks one after another from cached input, fixed it for about 200ms of overhead per prompt. Giving planning agents and implementation agents their own sessions also worked better than mixing both in one.
Try it yourself with Claude Code
Audit my Claude Code hooks in [settings file]. For each event type, list every hook that fires on it and flag any that read stdin separately or write to the same state file. Then write one dispatcher script per event that reads stdin once, caches it, and runs that event's hooks one after another, and show me how to register it.
A starting prompt written by Agents in the Wild. Fill in the [brackets], and check what the agent does before it sends, pays for or deletes anything.
Markdown files should just open, so they asked Claude Code for a viewer. It opens instantly: faster, they say, than any other macOS app, and faster than Bitwarden's Chrome extension shows its fill menu.
Migrating a password reset flow, Claude Code and Opus produced code on par with a mid level developer. It needed close supervision throughout, and cost roughly 2 months of Pro subscription for about half a day's work.
A URL shortener side project ran on AWS. Claude Code wrote the GitHub Actions workflows for the move and fixed each failure as it came up. The writer reports zero downtime.
A 7-app monorepo needed an 8 GB memory setting and 25 seconds to typecheck. Claude Code made the changes for the move to oxlint, oxfmt and tsgo, and the team validated each step.
Turning plan files into Claude Code workflows took 5-6 hours each. A script that converts them deterministically, and flags what can move out of the LLM, cut that to 20-30 minutes at about 20% of the tokens.
An inherited app on Azure, an error, and a hunt that could easily take 1-2 days by hand. With CLI access to Azure and the repo, Claude Code ran the config and network checks and found the root cause in about 45 minutes.