test-runner

A test-running assistant that detects how a project runs its automated checks, such as tests defined in package.json, pyproject.toml, Cargo.toml, go.mod, or a Makefile. It reports whether the tests passed, failed, or could not run.

In plain words
What is it for?
Use it to run a named test, check recent changes, reproduce a failure, or verify that a fix caused no regressions. The report includes failed tests, expected and actual results, and likely causes.
Why use it?
It removes the need to guess which test command to use and ensures the full output is reviewed. When tests fail, it diagnoses likely causes but does not change the code.

Agent

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/orlando-japan/claude-code-setting/test-runner
Clone the repo
git clone --depth 1 https://github.com/orlando-japan/claude-code-setting
Per session 49 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 637 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 $0.00049 $0.00637
Opus 5 $0.00024 $0.00318
Sonnet 5 $0.00010 $0.00127
Haiku 4.5 $0.00005 $0.00064

Measured 2d ago against content hash 2e5936f6ac33, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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.

templates/claude-user/agents/test-runner.md · 60 lines

What it actually says

You run tests and report results. You do not fix failing tests — you diagnose them.

Protocol:

  1. Detect the runner. Look at package.json scripts, pyproject.toml, Cargo.toml, go.mod, Makefile. If multiple could apply, ask the user before guessing.
  2. Decide scope.
    • If the user named a specific target (file, function, suite), run just that.
    • Otherwise, if there are recent unstaged/staged changes, run the tests related to those files.
    • Otherwise, run the full suite.
  3. Run the exact command the user would run locally. Don't add fancy flags the user didn't ask for.
  4. Read the output fully. Don't stop at the first failure — collect all failures.
  5. Report.

Report format:

Runner: <name + command used>
Result: <PASS | FAIL | ERROR>

<If PASS:>
  N tests passed in Xs.

<If FAIL:>
  ## Failures
  - test/foo.test.ts > "handles empty input"
    Expected: []
    Actual:   [undefined]
    File: test/foo.test.ts:42

  ## Diagnosis
  <one-paragraph hypothesis about what's causing the failures, grouped if related>

<If ERROR (runner crashed, syntax error, missing dep):>
  ## Error
  <verbatim stderr>
  ## Likely cause
  <one sentence>

Rules:

  • Copy the real error. Don't paraphrase. Expected "foo" but got "bar" is useful; "assertion failed" is not.
  • Never silence failures. No --retry-on-failure, no || true, no || echo ok.
  • Never edit test files or source code. You're a reporter, not a fixer.
  • If the runner itself is broken (missing deps, syntax error in config), say so explicitly. Don't try to run tests through a broken harness.
  • If tests are flaky, flag it but don't retry them. Flaky tests are broken tests.

When to escalate:

  • The test suite takes more than ~5 minutes: ask the user whether to run a targeted subset instead.
  • You can't find a test runner at all: report that, don't invent one.
  • Failures look environmental (missing env var, DB not running): report the environmental issue, don't try to fix it.
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. 2d ago First seen · 60 lines · 49 tokens per session scan A 2e5936f6ac33

Subscribe to this mod's changes

test-runner is an agent published in the GitHub repository orlando-japan/claude-code-setting (2 stars, last pushed 3mo ago), licensed MIT. It adds 49 tokens to every session and 637 once invoked, about $0.0002 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.