Claude Skill MartBrowse skillsWhat is a Skill?
Back to list

Smart Explore (Structural Code Search)

Explore codebases with tree-sitter AST parsing — index first, fetch details on demand, and cut token usage several-fold.

Dev & CodingIntermediate90,1397,846AI score 8/10Last updated: Aug 9, 2026

What it does

Instead of reading whole files, this skill makes Claude follow a 3-layer AST-based workflow:

  1. smart_search — walks a directory, returns ranked symbols (functions/classes/methods) with line numbers plus folded file views (~2–6k tokens)
  2. smart_outline — the structural skeleton of one file: functions, classes, properties, imports (~1–2k tokens)
  3. 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 only performGracefulShutdown to read the core logic.
  • Navigate a huge file: outline worker-service.ts (1,466 tokens → 12 functions, 24 class members), then unfold just startSessionProcessor — ~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)
  1. Download the ZIP with the button below.
  2. In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
  3. Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Download 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.

  1. Open a terminal and clone the repo: git clone https://github.com/thedotmack/claude-mem.git
  2. Create the skills folder: mkdir -p ~/.claude/skills
  3. Copy the skill in: cp -r claude-mem/plugin/skills/smart-explore ~/.claude/skills/
  4. 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.
  5. Restart Claude Code and run /mcp to confirm smart_search, smart_outline, and smart_unfold are available.
  6. From a project directory, try: "use smart-explore to find shutdown-related code in ./src".
  7. (Optional) For languages that aren't bundled, add a .claude-mem.json at the project root declaring the tree-sitter npm package, file extensions, and a query file.
View source on GitHubLicense: Apache-2.0