splinter

Fn-level code index over MCP, with durable per-file agent memory. Load one function at a time instead of whole files; search across all functions in one call.
Install
/plugin marketplace add yesitsfebreeze/splinter
/plugin install splinter@yesitsfebreeze
No toolchain needed — on first run the plugin downloads the prebuilt binary for your platform (linux x86_64/aarch64, macOS x86_64/aarch64) and caches it. Language grammars download the same way: the first time a language is indexed, its tree-sitter grammar is fetched once and cached machine-wide (see Languages). Other platforms: build from source.
Use it by default
The plugin makes Claude index-first automatically — two layers, no setup:
- The skill is auto-discovered, so Claude knows the tools and when to use them.
- A
SessionStart hook injects the navigation rule each session: navigate with search_bodies/open_source/read_splinter → read_body, and only Read/Grep the whole file if that isn't enough. Non-blocking — it never prevents a read, just orders them.
Optional extra reinforcement — add a line to your project CLAUDE.md:
Use the `splinter` MCP tools to explore code (the splinter skill): `open_source` → function
map, `read_body` → one function, `search_bodies` → grep, `read_splinter`/`write_splinter` →
per-file memory. Edit the source; the index follows.
How it works
src/parser.rs → .splinter/src/parser.skel.rs skeleton (bodies replaced by // §<ref>)
.splinter/src/parser.splinter.md agent memory
.splinter/src/parser/parse.fs one file per function
.splinter/src/parser/load.fs
- Source is truth;
.splinter/ is a derived cache. One-way watcher: source change → re-split.
- Splitting parses each file with its language's tree-sitter grammar; a per-language query defines what counts as a function (see Languages). No LSP, no live server — parse once at split time, then everything is static files.
.fs bodies are read-only — edit the source. Body line 1 (// §head src/parser.rs:42-89 parse) maps back to source lines; an optional // §sig … line follows with the function's declaration. Marker lines never count as code.
*.splinter.md is durable memory: created once, never overwritten by re-splitting, committed via the .gitignore carve-out below.
Tools
| Tool | Does |
|---|
index_dir(src_dir) | Bootstrap: split a whole tree, every installed language at once (skips hidden / build / vendor dirs) |
open_source(path) | Function list (with signatures) by size + the file's splinter note |
read_body(path) | One function body (.fs path — absolute, repo-relative, or index-relative) |
search_bodies(query) | Ripgrep across all functions; hits map back to source:line [fn] |
grep_files(query) | Ripgrep raw source under a root; hits attributed to the owning fn — finds even unindexed files |
search_names(query) | Ripgrep over function names + source paths (not content); returns paths, token-cheap |
ref_graph(path) | Call graph: callers (in) + callees (out) for a fn name or .fs body |
list_bodies(dir) | Functions in a dir, by size |
find_large() | Functions over SPLINTER_MAX_LOC |
read_splinter / write_splinter | Read / write per-file memory |
list_languages() | Installed languages |
Also: split, dry_run_split, grep_source, validate, body_stats, diff_body, outline.
Search is powered by ripgrep's own crates (grep + rayon), run in parallel across the index — same matcher quality as rg, with splinter's fn-level attribution on top.
Config
Env vars or a committable splinter.ini (env > ini > default).
| Variable | Default | Purpose |
|---|
SPLINTER_SRC_DIR | src | Watched source dir |
SPLINTER_EXT | all installed languages | Restrict indexing/watching to a comma-separated extension list |
SPLINTER_MAX_LOC | 256 | ⚠ / find_large threshold |
SPLINTER_DEBOUNCE_MS | 500 | Watcher debounce |
SPLINTER_EXCLUDE | — | Extra dir names to skip while indexing (comma-separated; hidden/target/node_modules are always skipped) |
Languages
splinter includes tree-sitter and handles languages automatically: rs, py, odin, go, php, html, cpp (+ c/headers), js (+ jsx/mjs/cjs), ts (+ tsx/mts/cts), java, cs, kt (+ kts), swift, sh (+ bash), lua, rb, sql — nothing to install or configure per language.