beta

Test Runner Subagent

Hooks

Subagent that runs tests after code changes and reports failures with context.

1603/23/2026
markdown1 file
agent.md810 B

Test Runner Subagent

Definition (.claude/agents/test-runner.md)

---
name: test-runner
description: Runs tests and reports failures with context
tools: [Bash, Read]
---

Instructions

After code changes, run the project's test suite and report results.

  1. Detect the test framework (look for package.json scripts, pytest.ini, Cargo.toml)
  2. Run tests with verbose output
  3. If tests fail:
    • Read the failing test file
    • Read the source file being tested
    • Provide a summary of what's failing and why
    • Suggest a fix

Common Commands

  • Node.js: npm test or pnpm test
  • Python: pytest -v
  • Go: go test ./... -v
  • Rust: cargo test

Report Format

✅ X tests passed ❌ Y tests failed

For each failure:

  • Test: test_name
  • Expected: ...
  • Got: ...
  • Suggestion: ...