Claude Code Background Sub-Agents vs Skills vs Dynamic Workflows: When to Use Which (June 2026)
Claude Code Background Sub-Agents vs Skills vs Dynamic Workflows: When to Use Which (June 2026)
Anthropic ships three distinct orchestration surfaces in Claude Code, and the right one for each job differs. Background sub-agents handle parallelism and long-running work. Skills package reusable expertise. Dynamic Workflows automate deterministic multi-step processes. This page is the decision tree for which to reach for.
Last verified: June 15, 2026.
TL;DR
- Sub-agents → parallelism, context isolation, overnight runs.
- Skills → reusable expertise that loads only when relevant.
- Dynamic Workflows → deterministic, repeatable multi-step automation.
- CLAUDE.md (the baseline) → project facts loaded every turn.
Match each tool to its job; they compose.
Side-by-side
| Dimension | Background Sub-Agents | Skills | Dynamic Workflows |
|---|---|---|---|
| Primary job | Parallel autonomous work | Reusable expertise | Deterministic multi-step automation |
| Definition | Spawned session | Markdown file (+ optional scripts) | Python/YAML workflow file |
| Context | Isolated from parent | Loads when relevant | Explicit per-step |
| Output | Summary back to parent | Influences main session | Per-step state + final result |
| Loaded | On demand (you spawn) | Auto when relevant | When you invoke |
| Cost model | Separate Agent SDK credit (post-June 15, 2026) | Free (uses session credits) | Uses session credits |
| Best for | Long-running, context-heavy, parallel | Repeatable expertise | Repeatable multi-step processes |
| Anti-pattern | Short single-step tasks | One-off context | One-off tasks |
Background sub-agents
A background sub-agent is a Claude Code session that runs in parallel with your main session. You delegate a task with a one-line prompt and the sub-agent reads files, runs commands, makes changes, and returns a summary.
The mechanics in mid-2026:
- You spawn from the main session with
Spawn a sub-agent to ...or via the/agentsinterface. - The sub-agent runs in an isolated context window — it sees only what you give it, not your main session history.
- After June 15, 2026, headless background sub-agent runs draw from a separate Agent SDK credit pool, distinct from interactive subscription quota.
- The sub-agent works asynchronously; you keep working in the main session.
- When it finishes, the summary lands as a tool result you can act on.
When sub-agents shine:
- Codebase exploration. Sub-agent reads 30 files, returns a summary; main session only consumes the summary tokens.
- Parallel design exploration. Spawn two sub-agents — one tries approach A, one tries approach B. Compare results.
- Long-running refactor. Spawn an overnight sub-agent for a multi-hour migration. Check in the morning.
- Test running and analysis. Sub-agent runs the test suite, summarizes failures, proposes fixes.
When sub-agents are wrong:
- Single short queries that don’t justify the spawn overhead.
- Work where you need to see every intermediate step (sub-agents are summary-output, not full-transcript).
- Tasks where the main session already has the relevant context loaded (re-spawning wastes tokens).
Skills
Skills are Anthropic’s reusable expertise mechanism. A Skill is a directory containing a SKILL.md file (the instructions) and optional references/, scripts/, templates/, and assets/ subdirectories. Claude Code loads Skills automatically when it detects the user’s task matches the Skill’s description.
The mechanics:
- Skills live in
~/.claude/skills/(user-level) or.claude/skills/(repo-level). - Each Skill has a description that Claude evaluates against the current task.
- When Claude judges a Skill relevant, it reads
SKILL.mdand loads referenced files. - Unlike CLAUDE.md, Skills don’t load on every turn — they load when needed.
When Skills shine:
- Specialized domain expertise. A “Postgres performance tuning” Skill loads only when the user is working with Postgres.
- Tool-specific patterns. A “Stripe webhook handlers” Skill knows the canonical patterns and loads when Stripe code is in scope.
- Team conventions. Multiple developers share the same Skill library; everyone gets consistent expertise.
- Reducing CLAUDE.md bloat. Move per-domain instructions out of CLAUDE.md into Skills.
When Skills are wrong:
- One-off project context that applies to every turn (use CLAUDE.md).
- Instructions so context-dependent that auto-loading would miss them.
- Tasks needing scripted multi-step execution (use Dynamic Workflows).
Dynamic Workflows
Dynamic Workflows are Anthropic’s programmable agent orchestration. A workflow file (Python or YAML) defines a sequence of steps Claude executes, with explicit branching, state passing, retries, and observability.
The mechanics:
- Workflows live alongside your code, version-controlled.
- Each step has explicit inputs, outputs, and acceptance criteria.
- Workflows can spawn sub-agents, call Skills, and invoke external tools.
- The runtime logs each step’s input/output for debugging and replay.
Example: a daily refactor workflow.
- Step 1: Read TODO comments from the codebase.
- Step 2: Triage by complexity. (Sub-agent.)
- Step 3: For each simple TODO, generate a fix. (Sub-agent per TODO, in parallel.)
- Step 4: Run tests. (Tool invocation.)
- Step 5: Open PRs for passing fixes.
- Step 6: Report to Slack.
That’s a Dynamic Workflow — repeatable, scriptable, observable.
When Dynamic Workflows shine:
- Repeated multi-step automation (daily reports, scheduled refactors, CI-integrated tasks).
- Processes needing reliability (retries, state, explicit error handling).
- Auditable processes (every step is logged).
- Multi-agent orchestration (sub-agents within a structured workflow).
When Dynamic Workflows are wrong:
- One-off tasks (overhead exceeds value).
- Exploratory work where structure would constrain rather than help.
- Cases better handled by a single sub-agent.
How they compose
The three aren’t competing — they compose. A realistic mid-2026 production setup:
- CLAUDE.md describes the project (stack, conventions, paths).
- Skills library with 10-30 domain expertises (Postgres, Stripe, Astro, etc.).
- Background sub-agents for parallelism within interactive sessions.
- Dynamic Workflows for the 3-5 most-repeated automated processes.
Each layer handles a different scale:
- Single turn → CLAUDE.md + auto-loaded Skills.
- Single complex task → main session with sub-agents for parallelism.
- Repeatable multi-step process → Dynamic Workflow that spawns sub-agents and uses Skills.
Cost considerations
CLAUDE.md — every line is recurring input cost on every turn. Keep tight (Anthropic recommends < 200 lines).
Skills — load only when relevant; near-zero recurring cost. Use liberally.
Sub-agents — separate Agent SDK credit pool (post-June 15, 2026 change). Each sub-agent has its own context window cost.
Dynamic Workflows — uses session credits. Multi-step workflows compound cost; budget for the full run, not just one step.
For Fable 5 users post-June 22 paywall, the cost calculus matters more. A long-running sub-agent on Fable 5 can burn $5-$20 per task. A poorly-structured Dynamic Workflow with retries can be 5-10x more expensive than a focused single session. Engineer for cost-aware orchestration.
Decision tree
Question 1: Is this work happening once?
Yes → Just do it in the main session with sub-agents for parallelism.
No → Continue.
Question 2: Is it expertise needed across many tasks?
Yes → Skill.
No → Continue.
Question 3: Is it a deterministic multi-step process?
Yes → Dynamic Workflow.
No → Continue.
Question 4: Is it parallel, context-heavy, or long-running?
Yes → Background sub-agent.
No → Inline in main session.
Common antipatterns
- Putting domain expertise in CLAUDE.md. Bloats every turn; move to Skills.
- Spawning sub-agents for short queries. Overhead exceeds value.
- Skipping Dynamic Workflows because they look complex. A simple 3-step workflow can save hours of repeated prompting.
- Treating Skills as scripts. Skills are instructions, not code. If you need code, the Skill should reference a script in
scripts/. - Running long-running Fable 5 sub-agents without batch discount. Use
--batchwhere supported to halve cost.
What’s coming next
Anthropic has signaled additional orchestration features:
- Cross-project Skills sharing — load Skills from team or organization libraries.
- Workflow marketplace — community-contributed Dynamic Workflow templates.
- Sub-agent pools — pre-warmed sub-agent pools to reduce spawn overhead for high-throughput automation.
These are roadmap as of June 15, 2026; ship dates TBD.
Related reading
- Claude Opus 4.8 Dynamic Workflows vs Grok Build 8 Agents
- Codex+Ona Cloud Agents vs Claude Code Background Tasks
- Workspace Agents vs Claude Skills vs Gemini Gems
- Apple Foundation Models vs Anthropic Agent SDK vs OpenAI Agents SDK
Anthropic continues to evolve Claude Code’s orchestration surfaces. Verify current capabilities and pricing in the Anthropic documentation before architecting production processes.