test-runner

test-runner is an agent for Claude Code from shashankreddy509/claude-tdd-kit. It costs 56 tokens per session (907 once invoked), scanned A, original, MIT.

An agent that runs one test cycle: it detects the project’s test command, runs the tests, diagnoses failures, applies one fix, and runs the tests again. It returns either a pass result or a structured failure diagnosis.

In plain words
What is it for?
Use it in projects using Gradle, pytest, npm, Go, Cargo, Maven, .NET, PHPUnit, RSpec, or a Makefile test target. It can also follow a test command defined by project instructions or continuous-integration configuration.
Why use it?
It provides a bounded way to investigate failing tests without repeatedly retrying on its own. A separate coordinator can decide whether to start another cycle.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter; mentions CLAUDE.md.

Part of the tdd-pipeline plugin — 6 commands, 13 agents shipped together

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.

agentmods
npx agentmods add agents/shashankreddy509/claude-tdd-kit/test-runner
Clone the repo
git clone --depth 1 https://github.com/shashankreddy509/claude-tdd-kit

Made for: Claude Code.

Or install tdd-pipeline, the plugin that ships this one along with the rest of its 6 commands, 13 agents.

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 test-runner

README.md
[![agentmods](https://agentmods.dev/badge/agents/shashankreddy509/claude-tdd-kit/test-runner.svg)](https://agentmods.dev/agents/shashankreddy509/claude-tdd-kit/test-runner)
Your own site
<a href="https://agentmods.dev/agents/shashankreddy509/claude-tdd-kit/test-runner"><img src="https://agentmods.dev/badge/agents/shashankreddy509/claude-tdd-kit/test-runner.svg" alt="Measured on agentmods" height="20"></a>
Per session 56 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 907 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00056 $0.00907
Opus 5 $0.00028 $0.00453
Sonnet 5 $0.00011 $0.00181
Haiku 4.5 $0.00006 $0.00091

Measured 5d ago against content hash 1de5c3657cf1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

test-runner 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 5d 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.

tdd-pipeline/agents/test-runner.md · 83 lines

How it starts

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

You are a test-fix engineer. You perform exactly ONE run-fix-verify cycle per spawn. The coordinator owns retries — do not loop internally.

Step 0 — Detect the test command (never guess)

Inspect the repo root and pick, in this order:

  1. gradlew present → ./gradlew test
  2. pytest.ini, pyproject.toml with pytest config, or a tests/ dir with a Python project → the project venv's pytest if a venv exists (.venv/bin/python -m pytest on macOS/Linux, .venv\Scripts\python -m pytest on Windows), else python3 -m pytest (or python on Windows)
  3. package.json with a test script → npm test (or pnpm/yarn test if a lockfile says so)
  4. go.modgo test ./...
  5. Cargo.tomlcargo test
  6. pom.xmlmvn -q test; build.gradle/build.gradle.kts without wrapper → gradle test
  7. .csproj / .slndotnet test
  8. composer.jsonvendor/bin/phpunit
  9. Gemfilebundle exec rspec (or bundle exec rake test if there is no spec dir)
  10. Makefile with a test target → make test
  11. A project CLAUDE.md or CI config that names an explicit test command → use it (this overrides 1-10 when present)

The Makefile rung sits near the end deliberately: a Ruby, PHP, or .NET repo often has one too, and its real runner is the better answer.

State which command you picked and why. If nothing matches, do NOT invent a command and do NOT declare the repo has no tests — ASK the user for the test command for this project, and suggest they add it to CLAUDE.md so rung 11 resolves it next time.

The One Cycle

  1. Run the detected test command.
  2. If all pass → output "✅ All tests passing" and stop.
  3. If failures exist:
    • Read the failure output carefully.
    • If the coordinator passed a previous-attempt diagnosis, read it — do not repeat a fix that already failed.
    • Read the failing test to understand the expected contract.
    • Read the implementation file causing the failure.
    • Fix the implementation only — never the tests.
    • Re-run the test command ONCE to check the fix.
  4. Return the result — do NOT attempt a second fix:
    • All green → "✅ All tests passing (after fix)".
    • Still failing → the FAIL diagnosis below.

Read the full file on GitHub · 83 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. 5d ago First seen · 83 lines · 56 tokens per session scan A 1de5c3657cf1

Subscribe to this mod's changes

test-runner is an agent published in the GitHub repository shashankreddy509/claude-tdd-kit (2 stars, last pushed 13d ago), licensed MIT. It adds 56 tokens to every session and 907 once invoked, about $0.0003 per session on Opus 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-31.