Explain a specific part of the codebase - flows, patterns, or architecture
Primary Tool: Use the Task tool with Explore agent (thoroughness: "very thorough") for comprehensive codebase exploration before building explanations.
Help the developer understand $ARGUMENTS by exploring the codebase and providing a clear, comprehensive explanation.
This command supports various explanation requests:
Analyze the user's question to determine:
If the request is ambiguous, use AskUserQuestion to clarify:
Based on the explanation type, use appropriate exploration strategies:
Find the entry point (API endpoint, workflow trigger, etc.)
Trace the call chain:
Identify data transformations:
Map error handling:
Understand the layer structure:
Find pattern implementations:
Map dependencies:
Read the component:
Find callers:
Check integrations:
Structure the explanation clearly:
## Overview
[2-3 sentences summarizing what this is and its purpose]
## How It Works
### [Logical Section 1]
[Explanation with file references like `src/module/file.py:123`]
### [Logical Section 2]
[Continue breaking down the topic]
## Key Files
- `path/to/file.py` - [brief description]
- `path/to/another.py` - [brief description]
## Related Concepts
- [Link to related patterns or components]
- [Suggest what to explore next]
Always include:
Start by understanding what the developer wants to learn about.