New Tool Radar

AI Agents & Automation

How to Write a Claude Code Subagent Description So the Router Picks It

Write a subagent description that names the exact work it does, because Claude Code reads descriptions to decide when to delegate.

Schematic diagram with three steps: Name the exact work, Add trigger words, then Test the routing.

Claude uses each subagent description to decide when to delegate tasks. The description is the only part of the agent the main session reads, so a vague description means the subagent is never picked, and an over-broad one means it is picked for everything.

Before you start

You need a custom subagent file in .claude/agents. Write the one job on paper first, in a single sentence, before you touch the description.

Write the description as a routing rule

Write the description with the trigger words and the exact work: what the subagent does, when to use it, and what it does not do. Move detail into the system prompt, which only loads when the subagent runs, and keep the description to the routing decision. The body of the file becomes the subagent system prompt.

Test with two tasks: one that matches, one that does not

Ask Claude to do the subagent job and check the subagent runs. Then ask for a different job and check the subagent does not run. If the wrong agent is picked, the description overlaps with another subagent, and one of them needs narrowing.

Worked example: Descriptions for two fictional subagents

Maple Shop is a fictional online shop with two subagents. The table shows their descriptions.

Subagent Description
reviewer Reviews code changes for bugs and style. Use when a change needs review.
explorer Searches the codebase and returns file paths. Use when code needs finding, not changing.

Expected result (UNTESTED): a review request runs the reviewer and a search request runs the explorer, with no overlap. We checked the Claude Code subagents documentation, which states that Claude picks a subagent by its description, but we did not test routing on this machine.

Limits

A description is a hint to the router, not a guarantee: the main agent can still answer directly. If a subagent is never picked, the description is the first thing to rewrite, not the system prompt.

Sources

See all