# What is a subagent?

URL: https://agentvera.dev/en/glossary/subagent/

A subagent is a helper agent that a main coding agent starts to hand off a specific job. It has its own context window, instructions and tool permissions, and when it finishes it returns only a summary, so the main conversation doesn’t fill up with detail.

**How it works.** The main agent hands a job to a subagent, such as searching the codebase, running tests and summarizing failures, or reviewing a change. The subagent starts with a clean context; the files it reads and the command output it sees stay in its own window, and the main agent gets only the result. Several subagents can run at the same time.

**Defining subagents in Claude Code.** In Claude Code, subagents are Markdown files with YAML frontmatter. Project subagents live in .claude/agents/ and personal ones in ~/.claude/agents/; you can also manage them with the /agents command.

- name and description: what the subagent is called and when to use it. The main agent decides based on this description.
- tools: which tools it may use, for example only read tools for a reviewer.
- model: optionally, a different model for the subagent.
- The body of the file is the subagent’s system prompt.

**When subagents help.** Subagents pay off most when you want to keep the main conversation clean.

- Research that reads many files: the detail stays in the subagent and the main context stays small.
- Specialist roles: security review, writing tests, documentation.
- Parallel exploration: several subagents scan different modules at once.

**Limits.** A subagent doesn’t see the main conversation’s history, so the task it’s given has to stand on its own. Because each subagent builds its own context from scratch, total token use can go up. Subagents usually work in the same folder as the main agent, so parallel subagents that edit files can get in each other’s way.

**Subagents in AgentVera.** AgentVera makes the subagents Claude Code starts visible. The Subagents view in the project tour and code map window lists the subagents a Claude Code agent started.

- **How is a subagent different from a separate agent session?** The main agent starts a subagent and gets its result back; you usually see only the summary. A separate session runs on its own and you talk to it directly.
- **Do subagents save tokens?** They keep the main conversation’s context small, which helps in long sessions. But the subagent’s own reading costs tokens too, so total usage can rise.
- **Can a subagent edit files?** That depends on the tools its definition allows. A subagent given only Read, Grep and Glob can read code but not change it.
- **Where should I put subagent files?** Ones your team should share go in .claude/agents/ in the project; ones only you use go in ~/.claude/agents/. Files in the project folder reach your team through git.

---

**About AgentVera.** AgentVera is a desktop app for macOS, Windows and Linux, built by Solviera Teknoloji. It runs 18 AI coding agents (Claude Code, Codex, Gemini CLI, Copilot, Cursor, Antigravity, opencode, Hermes, Qwen Code, Kimi Code, Kiro, Amp, Droid, Goose, Vibe, Crush, Aider, Cline) side by side, per project, in real terminals with the user's own CLI installs and logins. The free plan runs 2 agents at once. Download: https://agentvera.dev/en/download/ · Pricing: https://agentvera.dev/en/pricing/
