Blog · August 4, 2026 · 7 min read · by Vilva Athiban P B

Claude Code Subagents: How to Delegate Work to Specialized Agents

At some point, every serious Claude Code user hits the same wall: one conversation, one context window, one agent trying to hold your whole task in its head. You ask for a refactor, then a code review, then a test run, and somewhere along the way the conversation gets long, the context gets muddy, and quality drifts.

Subagents are Claude Code's answer to that. Instead of one generalist doing everything in one thread, the main agent can hand pieces of work to specialized helpers — each with its own instructions, its own tool permissions, and crucially its own fresh context window. This guide covers what subagents actually are, when they help (and when they're overkill), and how to build your own in a few minutes.

What a subagent actually is

A subagent is a separate Claude instance that the main agent can launch to handle a delegated task. It receives a prompt — "find every place we parse dates and check for timezone bugs" — works in its own context, and reports back only its conclusion. The main conversation never sees the hundred files the subagent read; it just gets the answer.

That last part is the magic. Context is the scarcest resource in any long Claude Code session. When a search-heavy or read-heavy job runs in a subagent, all of that noise stays out of your main thread. The main agent stays sharp because it only accumulates results, not research.

Claude Code ships with general-purpose subagents out of the box — you may have seen it "launch an agent" on its own when you ask for a broad codebase search. The real power move is defining your own.

Custom subagents: a prompt, a toolset, a job title

Custom subagents live as small Markdown files in your project (under .claude/agents/) or in your home folder for personal ones — and you can create them interactively with the /agents command instead of writing files by hand. Each file has a short frontmatter header — the agent's name, a description of when it should be used, and optionally which tools it may touch — followed by its system prompt: the standing instructions that make it a specialist.

Three examples that earn their keep in real projects:

  • A code reviewer that is told to be adversarial, check error handling and security, and report findings as a ranked list — and that gets read-only tools, so it can never "helpfully" edit while reviewing.
  • A test runner whose prompt says: run the test suite, and if something fails, fix only the failure without touching unrelated code.
  • A researcher that digs through the codebase (or the web) and returns a summary, keeping hundreds of file reads out of your main context.

Because the description tells the main agent when to use each specialist, delegation starts happening automatically: ask for a review, and Claude routes the job to your reviewer with its stricter rules — no extra prompting from you.

The parallelism dividend

Subagents can also run in parallel. Ask Claude Code to investigate three unrelated flaky tests, and it can spin up three subagents that dig simultaneously instead of sequentially. For wide tasks — auditing many modules, migrating many files, researching several approaches at once — the wall-clock difference is dramatic.

This pairs naturally with running multiple Claude Code sessions, but it's a different axis: multiple sessions are you working several projects; subagents are one task fanning out inside a single session. Heavy users do both.

When not to use them

Subagents are not free. Each one starts from a clean slate — it doesn't know what you discussed for the last hour, so the delegation prompt has to carry the context, and anything it learns is gone when it finishes. They also consume tokens faster: a fleet of agents reading files in parallel adds up quickly.

  • Skip them for small, single-file edits — delegation overhead exceeds the work itself.
  • Skip them for tightly coupled changes where every step depends on decisions made in the previous one; that's a job for one agent with full context.
  • Use them for anything search-heavy, review-shaped, parallelizable, or noisy enough that you want it out of your main thread.

The catch: delegated work is invisible work

Here's what nobody mentions about subagent workflows: they make Claude Code sessions longer and quieter. A task that fans out to four specialists can run for ten or twenty minutes with nothing happening in your terminal that requires you — followed by one moment where everything finishes (or one agent hits a permission prompt and the whole pipeline waits for your answer).

Sitting there watching is exactly the wrong way to spend those minutes — and missing the permission prompt is worse, because the run sits blocked until you notice. This is the problem AI Done Now exists for: a Mac menu bar app that fires a native notification the moment Claude Code finishes or needs your input, with distinct alerts for "done" and "waiting for you." The longer and more autonomous your agent runs get, the less optional that becomes.

A starter recipe

  1. Run /agents in a project you work in daily and create one agent: a read-only code reviewer with an adversarial prompt.
  2. Use it for a week. Every time you ask for a review, note that your main conversation stays clean.
  3. Add a second specialist for whatever you delegate most — tests, research, dependency updates.
  4. Then try one genuinely parallel task: "use subagents to investigate these three bugs at the same time."

Start small, let the specialists earn their place, and combine them with hooks and notifications so the whole system runs while you do something better with your attention. That's the actual promise of subagents: not a fancier chatbot, but a small team that works while you don't watch.

Keep reading

Desk Exercises for Programmers: 15 Moves to Do While Your AI Agent Codes

7 min read

Exercise While Coding: Turn Claude Code Wait Time Into Micro-Workouts

7 min read

Claude Code Notch Notifications on Mac: See When Claude Is Done Without Watching the Terminal

7 min read

Claude Code Tips and Tricks: 12 Ways to Use Claude Code Effectively

8 min read

Claude Code Multiple Sessions: How to Run Agents in Parallel Without Losing Track

6 min read

A Claude Code Workflow That Doesn't Involve Watching the Terminal

5 min read

Claude Code Hooks: A Practical Guide to Automating Your Agent Workflow

7 min read

Claude Code Auto Mode: Fewer Permission Prompts Without Living Dangerously

7 min read

Claude Code Context Management: Treat the Context Window Like a Budget

6 min read

Per-Subagent Model Selection: Route the Grunt Work Down, Keep the Judgment Up Top

7 min read

Skills and Plugins: How to Teach Claude Code Your Way of Working

7 min read

Claude Code Background Tasks: Run Long Commands Without Blocking Your Session

6 min read

Codex CLI Notifications: How to Get a Ding When Codex Is Done or Needs Input

7 min read

Cursor Notification When Done: Every Way to Get Notified When Cursor Finishes

6 min read

Claude Code Notifications: How to Get Notified When Claude Code Finishes or Needs Your Input

6 min read

Want to Be Notified When Claude Responds? How Claude Notifications Work on Web, Desktop, and Mobile

5 min read

Claude Code Notification Scripts: Copy-Paste Recipes for Every Platform

6 min read

Get a Ding the Moment Codex Needs Your Response

6 min read

Get Notified the Moment Claude Code Is Waiting for Your Input

6 min read

“Notifications Are Turned Off for Claude” — Here Is the Fix

6 min read

Codex Sound When Done: Make Codex CLI Play a Sound When It Finishes

6 min read

terminal-notifier + Claude Code: Native macOS Alerts When Your Agent Finishes

6 min read

Gemini CLI Notifications: How to Get a Sound or Alert When Gemini Finishes

6 min read

Get Claude Code Notifications on Your Phone

6 min read

Claude Code Remote Control, Explained

7 min read

preferredNotifChannel: Claude Code's Built-In Notification Setting

6 min read

Claude Code Notifications in tmux and Over SSH

7 min read

Claude Code Effort Levels: Why Your Setting Keeps Getting Ignored

8 min read

Codex vs Claude Code Notifications: How Each One Tells You It Is Done

8 min read

Claude Code Notifications Not Working: A Diagnostic Checklist

10 min read

Claude Code Notifications Inside Your Editor's Terminal

7 min read

CLAUDE_CODE_DISABLE_BACKGROUND_TASKS Explained

7 min read

CLAUDE_CODE_DISABLE_BG_SHELL_PRESSURE_REAP Explained

8 min read

Cursor Alerts Explained: Every Alert Cursor Raises, and How to Control Them

7 min read

Claude Code Environment Variables: The Groups That Actually Matter

10 min read

Claude Code Notifications on WSL and Windows

9 min read

Claude Code Checkpoints and /rewind

8 min read

Claude Remote Control: How It Works, Turning It Off, and Auto Mode

7 min read

Claude Code /loop: Poll a Deploy, Babysit a PR, and Get Told When It's Done

8 min read

Setting Up NotchFit With OpenAI Codex CLI: Hooks, $notchfit-plan, and the Daily Flow

7 min read

Claude Mods Explained: What the New Plugin Layer Can Do, and How to Turn On 'You Should Know'

9 min read

NotchFit vs Mac Break Reminder Apps: A Clock or a Signal From Your Coding Agent?

8 min read

Claude Code Headless Mode: Running claude -p in Scripts and CI, and the Three Signals That It Finished

10 min read

Building a Movement Habit at a Desk: Use the Agent Run as the Cue, One Set as the Unit, and Streaks Carefully

8 min read

Claude Code MCP Servers Explained: Adding Servers, Choosing a Scope, Handling Secrets, and Why Long Tool Calls Go to the Background

10 min read

/notchfit:plan Explained: How Claude Code or Codex Writes a Weekly Workout Plan the Notch Can Actually Run

8 min read

Claude Code Spinner Verbs Explained: What “Pondering” and “Brewing” Mean, How to Change Them, and Why You Should Stop Watching the Spinner

7 min read

Why NotchFit's Done and Permission Alerts Wait Until Your Set Ends, When That Costs You, and How to Turn the Workout Off

7 min read

How to Resume a Claude Code Session: --continue vs --resume, Naming Sessions, the Session Picker, Branching, and What Comes Back

9 min read

NotchFit on a Mac Without a Notch: How Pill Mode Works on Mac mini, iMac, Mac Studio and a MacBook With the Lid Closed

6 min read

How to Run a Claude Code Session in the Background: /background, claude --bg, Agent View, and Getting Back to It

9 min read

What a Notch App Can See: NotchFit's Local-First Design, What the Claude Code and Codex Hooks Send, and What Stays on Your Mac

7 min read

Why Codex CLI Asks for Permission Every Time, and How to Tune the Sandbox and Approval Policy Without Going Full Access

8 min read

What to Do While Claude Code or Codex Works: A Simple Protocol for the Two-to-Twenty-Minute Gap in Every Agent Run

7 min read

Is It Possible to Get a Notification When Claude Code or Codex Hits a Reset? Yes for Claude Code: the quota_auto_resume Hooks, Explained

8 min read

What a MacBook Notch App Can Actually Do: The Five Kinds of Notch Utility, Their Trade-offs, and Where NotchFit Fits

7 min read

How to Make MCP Servers Not Take Up as Much Context in Claude Code: Tool Search, alwaysLoad, Scopes and Output Caps

8 min read

The notchfit Command Line: Drive Your Workout, Read Status as JSON, Validate Plans and Test the Notch Without Leaving the Terminal

7 min read

How to Audit MCP Tool Calls Made by Claude Code: A Five-Minute Hook Audit Log, OpenTelemetry Tool Events, and the Transcript for Investigations

9 min read

Exercise Snacks: What the Research Actually Says About One-Minute Vigorous Breaks, What It Does Not, and How NotchFit's Agent-Run Sets Compare

8 min read

How Long Until a Claude Code MCP Tool Call Times Out? The Four Timers (Startup, Two-Minute Backgrounding, Idle, Wall-Clock), Their Defaults, and Which One to Change

8 min read

Sitting Too Long as a Developer: The Posture Problems Coding Agents Made Worse, What the Research Says About Breaking Up Sitting, and How NotchFit Turns an Agent Run Into the Break

8 min read

Claude Code .mcp.json Explained: Where Project-Scoped MCP Servers Are Read From, What Happens in Subfolders and Monorepos, and Why a Committed Server Shows Pending Approval

8 min read

Standing Desk Exercises for Developers: Why Standing Still Is Not the Goal, Eight Movements That Fit a Thirty-Second Agent Run, and How NotchFit Cues Them From the Notch

8 min read

The claude mcp Command Reference: add Syntax by Transport, What --scope local, project and user Actually Mean, add-json and add-from-claude-desktop, list, get, remove, login and serve

9 min read

Your First Week With NotchFit: Install and Simulate, Run Real Tasks, Write a Smaller Plan Than You Want, Tune the Alerts, Survive the First Skipped Day, and Decide What Stays

8 min read

How to Stop a Running Claude Code Task: Esc vs Ctrl+C, Background Tasks, Subagents, and Disconnecting Remote Control

8 min read

Pomodoro vs Agent-Driven Breaks: Timing Movement to Claude Code and Codex Runs Instead of a Timer

7 min read

Claude Desktop MCP Configuration: claude_desktop_config.json, Logs, Extensions, and the Difference From Claude Code

9 min read

The 20-20-20 Rule for Developers: Eye Strain, the Evidence, and Agent Runs as the Cue

8 min read

Claude Agent SDK + MCP Servers: mcpServers, allowedTools, Status Checks and Auth

9 min read

Discreet Desk Exercises for an Open-Plan Office While Claude Code Runs

7 min read

claude remote-control Server Mode: Run Claude Code as a Session Server

9 min read

Wrist and Forearm Stretches for Developers: A 60-Second Routine for Every Claude Code Run

7 min read