Agents & Subagents
Delegating part of a task to a separate Claude Code session, on purpose.
Intermediate
| Type | Model | Tools | For |
|---|---|---|---|
| Explore | inherits from main session (capped at Opus) | read-only | fast codebase search — file/symbol discovery, not analysis |
| Plan | inherits from main session | read-only | research during plan mode, kept out of the main (still read-only) context |
| general-purpose | inherits from main session | everything a subagent can access | complex, multi-step tasks needing both research and changes |
| statusline-setup | Sonnet | restricted | invoked automatically by /statusline |
| claude-code-guide | Haiku | restricted | invoked automatically for questions about Claude Code itself |
---
name: code-improver
description: Scans files and suggests improvements for readability, performance,
and best practices. Use after writing or modifying code.
tools: Read, Grep, Glob
model: sonnet
---
You are a code improvement specialist. For each issue you find, explain
the problem, show the current code, and provide an improved version.
| Location | Scope |
|---|---|
.claude/agents/ | this project only — commit it so the team shares the same subagent |
~/.claude/agents/ | every project on your machine |
| Situation | Why delegate |
|---|---|
| Broad, open-ended search ("where is X handled in this codebase?") | keeps dozens of speculative file reads out of your main context, which stays reserved for the actual work |
| Independent, parallelizable subtasks | several agents can run at once instead of serially |
| A long-running background task | you keep working while it runs, instead of blocking on it |
| A quick, narrow lookup with a known target | don't delegate — a direct file read or targeted search is faster and cheaper than spinning up an agent |