10 Your codebase is the bottleneck: code organization for the agent era
This chapter covers
- Context fragmentation at team scale
- The dependency graph as agent GPS and safety net
- CI speed, sandboxes, and agent throughput
- Test reliability as the trust prerequisite
- Review automation and continuous modernization
"We gave every developer a Copilot license. Three months later we had fourteen microservices with fourteen different coding conventions, three versions of the auth library, and an agent that generated a perfectly valid PR against the wrong service."
So far the focus has been on getting one developer's AI workflow to produce correct, trustworthy, well-structured code. Context engineering, agentic iteration loops, evaluation hierarchies, trust calibration, cost optimization, all of it assumes a world where the unit of analysis is you: your IDE, your agent, your prompts, your token budget. And it works. Your agent has a CLAUDE.md with project conventions. It has MCP servers wired to your docs. It reads the source files, runs the tests, submits PRs. Within a single project, the agent is competent.
What happens when you zoom out?
10.1 The context fragmentation problem
10.1.1 Monorepo as a context delivery mechanism
10.2 The navigation and blast radius problem
10.2.1 The second failure mode: blast radius
10.2.2 The dependency graph as the agent's GPS, and safety net
10.2.3 Strict deps as contract enforcement
10.2.4 Target granularity: reasoning boundaries and build boundaries
10.2.5 Beyond static documentation: the build system as agent collaborator
10.2.6 The organizational cost of coherence
10.3 The throughput wall
10.3.1 Where the agent runs matters more than how fast it runs
10.3.2 Hermetic sandboxes: same source, same config, same result
10.3.3 Remote caching: the more agents you run, the faster everyone goes
10.3.4 Progressive validation: not every iteration needs full verification
10.3.5 Module architecture as throughput investment
10.3.6 The 4x hidden tax
10.4 The lying oracle
10.4.1 The three lies
10.4.2 Fix the lies before you fix the speed
10.5 The review bottleneck
10.5.1 Lint-as-architecture: encoding what you know
10.5.2 Green/Yellow/Red: making auto-merge trustworthy
10.5.3 Compound interest on governance
10.6 The night shift and the production feedback loop
10.6.1 Continuous modernization: making the dead walk
10.6.2 The open loop: production knows what's broken
10.6.3 Where all the pillars converge