Claude Code subagent generator
A Claude Code subagent is a Markdown file in .claude/agents/ whose frontmatter needs a name and a description and whose body is the system prompt. Fill in the form to get the file, with tools, model and permission mode set the way you want.
Runs in your browser. What you type stays on this page. By Jake Marsh. Checked against Claude Code docs: Subagents on 2026-11-16.
- OKFrontmatter has everything Claude Code requires.
Subagent file
Save as .claude/agents/code-reviewer.md. Claude Code picks up new files on the next session, or run /agents.
---
name: code-reviewer
description: Reviews code for bugs, security problems and style. Use proactively right after code is written or changed.
tools: Read, Grep, Glob, Bash
model: sonnet
color: blue
---
You are a senior code reviewer. When invoked:
1. Run `git diff` to see what changed.
2. Read the changed files in full before judging them.
3. Review for correctness, security, error handling and readability.
Report findings in three groups: must fix, should fix, nice to have. Give the file and line for each, and show the fix. Do not edit files.
Frontmatter fields follow the Claude Code subagent docs. Unknown fields are ignored by Claude Code, not rejected.
How to use it
- Pick an example (code reviewer, debugger, test runner, security auditor, explorer or docs writer) or start from the blank form.
- Write a description that says what the subagent does and when Claude should use it. Claude reads this to decide whether to delegate.
- Tick only the tools the job needs. A reviewer needs Read, Grep and Glob, not Edit.
- Set the model, and any permission mode, color or turn limit you want.
- Copy the file or download it, save it as .claude/agents/<name>.md in your repo (or in ~/.claude/agents/ for every project), and run /agents to confirm it loaded.
Frontmatter fields
Only name and description are required. Everything else is optional, and Claude Code ignores fields it does not recognize instead of failing.
- name: unique, no colon, cannot start with a hyphen. The file name does not have to match it.
- description: when Claude should delegate to this subagent.
- tools: an allowlist, as a comma separated line or a YAML list. Leave it out to inherit every tool.
- disallowedTools: a denylist, applied before the allowlist.
- model: sonnet, opus, haiku, fable, a full model ID, or inherit.
- permissionMode: default, acceptEdits, auto, dontAsk, bypassPermissions or plan. If the main conversation runs in bypassPermissions, acceptEdits, auto or plan, the subagent follows that mode instead.
- color, memory, effort, maxTurns, isolation (worktree), background, omitClaudeMd, skills, hooks and mcpServers for finer control.
Where subagent files are read from
- Managed settings (organization wide) win first.
- The --agents command line flag, for one session.
- .claude/agents/ in the project. Commit it so the team shares the subagent.
- ~/.claude/agents/ for every project on your machine.
- A plugin's agents/ directory, lowest priority.
When two locations define the same name, the higher one in this list wins. Both agents directories are scanned recursively, so subfolders are fine, but two files with the same name in one directory means only one of them loads, and which one is not defined.
Example output
---
name: code-reviewer
description: Reviews code for quality and best practices
tools: Read, Glob, Grep
model: sonnet
---
You are a code reviewer. When invoked, analyze the code and provide
specific, actionable feedback on quality, security, and best practices.Questions
- Where does a Claude Code subagent file go?
- Put it in .claude/agents/ inside your project to share it with the team, or in ~/.claude/agents/ to use it in every project. Subfolders are allowed. A subagent is identified by its name field, not its path.
- Which frontmatter fields are required?
- Only name and description. The name must be unique, cannot contain a colon and cannot start with a hyphen. Everything else is optional, and unrecognized fields are ignored without an error.
- What happens if I leave tools out?
- The subagent inherits every tool available to subagents, including MCP tools. For a reviewer or an explorer that is more than it needs, so list Read, Grep and Glob and leave out anything that writes files.
- How do I make Claude use the subagent without being asked?
- Write the description as a trigger, for example 'Use proactively right after code is changed'. Claude matches the task against descriptions when it decides whether to delegate. You can also name the subagent in your prompt.
- Which model should a subagent use?
- Use haiku for fast read-and-report jobs like running tests or searching the codebase, sonnet for most review and writing work, opus for hard analysis such as security audits, and inherit to follow the main session.
- Does the subagent see my CLAUDE.md?
- By default a custom subagent loads your user, project and local CLAUDE.md files. Set omitClaudeMd: true in the frontmatter (Claude Code v2.1.271 or later) to start it without them, for a subagent that gets everything it needs from the task Claude hands it.
Sources
Checked 2026-11-16.
Give your subagents a shared task list.
Subagents do their work out of sight. Taskhold gives you and your coding agents one task list: each request becomes a task with steps and a progress bar, and a blocked agent asks you a question you can answer from your phone. Try the live board or see the Claude Code setup. $12 a month or $120 a year, 7-day trial with a card.
Or connect your agent first, no sign-up: add https://taskhold.com/api/mcp as an MCP server. The first time it uses Taskhold, it gives you the trial link.
Related tools
- Claude Code permissions builder
Pick what Claude Code may run, what it must ask about and what it can never touch, and get the allow, ask and deny block for settings.json. Paste an existing file to check it.
- Claude Code slash command generator
Write the prompt once and get the .claude/commands file with the frontmatter, arguments, shell context and allowed tools wired in, plus a preview of what Claude receives.
- CLAUDE.md and AGENTS.md generator
Answer a few questions about your repo (stack, commands, rules, do-nots) and get a starter CLAUDE.md and AGENTS.md, either as one shared file or as two.