Claude Code Subagents: When They Are Worth It
What are Claude Code subagents? A subagent is a separate Claude worker with its own context window, its own system prompt and its own list of allowed tools. The main session hands it a task, it does the digging, and only its summary comes back. You define one as a Markdown file with a short YAML header in .claude/agents/ (for the project, committed to git) or ~/.claude/agents/ (for you, across projects). The official subagents docs, checked November 28, 2026, list name and description as the only required fields.
The useful part of that sentence is “only its summary comes back”. The rest of this post is about when that’s worth paying for.
The file
This is a reviewer I’d put in most repos we take over. It can read, it can’t write.
---
name: rls-reviewer
description: Reviews Supabase migrations and RLS policies before they are applied. Use after any change in supabase/migrations.
tools: Read, Grep, Glob
model: sonnet
---
You review Postgres migrations for a Supabase app.
For every new table, check that RLS is enabled and that each policy
names auth.uid() or a role. Flag any policy with "using (true)".
Report file, line and the fix. Do not suggest style changes.
The body below the header is the subagent’s whole system prompt. It does not inherit your chat. It does get your CLAUDE.md files and a git status snapshot, so project rules still reach it.
The fields that actually change behaviour:
toolsis an allowlist. Leave it out and the subagent gets every tool the main session has.disallowedToolsis the other direction and gets applied first.modeltakessonnet,opus,haiku, a full model id, orinherit. A per-call model beats the file, the file beats theCLAUDE_CODE_SUBAGENT_MODELvariable, and if none is set it uses the main conversation’s model.permissionModecan beplanfor read-only research, or something looser. I would not give a subagentbypassPermissionson a repo that can reach your production database. Ever.isolation: worktreeruns it in its own git worktree, which is handy when two agents would otherwise edit the same files.
There are more (skills, hooks, memory, maxTurns, background). Unknown fields are silently ignored, so a typo like allowedTools just does nothing. That one cost me twenty minutes on a client repo once: the “read-only” reviewer had write access the whole time because the key was misspelled, and nothing complained.
Where they live, and who wins
If two subagents share a name, managed settings win, then the --agents flag for the session, then .claude/agents/, then ~/.claude/agents/, then plugins. The folders are scanned recursively and watched, so a new file usually works without restarting. Identity comes from the name field, not the file name.
Claude also ships its own: Explore and Plan are read-only, general-purpose can use every tool. You can block any of them with a deny rule such as Agent(Explore) in settings.
How they get called
Mostly automatically. Claude reads every subagent’s description and decides whether to hand off, which is why the description should say when, not just what. “Use after any change in supabase/migrations” gets used. “Expert database reviewer” sits there.
You can also ask by name (“use the rls-reviewer on this branch”), @-mention it, or run a whole session as one with claude --agent rls-reviewer.
Subagents can start their own subagents, three layers deep by default, and up to 20 run at once. Those are ceilings, not targets.
The cost part nobody mentions
Every subagent starts from zero. It re-reads the files it needs, re-runs the searches, and burns tokens your main session already spent. The docs are blunt that their requests count toward the same usage limits as your main conversation.
So they pay off in two situations:
- The output is big and you only need the verdict. A test run with 4,000 lines of logs, a scan of 300 files for one pattern, a dependency audit. Keep that out of your main context and get five lines back.
- You want a second reader that didn’t write the code. A reviewer with read-only tools and a narrow prompt catches things the writing session talks itself past, because it never saw the reasoning.

They’re a waste for small edits, back-and-forth debugging, or anything where the main session needs to see the detail anyway. One founder sent us a setup with eleven subagents (frontend, backend, “architect”, “QA lead”…) and a Pro plan that ran out by Wednesday. Three would have done: a reviewer, a test runner, a migration checker. The “architect” mostly re-read the same eight files every time it was called.
If you want a cheaper worker for grunt tasks, set model: haiku on the test runner. For review, I’d keep a stronger model; a cheap reviewer that misses a missing RLS policy is worse than none, because now you trust it.
Subagents are not guardrails
A reviewer subagent is still a request. If the main session decides not to call it, or ignores what it says, nothing stops the merge. Things that must never happen belong in hooks, deny rules and CI, the same split we covered in Claude Code hooks and in what goes in a CLAUDE.md. Use the subagent to find problems early. Use CI to block them.
Where we come in
Setting up two or three subagents that fit your app (a migration reviewer that knows your schema, a test runner, an RLS check), plus the hooks and CI behind them, is part of our AI-ready setup from $600. If you’d rather a person reviews every pull request the AI writes, that’s the guardrail retainer from $500 a month on the same page. And if the app is built and you need it live, see taking a Claude Code or Cursor app to production.