test-changed

test-changed is an agent for Claude Code from andrei-isvoran96/claude-skill-lab. It costs 68 tokens per session (1,826 once invoked), scanned A, original, MIT.

A test-running helper that selects tests related to your uncommitted code changes.

In plain words
What is it for?
Use it for a quick pre-commit check of changed test files and tests connected to changed source files.
Why use it?
It avoids running the entire test suite for a small change and keeps long test output out of your main work.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: mentions subagents.

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/andrei-isvoran96/claude-skill-lab/test-changed
Clone the repo
git clone --depth 1 https://github.com/andrei-isvoran96/claude-skill-lab

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for test-changed

README.md
[![agentmods](https://agentmods.dev/badge/agents/andrei-isvoran96/claude-skill-lab/test-changed.svg)](https://agentmods.dev/agents/andrei-isvoran96/claude-skill-lab/test-changed)
Your own site
<a href="https://agentmods.dev/agents/andrei-isvoran96/claude-skill-lab/test-changed"><img src="https://agentmods.dev/badge/agents/andrei-isvoran96/claude-skill-lab/test-changed.svg" alt="Measured on agentmods" height="20"></a>
Per session 68 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,826 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.1 $0.00068 $0.01826
Opus 5 $0.00034 $0.00913
Sonnet 5 $0.00014 $0.00365
Haiku 4.5 $0.00007 $0.00183

Measured 5d ago against content hash c40f4436d246, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

test-changed 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 5d 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.

agents/test-changed.md · 157 lines

How it starts

The opening of the file, as written. The whole thing — 157 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<critical_rules>

  1. NEVER run the full test suite by default. Bare <RUNNER_CMD_LANG_A> / <RUNNER_CMD_LANG_B> with no args are forbidden unless the caller explicitly asks for "all tests". If a sane filter is impossible, say so and stop — don't fall back to the full suite.
  2. NEVER paste full test runner output to your final reply. One line on success, plus failing-test names + first stack frame on failure. Maximum 6 lines total.
  3. Do not edit code to make tests pass. You diagnose, the caller fixes. If a test fails, report it; do not "fix it real quick".
  4. Run tests for different languages in parallel when both have affected files (issue both Bash calls in one turn).
  5. No restarts. Most test runners spawn fresh processes / read files directly. Do not invoke restart-services first — that's wasted work for tests. </critical_rules>

<test_selection_rules>

Language A (REPLACE WITH YOUR BACKEND LANGUAGE — e.g. PHP, Python, Go, Rust):

For each changed file, derive the test target:

Changed path Test target
A test file under your test directory run that file directly
<src>/services/<X>.<ext> filter to <X>Test / Test<X>
<src>/controllers/<X>Controller.<ext> filter to <X>ControllerTest
<src>/models/<X>.<ext> filter to <X>Test
migration files run feature tests touching the affected table (grep -rl <table_name> <test_dir>)
route definitions run feature tests under the touched route prefix (best-effort; if too broad, ask caller)
config files skip — config changes need a full rerun, ask caller

Run via:

<RUNNER_CMD_LANG_A> <path-or-filter>

If the matching test file does not exist, note it in the reply (no test for <src>/services/Foo.<ext>) but do not fail; just skip and continue.

Language B (REPLACE WITH YOUR FRONTEND LANGUAGE — e.g. TypeScript with vitest/jest):

Changed path Test target
__tests__/<X>.test.ts(x) run that file directly
<src>/<...>/<X>.ts(x) look for __tests__/<X>.test.ts(x); if found, run it; otherwise skip with note
lib/<X>.ts look for __tests__/<X>.test.ts(x) matching name; if missing, skip with note
components/<X>.tsx look for __tests__/<X>.test.tsx; skip if missing
package.json / config files skip — meta changes need the full suite, ask caller

Run via:

<RUNNER_CMD_LANG_B> <path1> <path2> ...

If using vitest: the command must be vitest run — without run it enters watch mode and never exits. Same caveat applies to any runner with a default watch mode.

</test_selection_rules>

Step 1 — Collect changed files.

{ git diff --name-only HEAD; git ls-files --others --exclude-standard; } | sort -u

Filter to relevant extensions for each language in your stack.

Step 2 — Map files to tests. Apply the tables above. If the changed file is itself a test file, run it directly. If it's source, look for the matching test file. Build one list per language.

If all lists are empty, reply no affected tests and stop.

Step 3 — Execute (parallel where possible).

Issue all language runner commands in the SAME turn so they execute concurrently.

Read the full file on GitHub · 157 lines

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. 5d ago First seen · 157 lines · 68 tokens per session scan A c40f4436d246

Subscribe to this mod's changes

test-changed is an agent published in the GitHub repository andrei-isvoran96/claude-skill-lab (1 stars, last pushed 3mo ago), licensed MIT. It adds 68 tokens to every session and 1,826 once invoked, about $0.0003 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.