Agents are autonomous sub-processes that Claude spawns to handle complex or parallelizable tasks. When Claude encounters a problem that benefits from delegation — a broad codebase search, an independent verification pass, or a multi-step workflow — it spawns an agent, provides a task description, and receives a summary when the work is done. Each agent runs with its own context window, tool budget, and (optionally) its own model. The spawning Claude sees only the agent’s final summary, not the intermediate tool calls — which keeps the main conversation focused.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/VineeTagarwal-code/claude-code/llms.txt
Use this file to discover all available pages before exploring further.
How agents work
Claude spawns agents using the Agent tool. A minimal spawn looks like:Parallel agents
Claude can launch multiple agents in a single message to work concurrently:Background agents
Agents can run in the background while Claude keeps the conversation responsive:Isolated agents (worktrees)
You can run an agent in an isolated git worktree so its file changes don’t affect your working tree:Built-in agents
Claude Code ships with several built-in agent types.general-purpose
The default agent type. Used when nosubagent_type is specified. Has access to all tools.
When to use: Researching complex questions, searching code, executing multi-step tasks, or any task where you’re not confident the first few searches will find the right match.
Explore
A fast, read-only search specialist. Has access to Glob, Grep, Read, and Bash (read-only operations only). Cannot create, edit, or delete files. Uses a faster model (Haiku by default) for speed. When to use: Finding files by pattern, searching code for keywords, answering questions about the codebase. Specify a thoroughness level in your prompt:"quick", "medium", or "very thorough".
Explore is strictly read-only. It cannot write files, run git write commands, or install packages — any attempt will fail. This makes it safe to run concurrently with other work.
Plan
A software architect agent that explores the codebase and designs implementation plans. Read-only; cannot create or modify files. When to use: Before implementing a significant feature, to get a step-by-step implementation plan, identify critical files, and consider architectural trade-offs.verification
Verifies that implementation work is correct by running builds, tests, linters, and custom checks. Produces aPASS, FAIL, or PARTIAL verdict with evidence. Runs as a background task by default.
When to use: After completing non-trivial changes (3+ file edits, backend changes, infrastructure changes). Pass the original task description, the list of changed files, and the approach taken.
claude-code-guide
A documentation agent that answers questions about Claude Code, the Claude Agent SDK, and the Claude API. Fetches official documentation pages to give accurate, up-to-date answers. When to use: When you ask questions like “Can Claude Code do X?”, “How do I configure Y?”, or “What’s the difference between Z and W?” Claude spawns this agent automatically to answer questions about itself.statusline-setup
A specialized agent for setting up the terminal statusline integration. Invoked by the terminal setup workflow.Custom agents
You can define your own agent types by creating Markdown files in.claude/agents/. Custom agents override built-in agents with the same name, letting you extend or replace defaults.
Directory structure
<managed-path>/.claude/agents/(policy)~/.claude/agents/(user).claude/agents/(project)
name. User agents override built-in agents.
Agent file format
Frontmatter fields
| Field | Type | Description |
|---|---|---|
name | string | Required. The agent type identifier used in subagent_type. |
description | string | Required. When Claude should use this agent. Shown in the agent list. |
tools | string | Comma-separated list of allowed tools. Omit to allow all tools. |
disallowedTools | string | Comma-separated tools to block. Used when you want all tools except specific ones. |
model | string | Model override for this agent. Use inherit to use the session model. |
effort | string or int | Effort level: low, medium, high, max, or an integer. |
permissionMode | string | Permission mode for the agent session. |
maxTurns | integer | Maximum number of agentic turns before stopping. |
skills | string | Comma-separated skill names to preload for this agent. |
mcpServers | array | MCP servers to attach to this agent (by name or inline config). |
hooks | object | Session-scoped hooks for this agent. |
memory | user, project, or local | Persistent memory scope for the agent. |
background | boolean | Always run as a background task when spawned. |
initialPrompt | string | Text prepended to the first user turn (slash commands work here). |
isolation | worktree | Always run in an isolated git worktree. |
Example: a focused code reviewer
The /agents command
Type/agents at the prompt to open the agent management panel. It shows:
- All available agent types (built-in, plugin, and custom)
- Each agent’s description and tool access
- Buttons to create or edit custom agent files
Writing effective agent prompts
Agents start with no context — they haven’t seen your conversation. Brief them completely:- Good prompt
- Weak prompt
- Explains what was done and why
- Points to the specific files involved
- Gives concrete verification steps or questions
- Specifies the expected output format
For more on tool-level configuration, see the Agent tool reference.