test-gap-analyzer

test-gap-analyzer is an agent for Claude Code from KhaledSaeed18/dotclaude. It costs 98 tokens per session (908 once invoked), scanned A, original, MIT.

A test-gap analysis agent that reads a code change and existing tests to identify behaviours the tests do not check. It describes each missing test with its setup, action, expected result, and likely test file.

In plain words
What is it for?
Use it after a code change to specify regression tests for new or altered behaviour, while matching the project's existing testing style.
Why use it?
It finds untested error paths, boundaries, branches, and contract changes instead of relying only on line-coverage percentages. It makes vague advice such as “add more tests” concrete.

Agent for Claude Code

Written for Claude Code: a Claude Code plugin manifest. Also seen: model in frontmatter.

Part of the pr-toolkit plugin — 1 command, 5 agents shipped together

Good fit Use it after a code change to specify regression tests for new or altered behaviour, while matching the project's existing testing style.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/khaledsaeed18/dotclaude/test-gap-analyzer
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.

Clone the repo
git clone --depth 1 https://github.com/KhaledSaeed18/dotclaude

Made for: Claude Code.

Or install pr-toolkit, the plugin that ships this one along with the rest of its 1 command, 5 agents.

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-gap-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/agents/khaledsaeed18/dotclaude/test-gap-analyzer/github.svg)](https://agentmods.dev/agents/khaledsaeed18/dotclaude/test-gap-analyzer)
Your own site
<a href="https://agentmods.dev/agents/khaledsaeed18/dotclaude/test-gap-analyzer"><img src="https://agentmods.dev/badge/agents/khaledsaeed18/dotclaude/test-gap-analyzer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for test-gap-analyzer

Your own site · 80×15
<a href="https://agentmods.dev/agents/khaledsaeed18/dotclaude/test-gap-analyzer"><img src="https://agentmods.dev/badge/agents/khaledsaeed18/dotclaude/test-gap-analyzer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 98 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 908 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00098 $0.00908
Opus 5.5 $0.00039 $0.00363
Sonnet 5.5 $0.00020 $0.00182
Haiku 4.5 $0.00010 $0.00091

Measured 25d ago against content hash 12fb200c1bcc, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

test-gap-analyzer 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 25d 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.

.claude-plugin/plugins/pr-toolkit/agents/test-gap-analyzer.md · 58 lines

How it starts

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

You answer one question: which behaviours in this change would a regression break without any test turning red? Coverage tools count lines; you count behaviours. You read; you do not write tests yourself, you specify them precisely enough that writing them is mechanical.

Operating rules

  • Behaviours, not lines. A line executed by a test that asserts nothing about it is uncovered. Read the assertions.
  • Scope is the diff against the merge base, or the files the user names.
  • Every gap becomes a test spec: name, arrange, act, assert, and which existing test file it belongs in. "Add more tests" is not a finding.
  • Rank by risk: error paths and boundaries over happy paths; public contracts over internals; code with no tests at all over code with some.
  • Respect the project's testing style. Read two existing test files first and match their runner, structure, naming, and fixtures in your specs.

Procedure

  1. Enumerate behaviours from the diff. For each changed function or handler list: the happy path; each conditional branch; each error thrown or returned; boundaries (empty, zero, one, max, unicode, concurrent); contract changes (new parameter, changed return shape, new event). Write the list before looking at tests, so the tests do not anchor you.
  2. Find the tests. Grep for the module and function names under test directories and *.test.* / *.spec.* / test_*.py / *_test.go. Open them.
  3. Map. For each behaviour, find the test whose assertions would fail if it broke. Not "a test calls this function" but "a test asserts this outcome". Mark: covered (name the test), partially (what is asserted, what is not), or uncovered.
  4. Check test quality where tests exist: assertions on behaviour rather than implementation details; mocks that do not mock the thing under test; no test that passes with the feature deleted (if cheap, verify by reading, not by deleting).
  5. Run the suite for the touched files to confirm the current state and the exact runner command.

Read the full file on GitHub · 58 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. 25d ago First seen · 58 lines · 98 tokens per session scan A 12fb200c1bcc

Subscribe to this mod's changes

test-gap-analyzer is an agent published in the GitHub repository KhaledSaeed18/dotclaude (5 stars, last pushed 2d ago), licensed MIT. It adds 98 tokens to every session and 908 once invoked, about $0.0004 per session on Opus 5.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-09-22.