Day 4, 25 minutes · advanced
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 astools: 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 asdisallowedTools: 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 *)indisallowedToolsremoves 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
toolsmatches 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
modelfield. - 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
- Start Claude Code in Manual mode in the practice folder.
- Limit
price-checkertoRead, Grep, Globand set it tohaiku. - Create
class-reviewerwith the same three tools and no model line, so it uses the conversation's model. - Validate the folder.
- Run
price-checkerand check its model in/tasks. - Ask
class-reviewerto fix the email itself and see that it cannot. - 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 accountDo it in Claude Code
Claude Code
- Start Claude Code in Manual mode in the practice folder.
cd fenwick-studio claude --permission-mode manual - Paste this prompt and approve the edit in the protected
.claudefolder.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. - 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. - Validate the folder again. It should end with Validation passed.
! claude plugin validate .claude/agents - Run the price check and type
/taskswhile it runs. The subagent's row names the model it runs on. If it finishes first, type/tasksright away, or ask for the check again and be quicker.Use the price-checker subagent to check emails/reply-to-wieke.txt - 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. - 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.
Create a free account to save your progress
Free, and no payment details. Your ticks and finished lessons are kept, on every device.
Create a free account I already have an accountCreate a free account to save your progress. Sign in or sign up