Codebase Explorer
Build comprehensive understanding of codebase areas before implementation or to answer questions about how things work.
When to Activate
- User asks "how does X work?"
- User wants to understand existing code
- User asks where something is implemented
- Before planning any feature (preparation step)
- User asks about architecture or patterns
- User wants to trace data flow or execution
Quick Process
- Parse the request — extract
topic,files(optional), andfocus(optional) from the user's message - Answer directly if you can — see When NOT to Delegate below
- Delegate — if the question genuinely spans a subsystem, invoke context-loader-agent with the extracted parameters
- Present findings — format the agent output using the Output Format section below
When NOT to Delegate
Answer with your own Grep/Glob/Read and skip the agent when:
- The question is a locate ("where is the API rate limiting implemented?") — that is one Grep, and several of the examples below fall in this bucket.
- The user named specific files and wants those explained.
- One or two files answer it end to end.
Delegate only when the answer requires tracing across a subsystem: multi-file data flow, architecture of a module you have not read, or "understand X before I change it" where X spans several directories.
Input Parsing
Extract from user's request:
topic: Main area/feature/component to explorefiles: Specific files mentioned (optional)focus: Particular aspects to emphasize (optional)
Delegation
Invoke context-loader-agent and pass the extracted parameters:
topic: the main area to explorefiles: specific files mentioned (omit if none)focus: the aspect to emphasize (omit if not specified)
The agent handles file discovery, dependency tracing, pattern identification, and analysis.
Output Format
This output is fed into /plan as context, so its length is charged to a later session too.
Target under 100 lines. Include only sections you have something concrete for, and drop
the rest rather than padding them.
Return structured analysis:
- Summary: Executive overview of the area
- Key Components: Core files and responsibilities
- Patterns: Conventions to follow
- Dependencies: External integrations
- Data Flow: How data moves through the system
- Gotchas: Non-obvious behaviors and pitfalls
- Implementation Notes: Key considerations for new work
Examples
"How does the authentication flow work?"
"Where is the API rate limiting implemented?"
"Show me how data flows from the UI to the database"
"Explain the plugin architecture before I add a new one"
"Trace a request from the controller to the database"
Workflow Integration
This is Step 1 of the implementation workflow:
- Explore (this) → 2. Plan → 3. Review → 4. Execute
After exploring, context is automatically available for /plan or the plan-implementation skill.
Detailed Reference
For exploration strategies and patterns, see exploration-guide.md.