Steering AI agents with ambitious metrics for test suite pruning

X postPeter SteinbergerOpinion

Peter Steinberger advises against giving AI agents generic cleanup instructions, as they terminate tasks prematurely. Instead, developers should assign ambitious, measurable targets, such as removing 20 percent of the least useful tests while keeping code coverage within two percent.

Key points

  1. Generic cleanup prompts cause AI coding agents to halt work far too early.
  2. Ambitious, quantified targets compel the agent to perform deeper iterations.
  3. An example metric: prune 20% of the least useful tests while keeping coverage within 2%.
  4. Commands like /goal can run autonomously over extended periods to execute these goals.

Why it matters

Bloated test suites hinder CI/CD performance and increase maintenance friction. Using AI agents for test pruning requires strict, quantifiable guardrails rather than open-ended directives.

Analysis

Steinberger highlights an important operational pattern in agentic workflows: autonomous agents require quantitative constraints to avoid early stopping. While open-ended refactoring requests quickly satisfy loose stopping criteria, explicit mathematical trade-offs force continuous evaluation cycles. However, commenters rightly noted that relying purely on code coverage as a boundary condition carries risks, as removing redundant-looking tests may inadvertently sacrifice edge-case coverage without impacting overall percentage metrics.

Original post

Peter Steinberger 🦞

@steipete · 24 September 2026

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%"

593 likes16 replies515 bookmarks102.7k views

View on X
More posts in the thread (3)
  1. @PavelVanchugov Google rejected the update and it’s stalling. Working on it.
  2. @bvirlet It’s not meant for humans.
  3. That /goal is still running.
Selected replies (5)
  • @ZainanZhou @steipete Bill Gates has a great analogy: "Measuring programming progress by lines of code is like measuring aircraft building progress by weight." Reducing the lines of code in testing is like reducing the weight of ... the hangar. Yeah maybe it's helpful but also doesn't makes sense to
  • @akshaymarch7 @steipete A useful follow-up would be to reintroduce a few previously fixed bugs and check whether the smaller suite still catches them. That would give me more confidence in the cleanup than the coverage number alone.
  • @gauravdhiman_ai @steipete How can you trust them now, that what they did is right .. when you earlier trusted them assuming what they did was right 😄 You are just driving the car blindly without knowing when it's going to get into an accident.
  • @ChristianLempa @steipete @NousResearch did it first 😜
  • @CycleOrpington @steipete All tests are useful t.co/wNjKWr7Eci

Links and tools from this entry

Summary generated by AI (Gemini 3.8 Flash, 30 September 2026). It may contain errors – the original source is authoritative.

Similar in content, found by the AI search.

  • X post:Peter Steinberger

    OpenClaw Deletes 400k Lines of Tests Using Dedicated Agent Skill

    Peter Steinberger reported that OpenClaw pruned around 400,000 lines of its own test code with minimal impact on code coverage. The cleanup was driven by an agent skill called 'test-audit', which targets low-value, redundant, or implementation-coupled tests.

    10.8kbookmarks1.3mviews

    AI & LLMs· News

  • Article:Nate

    Agent Maintenance: Why Pruning AI Systems Matters More Than Building Them

    Nate argues that maintaining AI agents will soon be a more critical skill than creating them. Agents continue to generate output long after becoming inaccurate. Citing Vercel's decision to delete 80% of its sales agent's tools to improve results, he outlines how stripping away bloat and maintaining structural harnesses keeps systems reliable.

    AI & LLMs· Opinion

  • Repository:GonChen/real-engineering-prompt

    Real Engineering Prompt: Minimal Behavioural Directives for Coding Agents

    This open-source project offers a concise instruction template (AGENTS.md) designed to bind modern coding agents to core engineering practices like minimal complexity, scoped modifications, and evidence-backed verification.

    4stars

    AI & LLMs· Resource

  • X post:Royce Chen

    Four Lessons from 5 Billion Daily Tokens: Steve Yegge's AI Workflow

    Tech veteran Steve Yegge ran 22 Claude Max accounts, consuming 5 billion tokens daily to clear long-standing development backlogs. Royce Chen outlines four practical insights drawn from Yegge's intensive agent experimentation. The findings guide engineers on context management, framework design, and agent prompting.

    2.9kbookmarks152.5kviews

    AI & LLMs· Opinion

  • X post:Tech with Mak

    Ponytail: Prompting AI Coding Agents to Write Less Code

    Ponytail is an open-source tool designed to teach AI coding agents to reuse existing code, standard libraries, and dependencies instead of writing new code from scratch. According to Tech with Mak, the tool reduces generated code by an average of 54 percent.

    1.9kbookmarks149.3kviews

    AI & LLMs· Tool

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.