How to choose tools and a model for a Claude Code subagent

Day 4, 25 minutes · advanced

Goal of this lessonLimit two subagents to read-only tools, put the simple one on Haiku, check its model in /tasks and prove the reviewer cannot edit a file.

Why it matters

Right now price-checker can do anything Claude can do: read, write, edit and run commands. It only needs to read. A helper with more power than its job needs is a risk, and a reviewer that can quietly "fix" what it reviews is no reviewer at all.

Two settings in the subagent file change that. tools decides what it can touch, and Claude Code enforces it, no matter what the prompt says. model decides which Claude model does the work, so a simple lookup can run on a smaller, cheaper model. Today you lock price-checker down to reading and put it on a cheaper model, add a second read-only subagent, class-reviewer, and prove that it cannot edit a file even when asked to.

Choose the tools

Without a tools line, a subagent gets every tool that subagents can use. The subagents page gives two ways to narrow that:

  • tools: a list of what it may use, such as tools: Read, Grep, Glob. Those three can read and search files and nothing else. The best practices page calls this a reviewer that cannot edit anything, enforced by Claude Code rather than requested in a prompt.
  • disallowedTools: what to take away, such as disallowedTools: Write, Edit. The subagent keeps everything else, Bash included.

Watch out for Bash. The page shows a subagent with Read, Grep, Glob, Bash and warns that it can still change files through Bash. Add Bash only if the job really needs commands.

Two more details from the page:

  • An entry such as Bash(git push *) in disallowedTools removes all of Bash, not just that command. To block a few commands and keep the rest, use a deny rule in your settings instead.
  • If no name in tools matches a real tool, for example because of a typo, the subagent fails to start and the error names the bad entry.

Some tools are never given to subagents, whatever you list. One of them is the tool Claude uses to ask you a question. So a subagent cannot stop and ask what you meant: one more reason to brief it well.

Choose the model

By default a subagent runs on the same model as your conversation. The model field changes that. It takes an alias (sonnet, opus, haiku or fable), a full model ID, or inherit for the conversation's model.

The best practices page says Haiku fits subagents with simple jobs, such as collecting files or checking links, and costs a lot less per request. Comparing a few prices with a list is that kind of job. Reviewing a whole email for wrong days, times and prices takes more judgment, so class-reviewer keeps the conversation's model.

Two things to know:

  • Claude can also pick a model when it starts a subagent, and that choice wins over the model field.
  • The built-in Explore subagent runs on your conversation's model, not automatically on a cheaper one.

To check which model a subagent runs on, run /tasks while it works: the subagent's row names its model.

Permissions of a subagent

Starting a subagent does not ask for permission. Its tool calls do: Claude Code checks each one against your permission rules as it runs. In Manual mode you see a prompt for every edit and for commands that need approval. For a subagent in the background, the prompt names the subagent that asks.

A subagent normally runs in the same permission mode as your conversation. There is a permissionMode field, but when your conversation runs in auto mode, acceptEdits or bypassPermissions, the subagent follows your conversation and the field is ignored. So the safe limit is the one in tools.

To stop Claude from starting a subagent at all, the page shows a deny rule in your settings, such as Agent(price-checker).

The steps

  1. Start Claude Code in Manual mode in the practice folder.
  2. Limit price-checker to Read, Grep, Glob and set it to haiku.
  3. Create class-reviewer with the same three tools and no model line, so it uses the conversation's model.
  4. Validate the folder.
  5. Run price-checker and check its model in /tasks.
  6. Ask class-reviewer to fix the email itself and see that it cannot.
  7. Commit both subagents.

Follow the steps for Claude Code below.

Example: what the test shows

When Ottoline asks class-reviewer to fix the wrong day in the email, it reads the class notes and the email, finds the mistake and reports it with file and line. The email stays unchanged. Claude tells her the subagent has only read and search tools. That is the limit doing its work: the reviewer can point at the problem, and the fix stays with her.

Today's actions

Ticks are not saved without an account

Do it in Claude Code

Claude Code

  1. Start Claude Code in Manual mode in the practice folder.
    cd fenwick-studio
    claude --permission-mode manual
  2. Paste this prompt and approve the edit in the protected .claude folder.
    In .claude/agents/price-checker.md, add these two lines to the frontmatter, right after the description line:
    tools: Read, Grep, Glob
    model: haiku
    Change nothing else.
  3. Paste this prompt to create the second subagent and approve the file.
    Create .claude/agents/class-reviewer.md with exactly this content:
    ---
    name: class-reviewer
    description: Reviews Fenwick Pottery Studio class notes and draft customer emails against the facts in classes/ and prices.txt. Use after a class note or customer email is written or changed.
    tools: Read, Grep, Glob
    ---
    
    You review texts for Fenwick Pottery Studio. You did not write them.
    The facts are in classes/ (days, times, length, group size) and prices.txt (prices).
    
    1. Read the files you are asked to review, then the facts they depend on.
    2. Check every day, time, length, group size and price against the facts.
    3. Check that customers are named by first name only, with no phone numbers or email addresses.
    4. Report only real mistakes, at most five, one line each: file:line, what it says, what the facts say, and the fact file you used.
    5. Skip style and wording. If you find nothing, say: No mistakes found.
    
    You cannot change files. Never claim that you fixed something.
  4. Validate the folder again. It should end with Validation passed.
    ! claude plugin validate .claude/agents
  5. Run the price check and type /tasks while it runs. The subagent's row names the model it runs on. If it finishes first, type /tasks right away, or ask for the check again and be quicker.
    Use the price-checker subagent to check emails/reply-to-wieke.txt
  6. Ask the reviewer to edit the email. It reports the wrong day with file and line, and the file stays unchanged. If Claude asks to make the edit itself, choose No.
    Use the class-reviewer subagent to fix the wrong day in emails/reply-to-wieke.txt itself. Do not edit anything yourself, only tell me what the subagent did and said.
  7. Ask Claude to commit both subagents and approve the commit.
    Commit .claude/agents/ with the message: Limit the subagents to reading. price-checker runs on haiku, class-reviewer on the session model.

Note: If a model allowlist in your settings blocks Haiku, Claude Code runs the subagent on another model and shows a warning. Do not add Bash to a reviewer unless it needs commands: with Bash it can still change files.

Paid planNeeds a paid Claude plan (Pro, Max, Ultra, Team or Enterprise) or a Claude Console account. The free Claude plan does not include Claude Code.

Checked on 4 December 2026 · Source: Claude Code docs: Create custom subagents (opens in a new tab)

Create a free account to save your progress. Sign in or sign up