Sachin Malhotra, an engineer at Anthropic, recounts how the company had to overhaul its test impact analysis service under the pressure of agentic coding. The starting point is a chain of figures: engineers ship on average eight times more code per quarter than between 2021 and 2025, Claude writes 80% of it and plays a major part in PR review and approval, the number of tests was multiplied by ten with nearly constant headcount. The product of all this is a twenty-five-fold increase in CI jobs in six months. Writing code is no longer the constraint; once review is accelerated, it is CI that absorbs the pressure.
The service rests on two deterministic components that must stay synchronized: a listener, which records the results of each run, and a selector, which reads this history to decide which tests run on each PR. Keeping a per-test history required a single writer, hence a single process, hence the impossibility of sharding horizontally. The failure mode is the listener falling behind: twenty minutes is enough to leave tens of thousands of updates unapplied, which triggers unnecessary investigations, lets flaky tests block merges, and prevents a fixed or added test from running.
20 minutes of listener lag can translate into tens of thousands of test updates not being applied
— Sachin Malhotra , claude.com
Three fixes follow one another, each with a collapsing lifespan: doubling the cores holds for seventy days; sharding by package — the listener didn't need a single global writer but one per package, and Claude wrote the code for it — holds for twenty-nine days; daily restarts hold for less than a day. In the meantime, a long-running session in an internal version of Claude Tag monitors the service and alerts beyond fifty thousand backlog jobs; it argues for the overhaul for months, but the team prefers the patch.
The overhaul gives the service a magasin de données en mémoire. Each listener worker processes any result, appends it to a log, and moves on without retaining anything: stateless, hence horizontally scalable. A separate consumer aggregates the log into per-test history every few seconds. More expensive to run, but scalable and profilable. Three weeks for one engineer, versus about a quarter a year earlier.
The lessons come down to four rules: anticipate the exponential and assume a load twenty-five times higher within two quarters, size the v0 at ten to twenty times the perceived scale, instrument services so they serve as Claude's eyes and ears, and keep state out of the process from the start.
Key takeaways
The causal chain, not just the number. 8× more code shipped per engineer per quarter, 80% of it written by Claude, plus a significant role for AI in PR review and approval; ×10 on the number of tests with nearly constant headcount. Result: ×25 on CI jobs in six months. « Writing code is no longer the constraint, and once PR review gets accelerated, CI starts feeling the pressure. » The bottleneck doesn't disappear, it moves down a level — an infrastructural variant of the "verification bottleneck" from [[sfeir-code-review-anneau-contraintes-2026-07-30]].
The argument specific to agents. , the most transferable point in the text. Running everything on every change works up to a point, then gates become long, costly, and unreliable — and therefore ignored. Above all: a human knows how to dismiss a test failure that doesn't concern them, an agent doesn't — it needs more context and direction. Given a valid and relevant set of tests, it self-verifies and iterates on its own. Test selection stops being a cost optimization and becomes a condition for autonomy.
The v0 architecture and its original sin. keeping a per-test history required a single writer, hence a single process, hence no horizontal sharding possible. State lived inside the process.
The physics of lag. 20 minutes of lag = tens of thousands of updates left unapplied. Three distinct consequences — a bad merge fails a test for everyone and triggers unnecessary investigations; a dependency that starts flaking produces reds that block merges; a fixed or added test doesn't run until the listener has caught up, risking a regression.
The three patches and their half-life. (1) doubling the cores — 70 days; (2) sharding by package — the listener didn't need a single global writer, but a single writer per package, and Claude generated the code — 29 days; (3) daily restarts — less than a day, with only four bugs found, a memory allocator change with no effect, and the deliberate refusal to profile the memory of a singleton already under load.
Delegated supervision. , a detail worth keeping: a long-running session in an internal version of Claude Tag dedicated to the service, which alerts the author as soon as the listener falls more than 50,000 jobs behind and picks the conversation back up where it left off. For months, without having to reload the context of past attempts. And « Claude often argued for an overhaul, but we usually settled on another patch ».
The overhaul. giving the service a foundation — a magasin de données en mémoire. Any listener worker processes any result, appends it to a log, and moves on without keeping anything: stateless, hence horizontally scalable. A separate consumer aggregates the log into per-test history every few seconds. More expensive to run, but much easier to scale and profile than a fragile singleton. The fine-tuning (log size, number of workers) was done largely by Claude on its own.
The economics of the decision have changed. Three weeks for one engineer, versus about a quarter a year earlier. That's the real shift: half-measures buy less and less time while a full overhaul costs less and less — « much more sustainable now that writing code is no longer the bottleneck ».
The four rules he draws from it. assume the architecture will face ×25 the load within two quarters, whether built or bought; accept that over-engineering recedes as a mistake — aim for 10-20× the perceived scale as early as v0 if the budget allows; instrument services so they serve as Claude's eyes and ears, at minimum the invariant "as many CI jobs in as out"; take state out of the process from the start, never run a critical service as an unmeasurable single instance.
The shape of the load changes, not just its volume. Claude favors smaller, more granular PRs (one more argument against running every test on every PR), the activity floor rises because agents push at night and on weekends, but the load stays bursty since humans still drive and approve a significant share of PRs.
The final bet. , to be checked in twelve months: « I anticipate horizontally scaled test selection architecture will become industry standard » as agents produce both more PRs and more tests.
Key figures
×10 on the number of tests and ×25 on CI jobs in six months