Create a Read-Only Claude Code Subagent for Test Review
A custom subagent has its own instructions and tool list. A focused test reviewer can point out untested behavior in a component while you keep control of edits and test execution.
Worked example
Repository-scoped component test reviewer
--- name: component-test-review description: Review test coverage for one named UI component. tools: Read, Grep, Glob --- Read the named component and its test file. List up to three behaviors the current tests do not exercise, citing each file. Do not claim tests ran. Return observations only.
Steps
- Save the example as .claude/agents/component-test-review.md in a practice repository. Start a new Claude Code session if the project subagent does not appear immediately.
- Invoke the component-test-review subagent and name one component and its test file. Ask it to point to the source of each missing behavior.
- Inspect the report and confirm each cited path exists. Review your worktree to verify that the subagent did not edit files.
What to check
- Use a component with one deliberately missing conditional case to check whether the report names that behavior. Verify the agent is using this definition rather than a similarly named user agent.
- This reviewer can inspect tests but cannot execute them. Run the real test suite separately before treating a change as verified.