A← Index

t

Run only the tests that cover a change.

RoleSolo: design & build
TypeDeveloper tool · agent workflow
StackRust · pytest · cargo · go · vitest
SourceOpen source (MIT)

IWhy I built it

I looked at how my coding agents spent their time. A large share went to test runs that were far wider than the change: a whole test folder, bare pytest, cargo test over a workspace. On a voice-agent monorepo one such run took many minutes, and agents ran it after small edits.

An agent rarely knows which tests cover a file, so it runs everything to be safe. Research on agent test use points the same way: telling the agent which tests cover its change cut regressions far more than telling it to write tests first. t gives the agent that list and runs it.

IIHow it picks tests

t tests for the files changed against the base branch t <file> a test file runs as is; a source file runs its tests t --for <file> list the covering tests and why; run nothing t --max N run up to N test files (default 5)
Python
Tests that import the module, then tests of the modules that import it. It runs through uv run pytest when the repo has uv.lock.
Rust
The crate and module path, with #[path] and _tests.rs siblings. It runs cargo test -p <crate> with a filter.
Go and TypeScript
Go runs the same package. TypeScript finds colocated and importing tests and the runner from the nearest package.json: vitest, jest or playwright.
Data files
A changed golden table or fixture runs the tests that name it. A changed test file always runs.

An empty result is not a pass. When no test covers the change, t says so and exits with code 4. An agent cannot read "nothing ran" as green.

It explains failures that are not bugs. After a failed run it names a missing Python package, missing node_modules, a refused port, or an .env file that a worktree lacks. Agents used to spend turns on these.

IIIDoes it pick the right test?

I replayed past agent sessions. For each commit that touched a test, I asked whether t, given only the changed source files, would select that test.

100%deck · in the 5 it runs
74%bare · in the 5 it runs
59%voice monorepo · in the 5
94%voice monorepo · in its full list

In the large monorepo the right test is almost always in the list, but often not in the top 5. Ranking by changed symbols is the next step. Full suites still run, in CI or on request. A command hook blocks broad local runs; on the replayed sessions it would have stopped about 16 of 135 hours of test runs.

SignedArjun