/code-intelligence:tree-sittingfrom code-intelligence
Navigates local codebases via tree-sitter ASTs: find symbol definitions, references, file symbols, and directory overview with exact line ranges. Use for 'where is X defined' or before editing unfamiliar files.
Ships in code-intelligence. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Tree-sitter symbol index over a local checkout. Every result carries line
ranges, so the next step is a scoped Read.
Needs Python 3.10+ and pip install tree-sitter. On macOS, /usr/bin/python3
is 3.9 and will not work; use a Homebrew or uv Python. Grammars are bundled
for Linux x86_64 (parsers/*.so) and macOS (parsers/*.dylib).
If a file's grammar doesn't load, the file is skipped and stderr prints
WARNING: no grammar for … with the fix. Resolve that before trusting an empty
result. On other platforms, run python3 scripts/build_grammars.py (needs git
and cc). It writes to $TREESIT_PARSERS_DIR, or ~/.cache/tree-sitting/parsers/
when that is unset, and grammars there take precedence over the bundle.
Installed tree-sitter-<lang> wheels are the last fallback.
scripts/treesit.py in this skill's directory scans the repo on every call
(cached on disk; invalidated when files or grammars change), prints a tree
overview, then answers the queries. Batch queries so one scan serves them all.
python3 scripts/treesit.py REPO # overview, depth 1
python3 scripts/treesit.py REPO --path=src/core --detail=full # drill in
python3 scripts/treesit.py REPO --no-tree 'find:Parser*' 'source:parse_input' 'refs:ParseState'
| Query | Returns |
|---|---|
find:PATTERN[:KIND[:LIMIT]] | symbols by name, substring or glob |
symbols:FILE | every symbol in a file |
source:SYMBOL[:FILE] | the symbol's source |
refs:SYMBOL[:LIMIT] | textual references |
imports:FILE | a file's imports |
dir:PATH | directory overview |
Flags: --depth N (-1 = all), --detail sparse|normal|full, --path DIR,
--skip DIRS, --no-tree, --stats, --no-cache, --rebuild-cache.
scripts/engine.py exposes CodeCache for use inside one Python process.
Languages: Python, JavaScript, TypeScript/TSX, Go, Rust, Ruby, Java, C, HTML,
Markdown (heading outline), Mojo. Other languages get generic extraction if
their tree-sitter-<lang> wheel is installed.
accessing-github-reposfeaturingexploring-codebasessearching-codebases --refsrgCHANGELOG.md (opens in a new tab)README.md (opens in a new tab)parsers/libtree_sitter_c.so (opens in a new tab)parsers/libtree_sitter_go.dylib (opens in a new tab)parsers/libtree_sitter_go.so (opens in a new tab)parsers/libtree_sitter_html.dylib (opens in a new tab)parsers/libtree_sitter_html.so (opens in a new tab)parsers/libtree_sitter_java.dylib (opens in a new tab)parsers/libtree_sitter_java.so (opens in a new tab)parsers/libtree_sitter_javascript.dylib (opens in a new tab)parsers/libtree_sitter_javascript.so (opens in a new tab)parsers/libtree_sitter_markdown.dylib (opens in a new tab)parsers/libtree_sitter_markdown.so (opens in a new tab)parsers/libtree_sitter_mojo.so (opens in a new tab)parsers/libtree_sitter_python.dylib (opens in a new tab)parsers/libtree_sitter_python.so (opens in a new tab)scripts/build_grammars.py (opens in a new tab)scripts/engine.py (opens in a new tab)scripts/server.py (opens in a new tab)scripts/treesit.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
JavaScript, TypeScript, Python, Go, Rust
tree-sitter, symbol-navigation, code-navigation, ast, local-codebase
14 skills in this plugin
/assessing-impactPre-change blast-radius report for a symbol or file. Walks tree-sitting references, augments with a plain-text scan over non-parsed files (configs, plain docs), and clusters affected sites by feature (`_FEATURES.md`) or top-level package. Use when about to refactor, rename, or delete something in a repo you don't own — "what breaks if I change `validateUser`", "who calls this", "is this safe to remove", "where is this used", "blast radius", "impact analysis". This is the CONVERGENT pre-change risk skill — for "what is this repo?" use exploring-codebases; for "where is X?" use searching-codebases./declaring-invariantsFind tests that enumerate a domain by copying it, and declare the invariants a codebase depends on. Reports where a parametrize list, for-loop, or it.each iterates a hand-written subset of a dict/set/tuple/Enum that exists in the source, and names the members nothing covers. Use when reviewing tests, when a module gains a name-to-thing table, registry, enum, or dispatch map, before trusting a green suite as evidence a domain is covered, or when asked "is this test actually total", "does anything cover X", "what does this repo guarantee", "which invariants do we declare". Also for vacuous tests that pass over an empty collection, for a domain that has silently NARROWED (an enumeration cannot see that), and for recording the refutation that proves a claim can fail./describing-productsBuilds a product description repo for a software product - prose documents that say, feature by feature and event by event, what the user sees, what they can do, and exactly what happens when they do it, including when they stop halfway. Drafted from the code and tests, verified against the running product with hand checklists, and triaged into a bug list. Works for canvas editors, web apps, CLIs, chat products, mobile apps, and libraries or SDKs. Use when asked to "write a product description for X", "describe the user experience of X", "document how X behaves for the user", "make a behavior-spec repo", or for an event-by-event account of an app's behavior rather than API docs. Also resumes or extends an existing product description repo./exploring-codebasesFirst-encounter orientation on a repository nobody here has worked in yet. Runs a fixed five-step workflow — venv setup, tarball fetch, tree-sitting structural scan, featuring synthesis, then reasoning over the two — and yields an account of what the repo contains and how it is arranged, optionally written out as _FEATURES.md. Use for "I just cloned this", "what is this repo", "what does this do", "explore this repo", "give me an orientation", "what are the main features", "review what's new in this repo", or before starting work in a codebase you have not seen. This is the divergent what's-here skill. Route elsewhere for: a named symbol, a file's structure or a line range (tree-sitting); all callers of a Python symbol (searching-codebases); teaching a human the codebase through exercises (orienting-codebases); fetching or cloning a repo without analysing it (accessing-github-repos, cloning-project)./featuringGenerate hierarchical _FEATURES.md files that describe what a codebase DOES from a user/consumer perspective, anchored to source symbols via tree-sitting. Supports large complex codebases through feature-driven decomposition into sub-feature files. Uses a multi-pass synthesis: orientation → detail → overview rewrite. Use when someone says "what does this do", "document features", "feature inventory", "_FEATURES.md", or needs to understand a codebase's purpose before modifying it. Complements tree-sitting (structural) with semantic (why/what-for) layer./hunting-failing-inputsFinds inputs that make a parser, decoder or WGSL compute shader index out of bounds or overflow, using Z3. Use for "can this crash", "find an input that breaks this", or when fuzzing found nothing on code that reads untrusted bytes.npx claudepluginhub oaustegard/claude-skills --plugin code-intelligenceOther plugins' skills for the same job