Claude Code subagents starter: 5 ready-made agents and a read-only hook

Drop-in .claude/agents files for code review, security review, test runs, debugging and docs lookup, plus a tested hook that keeps the review agents read-only.

· By Derrick K.

Macro shot of colorful interlocking metal gears
Photo by Rafael Minguet Delgado on Pexels
Free account required

Subagents let Claude Code hand a job to a helper with its own prompt, tools and model, so a long test log or a code review doesn't fill your main session. This pack gives you five that are ready to use. If you're choosing a model for the main session, see Claude Opus 5.5 for builders.

Preview: code-reviewer.md

---
name: code-reviewer
description: Reviews the current diff for bugs, risky changes and missing tests. Read-only. Use proactively after writing or changing code, before you commit.
tools: Read, Grep, Glob, Bash
model: inherit
color: blue
hooks:
  PreToolUse:
    - matcher: "Bash"
      hooks:
        - type: command
          command: python3 "${CLAUDE_PROJECT_DIR}/.claude/hooks/readonly-bash.py"
---

You are a careful senior reviewer. You read code; you never change it.

1. Run git status and git diff to see what changed.
2. Read each changed file and Grep for callers of anything whose behavior changed.
3. Check correctness, error handling, security, tests and readability.

Report must fix / should fix / nice to have, with file:line for every point.

What's inside

  • code-reviewer: reviews your diff and reports by severity. Read-only.
  • security-reviewer: looks for secrets, injection, auth gaps, unpinned dependencies and risky CI or agent config. Read-only.
  • test-runner: runs your tests on haiku and returns only the failures. Doesn't edit code.
  • debugger: reproduces a bug, finds the root cause and makes the smallest fix. Can edit; told not to commit, install or delete.
  • docs-researcher: answers one API or config question from official docs for the version in your lockfile, with links. Treats fetched pages as data, not instructions.
  • readonly-bash.py: the PreToolUse hook. Python 3.8+, no dependencies. Exit 2 blocks a command and tells the subagent why.
  • tests/: front matter checks for every agent and 75 allow/block cases for the hook.

How to use it

  1. Unzip the pack and copy .claude/ into your project root.
  2. Open the project in Claude Code and accept the trust prompt, so the hook runs.
  3. Run /agents to check that all five show up.
  4. Ask in plain language, for example "have the code-reviewer check my diff", or @-mention the agent.
  5. Optional: python3 -m unittest discover -s tests (needs PyYAML for the agent checks).

Who it's for

Anyone using Claude Code who wants reviews and test runs out of the main conversation, without giving the review agents write access.

FAQ

Where do the files go?

Copy the .claude folder into your project root. For every project, put the agent files in ~/.claude/agents/ and point the hook path at your copy of readonly-bash.py.

Why didn't the hook run?

Claude Code skips a project subagent's frontmatter hooks until you accept the workspace trust dialog for that folder. The subagent still runs, so trust the folder first.

Is the read-only hook a sandbox?

No. It blocks the obvious ways to write or reach the network and fails closed on commands it can't read, but test suites it allows can still write files. Use a container for untrusted code.

Can I use these agents in a plugin?

Plugin subagents ignore the hooks field, so the read-only guard would be lost. Keep them as project or user agents.

Keep reading

Keep reading

Newsletter

The Codema publication. Consent is required. You are not subscribed until you confirm from the email, and nothing is stored if email delivery is not connected.