Deep Modules: Codebase Structure as Context for AI Agents
Rounding decided across four files costs 5,500 tokens to trace, every time anyone asks. One deep module cuts that to 700 - and pays for itself by the fourth ask.
Technical insights into multi-agent orchestration, local protocols, and
developer-centric terminal workflows.
Rounding decided across four files costs 5,500 tokens to trace, every time anyone asks. One deep module cuts that to 700 - and pays for itself by the fourth ask.
A requirements doc fixes the destination, a phased plan fixes the journey - and every technique on this blog for keeping a long build sharp only protects the journey. Here's what the destination costs when nobody checks it first.
Full mesh and hub-and-spoke need exactly the same number of channels at three agents, which is why every swarm demo looks fine. Add a fourth specialist and the mesh pulls ahead for good - 45 paths against 10 by the time you reach ten.
A rule in your rules file only gets read if it survives to the top of a shrinking window. Move it into a hook that fires on the event instead, and expected compliance across one session's edits goes from 42.8% to 95.0%.
The blocker to running an agent overnight was never capability - it's trust. Layer a sandbox, an allowlist, and a scoped credential right, and one laptop's worst-case reach falls from 399 addressable things to 63, all recoverable with git checkout.
The model cannot tell an instruction from data, because both arrive as tokens in one flat stream. The defense that measured best marks which channel a token came from. It never reads the words.
A plan built from a vague prompt is a guess in a nicer font. ClarEval shows what skipping the interview costs: about 11 build attempts before one passes, versus about 1 if you ask first.
Your best agent workflow is six files that live on one machine. Rebuilt through Slack and memory, all six arrive intact 9.6% of the time. A plugin makes the whole loop one installable, versioned unit your team pulls.
A team wiring three agent surfaces to three systems by hand pays for nine adapters, 108 hours of year-one work. One MCP server per system, pointed at from each agent, costs 40.5 hours, and the ratio climbs with every agent the team adds.
A one-line AGENTS.md fix that visibly resolves the case you were chasing can still fail its own regression gate. Fixing one case here drops a six-case eval from 0.833 to 0.500 - and only a baseline that ratchets upward catches it before a user does.