AI coding agents
Coding agents run the tests after almost every change, and a full dotnet test is the slowest part of their loop. With TestDetta they run only the tests a change can affect, and check them before they hand back.
Every agent needs the td tool on the machine where it works:
dotnet tool install --global TestDetta
TestDetta decides on the developer's machine as it does in CI: with a coverage map recorded by td record it follows which test class ran which method, and without one it traces names through the source, which selects more but stays safe.
Claude Code
The TestDetta plugin adds a skill and a Stop hook. Install it from Claude Code (version 2.1.275 or later) in one step:
/plugin install testdetta --marketplace selcukgural/TestDetta
On earlier versions, add the marketplace first:
/plugin marketplace add selcukgural/TestDetta
/plugin install testdetta@testdetta
- The skill tells the agent to run
td testwhere it would rundotnet test, to readtd affectedto find the tests that cover the code it is about to change, and to suggesttd recordto you instead of starting that long run itself. - The Stop hook runs the affected tests when the agent finishes a turn with a changed working tree. A failing test or a broken build sends the agent back with a short excerpt (each failure's message, each compiler error once) and the path of the full log. Passing tests show you one line. A turn that changed no code costs a few milliseconds, and the agent is sent back at most three times in a turn.
To offer the plugin to everyone who opens a repository, add the marketplace and the plugin to the repository's .claude/settings.json (extraKnownMarketplaces and enabledPlugins). The hook's settings are environment variables:
| Variable | Effect |
|---|---|
TESTDETTA_AGENT_HOOK=off | Turns the Stop hook off; the skill stays. |
TESTDETTA_AGENT_BASE=<ref> | Compares with this ref instead of origin/main. |
TESTDETTA_AGENT_MAX_BLOCKS=<n> | How often one turn may be sent back for failing tests (default 3). |
The hook is a bash script. It is tested on macOS and Linux, not yet on Windows.
Codex and other agents
The skill follows the open Agent Skills format, so agents that read SKILL.md folders can use it; the Stop hook is Claude Code's own. For Codex, copy dist/claude-plugin/skills/testdetta from the source repository into ~/.codex/skills/testdetta (or $CODEX_HOME/skills) and restart Codex.
What the agent sends
Nothing. td makes no network calls of its own, and the plugin only runs td and git on your machine. What your agent sends to its own provider is between you and that provider.