Claude Code subagents for real projects
Use subagents for code review, QA, research, security checks and focused implementation without losing project context.

Put it into practice
What you will produce
A focused subagent brief with owned files or questions, evidence requirements and a concise findings handoff.
- 01
Split out a read-only question
Choose a repository question that can be answered without editing, such as tracing a call path or locating tests, and state why it is independent of implementation.
Expected result: A research task with a clear boundary and no file ownership ambiguity.
- 02
Write a bounded delegation brief
Specify the exact question, relevant paths or search terms, evidence required, exclusions and requested handoff format; state explicitly that the task is read-only.
Expected result: A subagent assignment that limits duplication and makes the evidence standard clear.
- 03
Check the evidence returned
Open cited repository paths yourself, verify key claims against current files and distinguish observed code from inference or unanswered questions.
Expected result: A validated findings note rather than an unchecked summary.
- 04
Integrate before changing code
Compare the findings with the main task plan, resolve conflicts or stale-state claims, then make any implementation decision in the owning workflow.
Expected result: Research incorporated into one coherent decision without parallel edits to shared files.
Example structure to adapt
---
name: repo-researcher
description: Trace a code path and return file-backed findings
tools: Read, Grep, Glob
---
Read the repository instructions first.
Answer only the assigned question.
Cite file paths and symbols for each finding.
Do not edit files. List unknowns separately.Adapt the fields to your SDK or repository, then verify the format against the linked official documentation. This is a starting structure, not a claim that it was tested in your environment.
Acceptance checks
- The delegated question can be answered without modifying repository files.
- The brief names evidence, exclusions and a read-only boundary.
- Important findings cite repository paths and are spot-checked against current content.
- Implementation decisions and shared-file edits stay with the owning workflow.
Limits and trade-offs
Parallel agents can duplicate effort or see inconsistent state. Define ownership and merge findings before editing shared files.
Official sources
Map useful subagents
Related guides
Claude Code Subagents: Parallel Agents
Learn when Claude Code subagents help, how to split parallel work, and how to configure a focused custom subagent without creating conflicts.
Subagents are useful when a task can be split cleanly: one agent searches the authentication code, another traces the database path, and the main conversation compares what they found. They add little to "read this file" or to work where every step depends on the same context. Short version: delegate independent research or a separate review when the results are worth the extra context and usage. Give each agent a narrow scope, the files or area to inspect, and a specific report format. Keep dependent work in the main conversation. Claude Code agents vs subagents Claude Code's documentation calls delegated workers subagents and uses Agent for the tool that starts them. When people search for Claude Code agents in this context, they usually mean subagents: workers that handle a delegated task in their own context and return a result to the main conversation. Claude Code's subagent documentation uses this terminology.…
Read the guideBuilding AI agents that actually work
Most 'agents' are brittle pipelines dressed up with AI. Here's the anatomy of a reliable agent, three patterns that hold up in production, and when to use n8n vs code.
Everyone is building agents. Most of them break on the third run. One common failure mode is asking the model to handle too many responsibilities without clear checks. Architecture, model behavior and external dependencies can all contribute to failures. Here's what I've learned building agents that actually run week after week. The anatomy of a reliable agent Every agent that works has three parts, and only one of them should involve AI. Trigger something deterministic starts the agent. A schedule, a webhook, a file drop, a form submission. Not "whenever the AI decides it's time." Context the agent gathers what it needs before calling the AI. The document, the data, the user preferences, the constraints. The AI call happens with full context, not halfway through discovery. Action after the AI produces output, something deterministic happens with it. It gets saved, sent, logged, or published. The action step doesn't retry or…
Read the guide