Claude Tips mascot
Claude Tips & Tricks
Claude Code advanced

Delegate Research to Subagents

Tell Claude to use subagents for investigation tasks. They explore in a separate context window, keeping your main conversation clean for implementation.

When you ask Claude Code to investigate something complex, it can eat up your main context window with exploration results you only need briefly. Subagents solve this by running research in a separate context.

How to Use It

Simply tell Claude what you want researched:

Use a subagent to investigate how authentication is implemented across this codebase.
Report back with the key files, patterns, and any inconsistencies.

Claude spawns a subagent that reads files, follows imports, and builds understanding, all in its own context window. Your main session stays clean.

Best Use Cases

  • Codebase exploration: “Use a subagent to map out all the database models and their relationships”
  • Bug investigation: “Use a subagent to trace the data flow for order processing and find where the total is wrong”
  • Dependency analysis: “Use a subagent to check which modules depend on the legacy auth system”
  • Code review: “Use a subagent to review the changes in the last 5 commits for security issues”

Subagents vs. Agent Teams

Subagents are like sending someone to research a specific question. Focused task, return the result. The parent agent stays in control.

Agent Teams are for large parallel efforts like codebase migrations, with multiple agents working on different parts and communicating with each other. For most day-to-day work, subagents are what you want.

Paste into Claude Code
Use subagents to research how error handling is done across this codebase. Have them investigate different modules in parallel and report back with a summary of patterns found.