Worked Example: Repo Review Agent
A complete Claude Agent SDK agent: a custom diff tool, a stripped tool surface, a per-call path gate, an audit hook, a reviewer subagent, and a budget cap — structurally unable to modify what it reviews.
Last updated
After this section you can
- Assemble custom tools, permissions, hooks, a subagent and budgets into one agent
- Make a read-only agent read-only structurally rather than by prompt
- Explain what each control catches that the others do not
Worked Example: Repo Review Agent
One file that puts every control in this track on a single agent: a custom tool, a stripped tool surface, a per-call path gate, an audit hook, a subagent, and a budget it cannot exceed.
A review agent should be structurally incapable of changing the code it reviews. That is not a prompt instruction — it is disallowed_tools plus a path check. If the only thing stopping a write is the system prompt, there is nothing stopping it.