Agent skill

exploring-codebases

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.

Stars 113
Forks 4

Install this agent skill to your Project

npx add-skill https://github.com/oaustegard/claude-skills/tree/main/exploring-codebases

Metadata

Additional technical details for this skill

version
0.3.1

SKILL.md

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

bash
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

bash
# 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.md files 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:

  1. mapping-codebases runs tree-sitter once to generate _MAP.md files with symbol locations
  2. exploring-codebases --use-maps uses ripgrep + map data for context expansion
  3. 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-pack not required at runtime
  • Maps serve as canonical index for both navigation and search

Recommended workflow:

bash
# 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:

bash
/home/claude/.venv/bin/python /mnt/skills/user/exploring-codebases/scripts/search.py "class User" /path/to/repo

Output:

python
class User:
    """User account model."""
    ...

Find full method implementation:

bash
/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:

bash
/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.

Expand your agent's capabilities with these related and highly-rated skills.

oaustegard/claude-skills

hello-demo

Delivers a static Hello World HTML demo page with bookmarklet. Use when user requests the hello demo, hello world demo, or demo page.

113 4
Explore
oaustegard/claude-skills

installing-skills

Install skills from github.com/oaustegard/claude-skills into /mnt/skills/user. Use when user mentions "install skills", "load skills", "add skills", "update skills", "refresh skills", or references a skill not currently installed.

113 4
Explore
oaustegard/claude-skills

extracting-keywords

Extract keywords from documents using YAKE algorithm with support for 34 languages (Arabic to Chinese). Use when users request keyword extraction, key terms, topic identification, content summarization, or document analysis. Includes domain-specific stopwords for AI/ML and life sciences. Optional deeper extraction mode (n=2+n=3 combined) for comprehensive coverage.

113 4
Explore
oaustegard/claude-skills

remembering

Advanced memory operations reference. Basic patterns (profile loading, simple recall/remember) are in project instructions. Consult this skill for background writes, memory versioning, complex queries, edge cases, session scoping, retention management, type-safe results, proactive memory hints, GitHub access detection, autonomous curation, episodic scoring, and decision traces.

113 4
Explore
oaustegard/claude-skills

orchestrating-agents

Orchestrates parallel API instances, delegated sub-tasks, and multi-agent workflows with streaming and tool-enabled delegation patterns. Use for parallel analysis, multi-perspective reviews, or complex task decomposition.

113 4
Explore
oaustegard/claude-skills

check-tools

Validates development tool installations across Python, Node.js, Java, Go, Rust, C/C++, Git, and system utilities. Use when verifying environments or troubleshooting dependencies.

113 4
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results