explore-codebase
Explore Codebase
Use Opencode's built-in Explore agent for fast, read-only codebase exploration.
When to Use
- Initial codebase discovery and mapping
- Finding files by patterns (e.g., "find all React components")
- Understanding project structure and architecture
- Quick code searches without modifying files
- Answering questions about "where is X located?"
How to Use
Option 1: Invoke @explore Subagent
When running inside Opencode, invoke the Explore subagent directly:
@explore Find all API endpoints in this codebase
@explore Map out the database models and their relationships
@explore What authentication patterns are used here?
Option 2: CLI with Explore Agent
From the terminal, use the --agent explore flag:
opencode run --agent explore "Map out the project structure"
opencode run --agent explore "Find all test files"
opencode run --agent explore "What are the main components in src/?"
What Explore Agent Does
The Explore agent is:
- Read-only - Cannot modify files (safe for exploration)
- Fast - Optimized for quick searches and file discovery
- Pattern-matching - Great for glob searches and keyword finding
- Codebase mapping - Efficient at understanding structure
Common Patterns
Map entire codebase:
@explore Give me an overview of this project's architecture
Find specific files:
@explore Find all files related to authentication
Understand patterns:
@explore What testing framework is used and where are tests located?
Quick search:
@explore Search for where 'User' type is defined
Best Practices
- Start broad, then narrow - Ask for overall structure first
- Use specific terms - Name files, functions, or patterns explicitly
- Chain explorations - Use results to ask follow-up questions
- Combine with other agents - After exploring, switch to Build agent to make changes
Integration with Workflow
After exploring, transition to implementation:
@explore [your exploration query]
[Review results, then:]
Now let's implement the changes. [Switch to Build agent or continue with main agent]
More from pc-style/pc-skills
blog-post
Create pcstyle.dev developer blog posts in the dual-author (ME MYSELF + MY AI AGENT) format, including MDX structure, custom components, and API/CLI publishing steps.
4code-review
Run automated code review using cubic review with amp review fallback. Use when the user wants to review code changes, check PR quality, analyze code for issues, or run automated code review tools.
4load-handoff
Load a handoff file and proceed with the specified tasks. Use when starting a new session with a HANDOFF.md file present, or when the user asks to continue from a handoff. Reads the handoff context and immediately begins executing the next steps.
3git-push-origin
Push local branch to origin (GitHub) to initialize it remotely. Use when the user has created a local branch and wants to push it to GitHub for the first time, or when setting up a new branch on the remote repository.
3create-handoff
Create a handoff message to continue work in a new AI session. Use when the user wants to save context for later, create a handoff document, or prepare work for continuation in a fresh session. Captures relevant files, context, and goals so the next session can start immediately without rediscovering the codebase.
3git-commit-push
Stage changes, commit with conventional commits, and push to origin. Use when the user wants to commit and push in one go, save changes to GitHub, or after completing work on a branch. Combines staging, committing, and pushing into a single workflow.
3