Claude Code Subagent allowed-tools: Syntax, Examples, Fixes A developer documented that Claude Code subagents do not support an `allowed-tools` frontmatter field; the correct key is `tools`, a comma-separated allowlist (e.g. `tools: Read, Grep, Glob`), with `disallowedTools` serving as the matching denylist. The writeup explains that `allowed-tools` belongs to Skills, where it pre-approves tools for a single turn without restricting anything, and warns that placing it in a subagent file causes the subagent to inherit every available tool. It also recommends pairing explicit tool lists with `permissions.deny` rules or `PreToolUse` hooks for unattended runs. Originally published at Unattended https://en.aobaworks.com/claude-code-subagent-allowed-tools-syntax-examples-fixes/?utm source=devto&utm medium=referral . Claude Code subagents don't have an allowed-tools field. The key you want in a subagent's .md frontmatter is tools . It's an allowlist, written as a comma-separated string like tools: Read, Grep, Glob or as a YAML list. disallowedTools is the matching denylist. allowed-tools belongs to Skills, and it does something else: it pre-approves tools for one turn and restricts nothing. If you leave tools out, the subagent " Inherits every tool available to subagents if omitted. https://code.claude.com/docs/en/sub-agents " The best place to start depends on whether you want a safe default fast, a dependable daily setup, or the lowest token cost. | Your situation | What to pick first | First page to open | |---|---|---| | Beginner, first custom subagent | tools: Read, Grep, Glob read-only . Nothing can break | Create custom subagents https://code.claude.com/docs/en/sub-agents | | Daily work, subagent edits code and runs tests | tools: Read, Edit, Bash, Grep, Glob plus a permissions.deny rule for risky Bash commands | Configure permissions https://code.claude.com/docs/en/permissions | | Subagent needs one MCP server GitHub, Slack | tools: Read, mcp github , or scope the server with mcpServers | Sub-agents: MCP section https://code.claude.com/docs/en/sub-agents | | You want everything except writes | disallowedTools: Write, Edit and keep inheriting | Sub-agents: restrict tools https://code.claude.com/docs/en/sub-agents | | Budget: keep context and tokens small | Inline MCP servers in the subagent so the parent never loads their tool descriptions | Sub-agents: scope MCP servers https://code.claude.com/docs/en/sub-agents | | Unattended or cron runs | Explicit tools list plus a PreToolUse hook as a second check | Hooks reference https://code.claude.com/docs/en/hooks | The reason for each row: an explicit read-only list can't fail in a dangerous way. A Bash deny rule blocks particular commands without taking Bash away. A server wildcard keeps the list short. A denylist is the least work when you only fear one or two tools. Inline MCP keeps tool definitions out of the main context. Hooks still run when a frontmatter list turns out wrong. In Claude Code subagents, the "allowed-tools" job is done by the tools frontmatter key, an allowlist that limits which tools that subagent can call. Many people search for allowed-tools because they've seen it in Skills or the Agent SDK, so the three names are worth separating before you write any YAML. | Where you write it | Key name | What it does | |---|---|---| | Subagent file .claude/agents/ .md | tools | Allowlist: the subagent can use only these tools | | Subagent file | disallowedTools | Denylist: removes tools from the inherited or listed pool | | Skill file SKILL.md | allowed-tools | Pre-approves listed tools for the turn that invokes the skill. Other tools stay callable | | Agent SDK options | allowedTools / allowed tools | Auto-approves tools before your permission callback runs | The Skills documentation https://code.claude.com/docs/en/skills says the Skills allowed-tools grant clears when you send your next message, and that it does not restrict which tools are available. The Agent SDK permissions page https://code.claude.com/docs/en/agent-sdk/permissions treats allowedTools as approval too. Put allowed-tools: in a subagent file and you get neither behavior: it isn't a supported subagent field, so the subagent inherits everything. Here is a minimal, valid subagent. Save it as .claude/agents/code-reviewer.md example : --- name: code-reviewer description: Reviews diffs for bugs and style issues. Use after code changes. tools: Read, Grep, Glob model: sonnet --- You are a code reviewer. Read the changed files, report problems with file and line, and never modify files. Some official limits are worth knowing as of October 2026, sub-agents docs https://code.claude.com/docs/en/sub-agents . name can be up to 256 characters and can't contain : . Claude Code warns at startup when the combined descriptions of your custom subagents go over 15,000 tokens. By default, 20 subagents running at once is the ceiling, and the next spawn fails with Concurrent subagent limit reached . Claude Code's subagent tools field takes exact tool names, either as a comma-separated string or a YAML list. The documented wildcards are for MCP servers, such as mcp github . .claude/agents/