Skip to main content
subagent

test-runner — Claude Code subagent: what it does, how to install

Runs project test suites, isolates failure causes, and suggests fixes. The agent never modifies code directly, returning a diagnostic report instead.

Install into Claude Code · claude-code-templates All methods and platforms ↓
npx claude-code-templates@latest --agent development-team/test-runner
Open on GitHub

What test-runner does

The agent detects test frameworks across your project, handling tools like Jest or Pytest. It runs checks through shell commands. Exit codes serve as ground truth. When tests break, the subagent traces stack traces against the source code. This pinpoints whether the issue comes from application logic or environment mismatches.

By design, the agent lacks Write and Edit tools. Because of this restriction, it cannot touch project files or weaken test assertions to force a green run. Flaky tests receive special treatment. The subagent reruns them in isolation two or three times to catch intermittent timing issues. You get exact line references and actionable code fixes ready to apply.

What it helps with

  • pinpoint the root cause of failing local or CI test runs
  • verify intermittent test failures through repeated isolated runs
  • generate concrete patch proposals without risking deleted assertions
  • distinguish real logic regressions from faulty mocks or environment issues

Example prompts for the agent

  • Run the test suite and diagnose why test_payment_retry failed
  • Check if the new checkout logic broke any tests and pinpoint the causes
  • Investigate the CI failure log and test whether that failure is flaky

How to install test-runner

1claude-code-templates

npx claude-code-templates@latest --agent development-team/test-runner

2Manually: put the files in place

.claude/agents/test-runner.md

For all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention

Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean

Questions about test-runner

How to install test-runner in Claude Code?

Execute npx claude-code-templates@latest --agent development-team/test-runner or place the agent definition directly in .claude/agents/test-runner.md.

What does the test-runner subagent do?

It identifies your test setup, executes test commands, and analyzes failures. The output provides a clear diagnosis with specific code fixes for each broken assertion.

Why doesn't test-runner edit the code directly?

The agent has no Write or Edit tools in its environment. This guardrail prevents it from modifying source files or weakening assertions just to force tests to pass.

Similar subagents

All subagents for Testing and QA →

From the same set495

The whole set →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor