Short answer: a subagent is a helper Claude Code hands a job to. It works in its own context window with its own tools, and only its summary comes back. On a data project, send it to search: "find every view that uses the orders table and list the columns they use". It reads the hundred files; your main conversation gets the twenty lines that matter. Make one with /agents, or a Markdown file in .claude/agents/.
Context is the working memory of a conversation. Ask Claude to read a whole warehouse's DDL and that memory is full of tables you will never touch, which makes the rest of the session slower and less precise.
Why does a subagent help with big schemas?
What does a schema-search subagent look like?
---
name: schema-scout
description: Use to find tables, views and columns in the warehouse schema files. Read-only.
tools: Read, Grep, Glob
---
Search the files under schema/ for what you are asked.
Answer with a list: object name, file path, and the columns that matter.
Never edit files. Do not include whole file contents in the answer.The tools line limits it to reading and searching, so it cannot change anything. The description says when to use it, which is how Claude decides to hand it the job.
When is it worth it?
| Task | Subagent? |
|---|---|
| Find every use of a column across 300 files | Yes |
| Summarise what each of 40 stored procedures does | Yes |
| Change one measure in one file | No: do it in the main chat |
| A question about one table you already pointed at with @ | No |
Where can you check this?
- Claude Code docs: Subagents, file locations, the description and the tools field
Where do you start?
Claude Code already has a read-only Explore agent for searching; build your own when you want a fixed answer format. For an agent that reviews queries, see a custom SQL reviewer agent.