You want a code reviewer limited to reading files, with its own instructions. What do you create?
Why A is the answer
A subagent file in .claude/agents/ with tools limited to Read, Glob and Grep
Subagents are Markdown files with YAML frontmatter, and tools can be restricted there. The restriction is enforced, not requested.
In detail
- A subagent is a Markdown file with YAML frontmatter in .claude/agents/.
- Its body is its instructions, and its tools field can limit it to reading.
- The restriction is enforced, so the reviewer cannot edit files even if it tries.
- Give each subagent only the tools its job needs.
Use case
An illustrative scenario, not a real incident.
A team wants a reviewer that can read code but never change it. A subagent with tools limited to Read, Glob and Grep cannot edit, whatever its prompt says, and it has its own review instructions.
See it in different ways
sequenceDiagram participant C as Coordinator participant S as Subagent C->>S: Task text, with everything it needs S->>S: Reads, searches and thinks in its own context S-->>C: Final summary only
mindmap
root(("Code reviewer"))
n1["Instructions"]
n2["Review standards"]
n3["Allowed tools"]
n4["Read"]
n5["Glob"]
n6["Grep"]
n7["Not allowed"]
n8["Edit"]
n9["Write"]Key point: Restrict tools when a limit must be enforced.
Why the other options are wrong
- B. A paragraph in CLAUDE.md asking Claude to avoid editing files during reviews
- A paragraph in CLAUDE.md is a request, not a restriction.
- C. A second copy of the repository that has been marked as read-only on disk
- A read-only copy adds overhead, and it gives the reviewer no instructions of its own.
- D. A shell alias that starts Claude Code with a longer review prompt attached
- A shell alias adds a prompt but enforces nothing.

