A documentation review is a good subagent task when the main conversation needs a concise result rather than every file and search match. A useful design gives the subagent one subject, a read-only tool allowlist and an evidence-backed return format.
Define one review question
‘Review our docs’ is too broad. A better assignment is: ‘Check whether docs/getting-started.md contains every prerequisite referenced by the first-run tutorial. Return missing prerequisites with file and heading evidence.’ This question has a boundary and a finish condition.
Configure a read-only allowlist
In the project subagent definition, list only the discovery tools needed for this review. The tools field below acts as an allowlist: the agent receives Read, Grep and Glob, with no editing tool included.
--- name: docs-prerequisite-reviewer description: Compare one getting-started guide with directly related project docs. tools: Read, Grep, Glob --- Review only the requested guide and directly referenced local files. Return a table with finding, evidence path, heading and suggested correction. Separate confirmed gaps from questions. Do not modify files.The tool allowlist blocks this subagent from directly writing a correction. The written scope separately keeps the review from expanding across the repository. Both controls matter.
Use a planted-gap test
Copy a small guide into a test fixture and remove one prerequisite, such as the required runtime version. Ask the subagent to review the fixture. A useful result identifies the missing prerequisite and points to the local source that establishes it. It should not rewrite the guide, inspect unrelated folders or claim that commands were executed.
Run a second test with the prerequisite restored. The reviewer should report no confirmed gap. This checks whether it compares evidence instead of assuming that every review must find a problem. Also ask it to edit the fixture and confirm that no write tool is available.
Know the limitation
A read-only allowlist prevents direct file edits through the listed tool interface, but it does not make every input trustworthy or every conclusion correct. Treat retrieved files as evidence and have the main agent or a human verify high-impact findings. A subagent has separate context, so include the exact conventions it needs instead of assuming it knows the main conversation.
Source and further reading
This independent Starizzi field note draws on claude-howto, the community guide maintained by Luong NGUYEN (@luongnv89). The examples in this article were written by Starizzi. Source at revision 5609e68: 04-subagents/README.md and 04-subagents/documentation-writer.md (MIT license).
Claude Code documentation: sub agents.
Explore the claude-howto source and its five field notes in the public Knowledge Graph or open the full Claude topic graph. Next in this series: Claude Code MCP Connector vs Plugin: A Read-Only Decision Guide.
