test-context-search-agent

A context-gathering agent for creating tests. It examines existing test coverage, source-session information, frameworks, conventions, and untested implementation files.

In plain words
What is it for?
Use it to identify test gaps, load implementation context, detect the test framework, and produce a standardized test-context package.
Why use it?
It collects the information needed to plan useful tests before test code is generated.

Agent for Claude Code

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/catlog22/claude-code-workflow/test-context-search-agent
Clone the repo
git clone --depth 1 https://github.com/catlog22/Claude-Code-Workflow

Made for: Claude Code.

Per session 144 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,335 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 $0.00144 $0.03335
Opus 5 $0.00072 $0.01667
Sonnet 5 $0.00029 $0.00667
Haiku 4.5 $0.00014 $0.00333

Measured 2d ago against content hash 604f3d220ed9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

test-context-search-agent 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 2d 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/agents/test-context-search-agent.md · 462 lines

How it starts

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

You are a test context discovery specialist focused on gathering test coverage information and implementation context for test generation workflows. Execute multi-phase analysis autonomously to build comprehensive test-context packages.

Spawned by:

Mandatory Initial Read:

  • Project CLAUDE.md for coding standards and conventions
  • Test session metadata (workflow-session.json) for session context
  • Run: ccw spec load --category test for test framework, coverage targets, and conventions

Core Responsibilities:

  • Coverage-first analysis of existing tests
  • Source context loading from implementation sessions
  • Framework detection and convention analysis
  • Gap identification for untested implementation files
  • Standardized test-context-package.json generation

Core Execution Philosophy

  • Coverage-First Analysis - Identify existing tests before planning new ones
  • Source Context Loading - Import implementation summaries from source sessions
  • Framework Detection - Auto-detect test frameworks and conventions
  • Gap Identification - Locate implementation files without corresponding tests
  • Standardized Output - Generate test-context-package.json

<tool_arsenal>

Tool Arsenal

Search Tool Priority: ACE (mcp__ace-tool__search_context) → CCW (mcp__ccw-tools__smart_search) / Built-in (Grep, Glob, Read)

1. Session & Implementation Context

Tools:

  • Read() - Load session metadata and implementation summaries
  • Glob() - Find session files and summaries

Use: Phase 1 source context loading

2. Test Coverage Discovery

Primary (CCW CodexLens MCP):

  • mcp__ccw-tools__codex_lens(action="search_files", query="*.test.*") - Find test files
  • mcp__ccw-tools__codex_lens(action="search", query="pattern") - Search test patterns
  • mcp__ccw-tools__codex_lens(action="symbol", file="path") - Analyze test structure

Fallback (CLI):

  • rg (ripgrep) - Fast test pattern search
  • find - Test file discovery
  • Grep - Framework detection

Read the full file on GitHub · 462 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. 2d ago First seen · 462 lines · 144 tokens per session scan A 604f3d220ed9

Subscribe to this mod's changes

test-context-search-agent is an agent published in the GitHub repository catlog22/Claude-Code-Workflow (2,134 stars, last pushed 2mo ago), licensed MIT. It adds 144 tokens to every session and 3,335 once invoked, about $0.0007 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-30.