Omniscio

OmniscioSubagent examplesCode reviewer

A code reviewer subagent

A review is the clearest case for a subagent there is: the work produces a diff, a few files and maybe a test run, and what you want back is three paragraphs. Done inline, all of that output stays in your conversation and gets re-read on every turn after it.

Done as a subagent, it happens in a separate context window with its own tool access, and only the findings come back. Anthropic ships a code reviewer of its own as a worked example, with Read, Grep, Glob, Bash and a note that it can still change files through Bash — which is why the tool list deserves a decision rather than a copy.

Checked against Anthropic's Claude Code documentation on November 25, 2026. By the Omniscio team. Updated .

When Claude delegates to it

Claude decides by matching the task in front of it against three things: your request, the subagent's description, and the conversation so far. Nothing else routes a subagent, so the description is the whole trigger and it is worth writing as a sentence about a moment rather than a sentence about a person.

Anthropic's guidance is to include a phrase such as "use proactively" when you want Claude to reach for the agent without being asked. That is why the file below ends its description with "Use proactively after code changes, before a commit or a pull request": it names the moment, the work that follows it, and the intent.

You can always invoke it yourself. Naming the agent in a request works with no special syntax, and the transcript then shows the delegation as a tool call row with the agent's name and a short task description.

The file

Save this as .claude/agents/code-reviewer.md in the project, or as ~/.claude/agents/code-reviewer.md for every project you open. The frontmatter is YAML between two lines of three dashes, and the Markdown under it becomes the subagent's system prompt.

---
name: code-reviewer
description: Reviews a diff for correctness, security and maintainability, and reports findings in priority order. Use proactively after code changes, before a commit or a pull request.
tools: Read, Grep, Glob, Bash
model: inherit
---

You are a senior reviewer. You do not change code.

When you start:
1. Run `git diff` and `git diff --staged` to see what changed.
2. Read each changed file in full, not only the changed hunks.
3. Read the tests that cover the changed behaviour.

Report in this order, and do not skip ahead:
1. Correctness: wrong behaviour, unhandled errors, broken invariants, races.
2. Security: unvalidated input, injection, leaked secrets, missing authorization, unsafe paths.
3. Tests: behaviour that changed with no test that would fail if it broke again.
4. Maintainability: duplication, dead code, names that mislead.

For every finding give the file and line, what breaks, the smallest fix, and how to check the fix.
Do not report anything the repository's formatter already enforces.
End with a one-paragraph verdict and a list of what you inspected and found clean.

The last line matters as much as the findings. A reviewer that says what it checked, and found nothing wrong with, is how you tell a clean change from a review that never happened.

What each field does

name

The identifier Claude uses when it delegates, at most 256 characters and without a colon. The filename does not have to match it, but keeping them the same is one less thing to explain. Hooks receive this value as agent_type, so changing it later breaks any hook that matches on the old name.

description

The routing rule. It is loaded into context at the start of every session, along with every other agent's description, so it has to earn its tokens: one sentence on what the agent does and one on when to use it. Anthropic warns at startup when the combined descriptions pass 15,000 tokens.

tools

An allowlist. Read, Grep and Glob let it read the diff, the files around it and the tests. Bash is there for one reason — a subagent does not see your conversation, so it has to run git diff itself to know what changed.

That is also the risk. Anthropic's documentation is explicit that a reviewer with no Edit and no Write can still change files through Bash. If the reviewer must not be able to touch the repository, drop Bash and paste the diff into your request instead; the agent then reviews what you gave it and nothing else. Do not delete the tools line to achieve that: a subagent with no tools field inherits every tool available to subagents, which is the opposite of a fence.

model

inherit keeps the review on the model the session is already using, which is the default a subagent gets anyway when the field is omitted. Writing it out is a reminder that it is a choice. Set an alias such as opus or sonnet when you want the model fixed regardless of the session, and remember the subagent's requests count toward the same usage limits as your conversation.

Project file or user file

A reviewer is the agent most worth committing. Put it in the project's .claude/agents/ and everyone who clones the repository reviews against the same checklist, and improvements to it arrive through the same pull requests as the code.

  • .claude/agents/ belongs to the current project and is usually checked in.
  • ~/.claude/agents/ belongs to you and is available in every project.
  • When two definitions share a name, the higher-priority location wins, and a project definition outranks a user one. Checking them in is what Anthropic suggests for a project agent, so the whole team uses and improves the same file.
  • Subfolders are scanned recursively, so .claude/agents/review/code-reviewer.md works, but two files in the same directory with the same name means one of them never loads; /doctor reports the pair.

Confirm Claude picked it up

  1. Ask for it by name. "Use the code-reviewer agent on my last commit" is the fastest test of the file. If that works, everything below is about routing rather than loading.
  2. Expect no restart. Claude Code watches both agent directories, so a new or edited file is picked up within a few seconds. The exceptions are a directory added with --add-dir and a session started with --disable-slash-commands.
  3. Read the transcript. The delegation appears as a tool call row naming the agent and the task, and the findings arrive as that row's result.
  4. /agents prints a reminder to ask Claude to manage subagents or to edit the folders directly. On Claude Code v2.1.197 and earlier it opened a wizard listing your agents, which is what older write-ups describe.
  5. /tasks lists the subagent while it runs and names the model it is on (v2.1.242 or later).

If nothing happens at all, there are two checks. claude --debug writes a log to ~/.claude/debug/<session-id>.txt that names up to five frontmatter fields Claude Code does not recognise (v2.1.296 or later). claude plugin validate .claude/agents reports the files whose frontmatter does not parse. Neither one sees a file with no name, because Claude Code reads that as documentation and never loads it.

When it goes wrong

  • The agent never fires. The description is the cause nine times out of ten. It should read like "after code changes, before a commit", not "an expert in software quality".
  • It reviews the whole repository. A subagent starts with a fresh context and no idea what you changed. Either leave Bash in so it can run git diff, or say which commit or files to look at in the request.
  • It refuses to launch. A tools entry that resolves to nothing — a typo such as Grpe, a tool subagents cannot use, or an MCP tool from a server that is not connected — makes Claude Code refuse the launch with an error naming the entries.
  • The file is skipped. A name that starts with a hyphen, contains a colon or passes 256 characters, a file with no description, or YAML that does not parse is skipped and the reason goes to the debug log. Two cases are quieter: with no name, or with an opening --- that is not the first line, Claude Code reads the file as documentation and never loads it.
  • It edits the code anyway. It has Bash. See the tools section above for the two ways to take that back.

One more that is easy to miss: the more agents you keep, the more descriptions load at every session start. Five focused agents cost less than twenty accumulated ones, and Anthropic warns once the total passes 15,000 tokens.

Adapting it to your repository

  1. Replace "senior reviewer" with the thing your team reviews for. A payments service and a static site do not share a checklist, and the specific one is the useful one.
  2. Name your own commands in the body. If your team diffs against a trunk branch rather than HEAD, say so, or the agent will review the wrong span.
  3. Keep the priority order. Correctness before security before tests before style is what makes a long review readable; a flat list of twenty findings gets skimmed.
  4. Add your own house rules as checks, not preferences. "No direct database access from the view layer" is checkable; "write clean code" is not.
  5. Commit it. A reviewer that lives in the repository is reviewed like everything else.

The other four files in this set are on the subagent examples page, and the subagents guide covers what a subagent inherits, what it costs and how nesting works.

Sources

  • Anthropic's Create custom subagents, for the file format, the frontmatter reference, the scope and priority rules, the file-watching behaviour, the delegation rules and the worked code-reviewer example, read November 25, 2026.
  • Anthropic's error reference, for the zero-tools refusal and the 15,000-token description warning, read November 25, 2026.
  • Anthropic's commands reference, for /agents and /tasks as they behave today, read November 25, 2026.

The file on this page was written for this site and follows Anthropic's documented fields and rules. It was not run against a live repository here, and this page does not claim it improves any particular repository's reviews.

Common questions

What does a code reviewer subagent do in Claude Code?

It reads your changes in its own context window and returns a review, so the diff, the surrounding files and any test output never fill your main conversation. You define one as a Markdown file with YAML frontmatter, and the description tells Claude when to hand the work over.

Will a code reviewer subagent change my code?

Not through an edit tool you did not give it, but Bash can still write files. Anthropic says so directly: a subagent allowed Bash can change files even when Edit and Write are absent. For a read-only reviewer, drop Bash and paste the diff into your request.

Which model should a code reviewer run on?

inherit is the safe default, because review quality follows the model doing the work. Set an alias such as opus or sonnet when you want reviews to stay the same regardless of the session model, and remember its requests count toward the same limits as your conversation.

Why is Claude not using my reviewer?

The description decides delegation. If it describes a role rather than a moment, there is nothing to match; name the moment and add "use proactively". Asking for the agent by name tells you whether the problem is routing or loading.

Keep every session in one list

A subagent lives inside one Claude Code session. Omniscio is the level above: a desktop app for running Claude Code and other coding agents side by side, with one list of sessions and one inbox, so an agent only interrupts you when a decision needs you.

The features page lists what is in it today, pricing covers the plans, and you can download it for Windows, macOS or Linux.