AI Founder Weekly

OpenClaw deleted 400k lines of its own tests

Peter Steinberger says the trick was giving the agent a number to hit, not telling it to tidy up.

Peter Steinberger says OpenClaw deleted around 400k lines of its own tests without much change in code coverage.

Peter Steinberger 馃
@steipete
X
remove 20% of the least useful tests while maintaining code coverage within 2%
Sep 24, 2026 路 View on X
Peter Steinberger 馃
@steipete
X
Modern models just love writing tests for every tiny change, even if they aren't useful.
Sep 24, 2026 路 View on X

His diagnosis is the part worth keeping. Modern models, he says, love writing tests for every tiny change, even when those tests are not useful. That is not a one-off bug in one codebase, it is the default behaviour of an agent that has been asked to be thorough and has no cost attached to being thorough. Every small patch ships with its own little suite, nobody deletes anything, and the pile grows until the test run is the slowest thing you own.

Why "clean this up" does not work

Steinberger's point about the fix is sharper than the number. Tell an agent to clean up and it will stop far too early. It removes a handful of obvious duplicates, declares the job done and hands you back a codebase that is functionally unchanged. The instruction has no finish line in it, so the agent invents a modest one.

What he posted instead is a target with a guardrail attached. Ask for 20% of the least useful tests removed while code coverage stays within 2%. Now there is a quantity to hit and a constraint that stops the agent from hitting it the lazy way, which would be deleting whatever tests cover the most code. The two numbers pull against each other, and that tension is the actual prompt.

The read

This is one founder's result on one codebase, reported by him, with no before and after coverage figures published beyond "not much change". Treat the 400k as his number rather than a measured fact. But the shape of the advice generalises cheaply, and it costs you nothing to test on a branch.

The broader lesson for anyone running agents on maintenance work is that the agent will anchor on whatever bar you set. Vague scope produces vague output. A quantified goal plus a guardrail is doing work that a polite request never does, and deletion is exactly the kind of task where agents under-reach unless you make the target explicit.

Get the next one by email

Founders building with AI, every day. Real revenue, real pricing, real launches and what they would redo. No hype sludge. Every number links out.