How and when to use Claude Code subagents
Anthropic just dropped a practical guide on subagents in Claude Code to curb context window bloat during long coding sessions. Instead of cramming dozens of files into one thread, subagents act like browser tabs that explore codebases or fix bugs in parallel, returning only clean summaries. You can invoke them in chat, pop them into the background with Ctrl+B, or define reusable specialists via markdown files.

Long Claude Code sessions have a well-known failure mode: they get sluggish and expensive. Every documentation check, utility lookup, and dead-end rabbit hole lingers in the context window, driving up token usage and slowing down answers.
Anthropic just published a tactical guide detailing how and when to deploy subagents in Claude Code to bypass the context bloat.
Browser tabs for coding agents
A subagent is basically an isolated Claude instance with its own fresh context window. You hand it an errand, it reads files or modifies code, and it passes back only the final summary. Think of it like opening a new browser tab to investigate a bug without cluttering your main workspace.
Claude Code comes with built-in subagent roles, including lightweight Explore agents for read-only searches and Plan agents for architecting features before touching code. They can also carry strict permission guardrails, such as locking an agent to read-only access while it inspects authentication logic.
Anthropic laid down a simple rule of thumb: if a side quest requires reading ten or more files, or involves three or more decoupled chores, hand it off to subagents instead of dragging your main session through the mud.
From quick prompts to team policies
Calling a subagent can be as casual as asking Claude to research API endpoints and database schemas in parallel. If an investigation takes too long, hitting Ctrl+B kicks the task into the background so you can keep chatting, while the /tasks command tracks its progress.
For recurring tasks like security audits or test generation, you can save custom subagents as Markdown files inside your project directory or user home folder. These specialists get custom prompts, restricted tools, and can even run on distinct models.
Teams can also encode delegation rules directly into CLAUDE.md. That guarantees repetitive duties, such as ensuring all code reviews are handled by an unbiased, read-only subagent, happen automatically without developers needing to remember specific prompt recipes.
Why it matters
Context management, not raw reasoning, is becoming the true dividing line for AI developer tools. Running massive monorepos inside a single linear prompt has clearly hit diminishing returns.
For engineers, this approach delivers immediate relief on two fronts: cost control and review quality. Subagents offer the objectivity of running a clean-slate /clear command, but without ditching your active workspace context. You get an untainted second pair of eyes that won't hallucinate based on earlier conversation biases.
We like how Anthropic designed the abstraction. Instead of forcing developers into heavy, brittle multi-agent frameworks, it treats subagents as ephemeral forks controlled by plain Markdown files. The main risk to watch is runaway token spikes: spawning parallel background agents on large repos can chew through quotas fast if automated trigger rules are written too broadly.
Sources (1)
- claude.com(opens in a new tab)Originalclaude.com