exploring-codebases
Uses ripgrep and tree-sitter to return semantically complete AST nodes, making codebase exploration more accurate.
Install
mkdir -p .claude/skills/exploring-codebases && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/16414" && unzip -o skill.zip -d .claude/skills/exploring-codebases && rm skill.zipInstalls to .claude/skills/exploring-codebases
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Semantic search for codebases. Locates matches with ripgrep and expands them into full AST nodes (functions/classes) using tree-sitter or pre-generated _MAP.md files. Returns complete, syntactically valid code blocks rather than fragmented lines. Use when looking for specific implementations, examples, or references where full context is needed.Key capabilities
- →Locate code matches using `ripgrep`.
- →Expand matches into full AST nodes like functions or classes.
- →De-duplicate search results semantically.
- →Return signatures only by default to reduce token usage.
- →Output results in JSON format for machine processing.
- →Use pre-generated `_MAP.md` files for context expansion.
How it works
The skill combines `ripgrep` for initial search with `tree-sitter` or pre-generated `_MAP.md` files to expand matches into full structural code elements, then de-duplicates and formats the output.
Inputs & outputs
When to use exploring-codebases
- →Searching for function implementations
- →Finding class definitions with full context
- →Navigating large codebases efficiently
- →Returning syntactically valid code blocks
About this skill
Exploring Codebases
Hybrid search tool that combines the speed of ripgrep with structural awareness from tree-sitter or pre-generated _MAP.md files. It finds matches and returns the entire function or class containing the match, de-duplicating results semantically.
Progressive Disclosure
By default, returns signatures only (docstrings + declarations without function bodies), reducing token usage by 10-20x. Use --expand-full to get complete implementations when needed.
Installation
uv venv /home/claude/.venv
# tree-sitter is optional if using --use-maps mode
uv pip install tree-sitter-language-pack --python /home/claude/.venv/bin/python
Usage
# Default: signatures only with tree-sitter (efficient)
/home/claude/.venv/bin/python /mnt/skills/user/exploring-codebases/scripts/search.py "query" /path/to/repo
# Full implementations
/home/claude/.venv/bin/python /mnt/skills/user/exploring-codebases/scripts/search.py "query" /path/to/repo --expand-full
# Map-based mode: no tree-sitter required (#276)
# Requires _MAP.md files generated by mapping-codebases
/home/claude/.venv/bin/python /mnt/skills/user/exploring-codebases/scripts/search.py "query" /path/to/repo --use-maps
Options
--glob pattern: Filter files (e.g.,*.py,*.ts)--expand-full: Return full implementations instead of signatures--json: Output JSON for machine processing (default is Markdown)--use-maps: Use pre-generated_MAP.mdfiles instead of tree-sitter for context expansion. Eliminates redundant tree-sitter parsing when maps already exist.
Map-Based Mode (v0.3.0)
When _MAP.md files exist (generated by mapping-codebases), use --use-maps to skip tree-sitter entirely:
mapping-codebasesruns tree-sitter once to generate_MAP.mdfiles with symbol locationsexploring-codebases --use-mapsuses ripgrep + map data for context expansion- No redundant AST parsing at search time
Benefits:
- Single tree-sitter execution per codebase (during map generation)
- Faster searches (no AST parsing overhead)
tree-sitter-language-packnot required at runtime- Maps serve as canonical index for both navigation and search
Recommended workflow:
# Step 1: Generate maps (one-time, or after code changes)
python /mnt/skills/user/mapping-codebases/scripts/codemap.py /path/to/repo
# Step 2: Search using maps (fast, no tree-sitter needed)
python /mnt/skills/user/exploring-codebases/scripts/search.py "query" /path/to/repo --use-maps
Examples
Find class signatures:
/home/claude/.venv/bin/python /mnt/skills/user/exploring-codebases/scripts/search.py "class User" /path/to/repo
Output:
class User:
"""User account model."""
...
Find full method implementation:
/home/claude/.venv/bin/python /mnt/skills/user/exploring-codebases/scripts/search.py "def validate" /path/to/repo --expand-full
Find usage of process_data in Python files:
/home/claude/.venv/bin/python /mnt/skills/user/exploring-codebases/scripts/search.py "process_data" /path/to/repo --glob "*.py"
Scope and Limitations
Returns structural code elements — functions, classes, methods, interfaces, enums, structs, traits, and modules across 11 supported languages (Python, JavaScript, TypeScript, Go, Rust, Ruby, Java, C, C++, PHP, C#).
Does not return:
- Import/require statements
- Module-level variable assignments or constants
- Standalone decorators (decorators attached to functions/classes are included with their parent)
- Type aliases or standalone type annotations
- Comments outside of functions/classes
For these non-structural elements, use plain ripgrep (via the Grep tool) directly.
When not to use it
- →When searching for import/require statements.
- →When looking for module-level variable assignments or constants.
- →When searching for standalone decorators, type aliases, or standalone type annotations.
Limitations
- →Does not return import/require statements.
- →Does not return module-level variable assignments or constants.
- →Does not return standalone decorators, type aliases, or standalone type annotations.
How it compares
This workflow provides context-aware code search by returning full structural elements like functions or classes, unlike plain `ripgrep` which returns fragmented lines.
Compared to similar skills
exploring-codebases side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| exploring-codebases (this skill) | 0 | 5mo | Review | Intermediate |
| godot | 1,044 | 5mo | Review | Intermediate |
| jupyter-notebook | 30 | 6mo | Review | Intermediate |
| unreal-engine-cpp-pro | 43 | 4mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
godot
bfollington
This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.
jupyter-notebook
davila7
Use when the user asks to create, scaffold, or edit Jupyter notebooks (`.ipynb`) for experiments, explorations, or tutorials; prefer the bundled templates and run the helper script `new_notebook.py` to generate a clean starting notebook.
unreal-engine-cpp-pro
sickn33
Expert guide for Unreal Engine 5.x C++ development, covering UObject hygiene, performance patterns, and best practices.
clojure-write
metabase
Guide Clojure and ClojureScript development using REPL-driven workflow, coding conventions, and best practices. Use when writing, developing, or refactoring Clojure/ClojureScript code.
llvm-tooling
gmh5225
Expertise in LLVM tooling development including Clang plugins, LLDB debugger extensions, Clangd/LSP, and LibTooling. Use this skill when building source code analysis tools, refactoring tools, debugger extensions, or IDE integrations.
superpowers-workflow
anthonylee991
Enforces a disciplined workflow for coding, debugging, refactoring, and automation: brainstorm -> plan -> implement with verification (prefer TDD) -> review -> finish. Use for almost any non-trivial change.