Orchestrate Claude Code with hooks instead of an agent framework
Rather than adopting an orchestration framework, one developer wires up Claude Code's built-in hook system: 84 hooks across 15 event types, all plain files. Their key fix was concurrency: several hooks on the same event each read input and two wrote the same JSON state file, corrupting it and breaking everything downstream. A single dispatcher per event that runs hooks in order from cached input solved it for about 200 ms per prompt. They also found that giving planning agents (broad context, many file reads) and implementation agents (narrow task, full context window) separate sessions works far better than mixing both roles in one.
Tools used
- Claude Code
Sources (1)
- Originalhttps://news.ycombinator.com/item?id=47130830 (opens in a new tab) ↗
blakec · Hacker News