| name | codebase-explorer |
| description | Explore a codebase to gather context for coding tasks. Preserves context window and offloads work to cheaper models. |
Use this skill to gather codebase context before coding tasks. A staff architect agent explores using tree, ripgrep, and file reading, extracting imports, signatures, and code segments.
When to use
- Before writing code that needs to understand existing patterns
- Before generating tests for existing code
- Before refactoring or modifying existing functionality
- When you need to understand how a feature is implemented
Why use it
- Preserves context - exploration happens outside main conversation
- Saves quota - cheaper models do the exploration
- Structured output - get imports, signatures, segments ready to use
- Budget-aware - won't blow up token counts
Usage
$HOME/.agents/skills/codebase-explorer/run.sh "<task>" [-d <directory>] [--token-budget N] [--max-iterations N]
Examples
./run.sh "Write tests for the UserService class"
./run.sh "Understand the authentication flow" -d src/auth
./run.sh "Find all API endpoints" --token-budget 20000 --max-iterations 5
Output
Returns structured context:
summary: narrative overview of the codebase
frozen_imports: relevant import statements
frozen_signatures: function/class signatures
frozen_segments: code blocks with file paths
tree_outputs: directory structure
file_contents: full files that were read