Smart Explore (Structural Code Search)
Explore codebases with tree-sitter AST parsing — index first, fetch details on demand, and cut token usage several-fold.
What it does
Instead of reading whole files, this skill makes Claude follow a 3-layer AST-based workflow:
- smart_search — walks a directory, returns ranked symbols (functions/classes/methods) with line numbers plus folded file views (~2–6k tokens)
- smart_outline — the structural skeleton of one file: functions, classes, properties, imports (~1–2k tokens)
- smart_unfold — the full source of a single symbol, including JSDoc and decorators (~0.4–2.1k tokens)
One search call replaces the Glob → Grep → Read discovery loop, and because slices follow AST node boundaries, long methods are never truncated. The doc includes a token table claiming 4–8x savings vs Read and 11–18x vs an Explore agent.
JS/TS/TSX, Python, Go, Rust, Ruby, Java and C/C++ grammars ship bundled; extra tree-sitter grammars (e.g. Solidity) can be registered in .claude-mem.json. Markdown gets special treatment: heading-based outlines, section unfolds, and visible YAML frontmatter.
Who it's for
- Developers working in large repos who keep hitting context limits
- Anyone who needs to locate a feature scattered across many files before refactoring or debugging
- Teams trying to cut real token spend
- Tech writers producing docs or onboarding guides from source
Examples
- Trace a feature:
smart_search(query="shutdown", path="./src")surfaces 14 symbols across 7 files, then unfold onlyperformGracefulShutdownto read the core logic. - Navigate a huge file: outline
worker-service.ts(1,466 tokens → 12 functions, 24 class members), then unfold juststartSessionProcessor— ~3k tokens total instead of ~12k for a full Read. - Hybrid doc writing: use smart_* tools for code, plain Read for small JSON/Markdown config and plan files, then draft architecture docs.
Note: the skill itself tells you to fall back to Grep for exact string/regex hunts, Read for files under ~100 lines, and the Explore agent when you need narrative synthesis across 6+ files.
· · · Install guide · · ·
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the plugin/skills/smart-explore folder from the GitHub repo thedotmack/claude-mem into my ~/.claude/skills/smart-explore/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/thedotmack/claude-mem.git /tmp/claude-mem && mkdir -p ~/.claude/skills && cp -r /tmp/claude-mem/plugin/skills/smart-explore ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal and clone the repo:
git clone https://github.com/thedotmack/claude-mem.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill in:
cp -r claude-mem/plugin/skills/smart-explore ~/.claude/skills/ - Required — the skill only loads instructions; the actual tools come from the claude-mem plugin's MCP server. Follow the repo README to install the plugin/MCP server and connect it to Claude Code.
- Restart Claude Code and run
/mcpto confirmsmart_search,smart_outline, andsmart_unfoldare available. - From a project directory, try: "use smart-explore to find shutdown-related code in ./src".
- (Optional) For languages that aren't bundled, add a
.claude-mem.jsonat the project root declaring the tree-sitter npm package, file extensions, and a query file.