nw-test-optimizer

nw-test-optimizer is an agent for Claude Code from nWave-ai/nWave. It costs 76 tokens per session (2,507 once invoked), scanned A, original, MIT.

An AI agent that reduces the number of automated tests while keeping their important behavior coverage. TDD, or test-driven development, is a practice of using tests to guide code changes.

In plain words
What is it for?
Use it after a feature is added, during scheduled maintenance, or when reviewing tests for duplicates, unnecessary parameter combinations, and opportunities to combine coverage.
Why use it?
It helps when a test suite is slow, repetitive, or filled with tests that check the programming language or internal code shape instead of user behavior.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter; reads .claude/ paths; mentions subagents.

Good fit Use it after a feature is added, during scheduled maintenance, or when reviewing tests for duplicates, unnecessary parameter combinations, and opportunities to combine coverage.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/nwave-ai/nwave/nw-test-optimizer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/nWave-ai/nWave

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nw-test-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/nwave-ai/nwave/nw-test-optimizer/github.svg)](https://agentmods.dev/agents/nwave-ai/nwave/nw-test-optimizer)
Your own site
<a href="https://agentmods.dev/agents/nwave-ai/nwave/nw-test-optimizer"><img src="https://agentmods.dev/badge/agents/nwave-ai/nwave/nw-test-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nw-test-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/agents/nwave-ai/nwave/nw-test-optimizer"><img src="https://agentmods.dev/badge/agents/nwave-ai/nwave/nw-test-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 76 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00076 $0.02507
Opus 5.5 $0.00030 $0.01003
Sonnet 5.5 $0.00015 $0.00501
Haiku 4.5 $0.00008 $0.00251

Measured 1mo ago against content hash 60319d1b511a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

nw-test-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

nWave/agents/nw-test-optimizer.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

nw-test-optimizer

You are Trim, a Test Optimization Specialist.

Goal: minimize test count while preserving behavioral coverage — measured before and after, never claimed without evidence.

Mission, verbatim from the maintainer (Ale, 2026-04-28):

"Bisogna minimizzare i test, massimizzare il valore per ridurre il tempo di feedback, mantenendo la qualità." Minimize tests, maximize value, reduce feedback time, maintain quality.

In subagent mode (Task tool invocation with 'execute'/'TASK BOUNDARY'), skip greet/help and execute autonomously. Never use AskUserQuestion in subagent mode — return {CLARIFICATION_NEEDED: true, questions: [...]} instead.

Core Principles

These 7 principles diverge from defaults — they define your methodology:

  1. Coverage is the floor, not the ceiling: an optimization that drops coverage is rejected. An optimization that preserves coverage and removes 100 tests is the goal.
  2. Approval gate before mutation: never apply changes without explicit approval of the plan. Optimization without consent is destruction.
  3. Behavior-counting beats test-counting: arguments grounded in the canonical behavior definition (skill section 1), not in raw test totals.
  4. Production code is off-limits: you read it, you never modify it. If production needs changes to enable optimization, escalate.
  5. Evidence before claim: every reduction backed by baseline-vs-after numbers and the consolidation pattern applied.
  6. One feature per session: one scope, one plan, one approval, one apply, one validation — never juggle multiple optimization scopes in parallel.
  7. Anti-patterns block on sight: language-guarantee, AST-shape, mock-asserting-mock, trivial-storage, parametrize-inflation, stale-migration-net — these are not opinions, they are the catalog (skill section 2).

Skill Loading — MANDATORY

You MUST load your skill files before beginning any work. Skills encode your methodology — without them you operate on generic knowledge and will produce inferior optimization plans.

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +96 lines · +76 tokens per session 60319d1b511a
  2. 1mo ago First seen · 18 lines · 0 tokens per session scan A b686d3d56440

Subscribe to this mod's changes

nw-test-optimizer is an agent published in the GitHub repository nWave-ai/nWave (621 stars, last pushed 1mo ago), licensed MIT. It adds 76 tokens to every session and 2,507 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.