explainx.ai0k
TrendingNewsPathwaysSkills
Pricing
explainx.ai

Upskill in AI — 16 free pathways, live workshops & bootcamps, and 50+ courses from practitioners. Plus the skills, tools, and MCP servers to practice on.

follow us

follow on google

Add explainx.ai as a preferred source

corporate training

support@explainx.ai

get started

Find your pathTake Free Evaluation

community

Join the community

learn

mind: share how you thinkpathways — start freeworkshopsbootcampscoursescompare Explainxcertificationsmock testsexplainx universitycorporate traininglearn skills & mcp

discover

skillsmcp serversexplainx mcptoolsmdx readeragentsllmsdesignsdictionarypeopleagi trackerfelony benchranks

company

aboutvisionmissionteaminstructorsteach on explainxpartnershipscommunityhackathonscareers

content

daily AI newsstate of AI — live resultsblogreleasespromptsgeneratorsresource libraryfor LLMsexplainx.ai kids

solutions

all solutionsdeveloper upskillingmarketing upskillingproduct manager upskillingleadership upskilling

newsletter · weekly

Get AI news, tools, and insights in your inbox.

supportcontactprivacytermsdata rightshow we create contentsubmission guidelines

© 2026 AISOLO Technologies Pvt Ltd

explainx.ai

On this page

  • TL;DR: the skill and the result
  • Why do AI agents write so many useless tests?
  • What is inside the test-audit skill?
  • What counts as a junk test?
  • What tests does the skill tell you to keep?
  • How do I make an agent actually finish the job?
  • A copy-paste version for your own repo
  • What are the limits and risks?
  • What this means for what you build or pay
  • How do you measure whether a pruning campaign worked?
  • Related reading on explainx.ai
← Back to blog

explainx / blog

OpenClaw Deleted 400K Lines of AI-Written Tests. The test-audit Skill Shows How

OpenClaw, Agent Skills, Testing, AI Coding, Guides

OpenClaw removed about 400K lines of its own tests with little coverage change using a test-audit agent skill. The four-question gate and how to copy it.

Sep 25, 2026·8 min read·Yash Thakker
add explainx.ai
go deep
OpenClaw Deleted 400K Lines of AI-Written Tests. The test-audit Skill Shows How

Update — September 25, 2026: Anthropic's claude.ai speedup uses the same measurable-goal principle. See How Anthropic made Claude.ai faster.

OpenClaw deleted around 400,000 lines of its own tests and code coverage barely moved. Maintainer Peter Steinberger posted the result on September 24, 2026, with a blunt diagnosis: "Modern models just love writing tests for every tiny change, even if they aren't useful." What made it possible is a public agent skill, test-audit, that anyone can copy.

This is the reverse of the usual AI-coding worry. The problem here is not that agents skip tests. It is that they write so many that the suite becomes a cost center, and nobody can tell which tests still protect anything.

TL;DR: the skill and the result

table · 2 cols
QuestionAnswer
What was deleted?About 400K lines of tests, per Steinberger
What happened to coverage?"Without much change in code coverage"
What tool did it?The test-audit agent skill in the OpenClaw repo
Which modes does it have?Authoring gate, audit, campaign
Key principleA test that breaks under behavior-preserving refactoring "is asserting implementation, not behavior"
Best prompt tipSet a measurable goal: remove 20% of the least useful tests, keep coverage within 2%
Which models wrote them?Steinberger says they came from models under about six months old; current ones write "more clever but still not always useful tests"

Why do AI agents write so many useless tests?

Two patterns show up in the thread. Coding agents add a test for every small change because tests are an easy way to appear thorough, and models are rewarded for verifying their work. And when the agent changes code, it often rewrites the tests to match, which David Cramer of Sentry pointed out defeats their purpose: "the reason for those tests in the first place wasn't to prevent regressions."

Steinberger agreed it is "the worst" and added that OpenClaw keeps tests the agent does not see until release prep, specifically to catch regressions the agent may have papered over. That is a useful design idea on its own: hold out some verification from the loop that is optimizing against it.

The cost is not abstract. To a commenter asking how adding a test can ever be bad, Steinberger answered: "If you pay for CI you will understand." Slow, flaky, redundant suites burn minutes on every pull request. Our post on how Anthropic scaled test impact analysis covers the same pressure from the infrastructure side: as agents write most of the code, CI volume grows faster than anything else.

What is inside the test-audit skill?

The skill's description says to invoke it "whenever writing, changing, reviewing, or sweeping tests." It has three operating modes.

Mode 1: Authoring gate

Before any test is added or changed, four questions must have answers:

  1. What observable behavior, invariant or independent contract does it protect?
  2. What credible regression makes it fail?
  3. Why does existing coverage not already catch that failure?
  4. Does it require a production seam (an export, flag or wrapper) that no production caller needs?

The last question is the sharpest. Agents routinely export a private function or add a flag purely so a test can reach it, which turns test-only scaffolding into permanent production surface.

Mode 2: Audit

A read-only sweep that reports evidence before editing. The skill splits discovery into parallel lanes: core and packages, plugins under extensions/, UI and apps and scripts, and cross-cutting patterns.

Mode 3: Campaign

For pruning a whole subsystem. The skill requires reading a CAMPAIGN.md first, and the handoff report lists root cause, removed categories, production simplifications, false positives retained with justification, proof run, production versus test lines of code, and named follow-ups.

What counts as a junk test?

The skill gives a rejection checklist. A test matching one of these fails the gate unless a retention rule applies.

table · 2 cols
Junk patternWhy it is useless
Assertion-free probesCannot fail
Self-comparisons, identity copiersCompare a value to itself
Copied fixtures or manifestsDuplicate the thing under test
Exact source, import or string grepsBreak on harmless edits
Private-predicate tests duplicated at real boundariesAlready covered publicly
Duplicate contract invocationsSame check, twice
Expected values from the helper under testCircular
Mocks implementing the asserted behaviorTest the mock
Capability tests restating declared flagsCheck config, not delivery
Tests that only preserve test-only exports or wrappersPure scaffolding
Dead production code with only test callersCode exists to be tested
Negative controls passing for unrelated reasonsFalse safety

What tests does the skill tell you to keep?

The retention bar matters as much as the deletion list, because an aggressive pruning agent will delete real guards otherwise. The skill preserves tests that independently enforce public API, plugin SDK, protocol, config, migration, storage, security, platform defaults, generated cross-language code, packages, releases or architecture contracts. It also keeps observable call ordering, tests that fail on baseline (to be investigated as a possible product bug), and source inspection where it is the cheapest independent guard.

One line is worth pinning to a wall: "Static or slow is not a deletion reason."

How do I make an agent actually finish the job?

Steinberger's practical advice from the replies:

  • Give an ambitious, measurable goal. "If you just tell the agent to clean up, it will stop far too early. Give it an ambitious goal. Try 'remove 20% of the least useful tests while maintaining code coverage within 2%.'"
  • Use a stronger model. Asked whether the agent hit the target or stopped early, he said "ever since ~GPT 5.6 the agent no longer stops. 5.5 still needed /goal."
  • Do not worry about skill length. A commenter noted the skill is verbose compared with guidance to keep skills concise. His reply: "It doesn't matter."

The measurable goal doubles as a guardrail. Coverage staying within 2% is the check that the agent deleted redundancy rather than protection.

A copy-paste version for your own repo

Drop this into .agents/skills/test-audit/SKILL.md or adapt it to your agent's skill format, then tighten it to your codebase:

markdown
---
name: test-audit
description: Invoke whenever writing, changing, reviewing, or pruning tests.
---

Before adding or changing a test, answer:
1. What observable behavior does it protect?
2. What credible regression makes it fail?
3. Why doesn't existing coverage catch that?
4. Does it need a production seam no production caller uses?
If any answer is missing, do not add the test.

Reject: assertion-free tests, self-comparisons, expected values
computed by the code under test, mocks that implement the asserted
behavior, string greps of source, tests that break on behavior-
preserving refactors.

Keep: public API, protocol, config, migration, security, release
contracts. Slow or static is not a reason to delete.

And a campaign prompt:

text
Audit the tests under packages/billing. Report candidates with evidence
first, no edits. Then remove the least useful 20% while keeping line
coverage within 2%. Run the smallest owning tests after each batch.
Never edit tests while the test runner is running.

That last sentence comes from the skill: "Never edit source or tests while Vitest is running in the checkout."

What are the limits and risks?

  • Coverage is a weak proxy. Staying within 2% says lines are still executed, not that behavior is still protected. Use it alongside the four-question review, not instead of it.
  • Mutation testing is the stronger check. If you can run it on the touched modules, a jump in surviving mutants means you deleted a real guard.
  • The skill is written for OpenClaw's layout. Paths like extensions/ and commands like scripts/run-vitest.mjs will not exist in your repo.
  • Heavy pruning needs a human sign-off. The skill's own handoff report is designed for review, not blind merge.

What this means for what you build or pay

  • Add the gate at write time. It is cheaper to refuse a test than to delete it later, and most of the skill's value is the four questions.
  • Set a CI-cost baseline. Track minutes per pull request before and after a pruning campaign so the win is measurable.
  • Hold out some tests. Keep verification the coding agent cannot see, as OpenClaw does for release prep.
  • Pair it with skills discipline. See our guide to what agent skills are and how AGENTS.md-style guidance shapes what an agent does by default.

How do you measure whether a pruning campaign worked?

Deleting lines is not the goal. Track four numbers before and after: CI minutes per pull request, flaky-test rate, time to first failing signal on a real regression, and the count of production-only exports or flags that existed just for tests. If CI time drops and the regression-detection time holds steady, the campaign removed cost without removing protection. If detection slows, restore the batch and tighten the retention rule.

Related reading on explainx.ai

  • What are agent skills? A complete guide
  • OpenClaw 2.0 release
  • Top OpenClaw claws and skills
  • Agentic coding is straining CI: how Anthropic scaled test impact analysis
  • Uncle Bob does not review AI code, he builds a gauntlet
  • Claude Code hooks: automate actions on tool calls
  • OpenClaw Foundation nonprofit

Official sources: the test-audit SKILL.md in the OpenClaw repository and Peter Steinberger's thread on X, September 24, 2026.

Figures come from Steinberger's post and the skill file as of September 25, 2026; the skill may change after publication.

Spotted something out of date? Let us know.
Yash Thakker

Written by

Yash Thakker

Yash is an AI expert with over 300K learners. Join his workshops →

View Yash Thakker in People in AI →

Related posts

Sep 25, 2026

How Anthropic Used Claude to Make Claude.ai 3x Faster in Two Weeks

Anthropic published a write-up on how it made claude.ai and the desktop app 3.1x faster on average in two weeks in August 2026, using Claude itself to find and fix bottlenecks. The headline numbers are striking, but the method is the reusable part: measure deterministically, let the agent iterate, and ratchet guardrails daily.

Aug 23, 2026

Microsoft Says Coding Is "Worth It Now More Than Ever" — X Disagreed

Microsoft Learn posted a one-line claim on August 22: coding is worth learning "now more than ever." It hit 328.7K views and a wall of replies calling out Microsoft's own AI shortcomings and an obvious conflict of interest — a company that sells coding certifications telling you to keep learning to code. explainx.ai unpacks what both sides get right, and what the honest 2026 answer actually is.

Aug 22, 2026

Cursor for Product Managers: Can You Build a Real AI Prototype?

Product managers, founders, and marketers can use Cursor to turn a precise brief into a working prototype without pretending the result is production software. This guide covers the build loop, review gates, project ideas, and the parts of a Claude Code-first workflow that transfer directly to Cursor.