Skip to content
AgentQuadrant

Last verified

T

Test Runner Plugin

Listed

Run tests, see failures, and get fix suggestions without leaving Claude Code

Developer Tools

Add marketplace

/plugin marketplace add anthropics/claude-plugins-official

Commands

  • /test
  • /test-watch

Hooks

  • post-file-write
"Test results inline before I context-switch to the browser: a small change with outsized impact."

What is the Test Runner Plugin?

The Test Runner Plugin is an official Claude Code plugin that runs your project’s test suite and shows failures with diagnostic context in the terminal. It auto-detects major test frameworks and adds two commands to the developer tools workflow: /test for a single run and /test-watch for continuous feedback.

How does it work?

On first run, the plugin inspects the project root for test framework markers (jest.config.js, pyproject.toml, Cargo.toml, and others) and infers the correct test command. It runs the suite as a subprocess, captures stdout and stderr, and parses failures into structured test-name and error-message pairs. Claude then analyzes the failures and suggests fixes.

For a complete pre-commit workflow, combine the Test Runner plugin with the Code Review plugin: review the diff for issues, run tests to confirm correctness, then commit.

When should you use it?

Use the Test Runner plugin during active development when you want feedback after each edit without switching to a separate terminal. The /test-watch mode is especially useful for test-driven development sessions where each implementation step should keep the suite green before you move on.

Frequently asked questions

Which test frameworks does the Test Runner plugin support?

It auto-detects Jest, Vitest, pytest, Go test, Cargo test, and RSpec by inspecting the project's config files and package.json. For unsupported frameworks, set the test command in `.claude/test-runner-config.json` and the plugin will use that command verbatim.

What does /test-watch do differently from /test?

`/test` runs the full suite once and shows results. `/test-watch` keeps a file-watcher running in the background; when Claude writes or edits a file, the post-file-write hook triggers an incremental test run and surfaces any new failures immediately.

Can the Test Runner plugin generate missing tests for new functions?

Yes. Pass `--generate` to `/test` and the plugin identifies functions with no test coverage, writes stub tests to the appropriate test file, and re-runs the suite. The stubs follow the existing test style in the project.

Recently verified