basemind turns any repo into an always-current map of its code, documents, history, and memory — so agents answer from instead of burning their context window on grep and file reads — and gives a...
Overview
basemind turns any repo into an always-current map of its code, documents, history, and memory — so agents answer from instead of burning their context window on grep and file reads — and gives a...
README
An agent reasoning from structure — a file outline and a call-site lookup in a live session, statusline tracking tokens saved.
What you get
basemind answers with file paths, line numbers, and signatures — not whole files — so a question about your code costs a small fraction of the tokens it takes to read the source.
| Capability | What it does | Key tools |
|---|---|---|
| Code intelligence | Read the code map instead of opening files: what a file contains (code_outline), where a name is defined (code_symbols), one symbol’s body or an exact line span (code_read), exact text search over code and text files, literal by default (code_grep), search by meaning over indexed chunks (code_search, needs --features code-search), and usages (code_refs): call sites of a name (matched by name), callers of one definition, implementors of a trait / interface / base class, importers of a module, the files importing a file (relation: "importers" with path, up to depth hops), the import cycles (relation: "cycles") over the resolved import graph, the HTTP calls reaching a route (a METHOD /path name, or a handler pinned by path), and go-to-definition (scope- and import-aware once a path pins the definition: JS/TS via oxc, Python & Java via in-tree stack-graphs). find_files locates or lists files, documents included, or with min_lines the code files too long to read whole, largest first. changed scopes code_grep, code_symbols, code_refs and find_files to the files a revision or A..B touched. Layered over 300+ languages. |
code_outline · code_symbols · code_read · code_grep · code_search · code_refs · find_files |
| Git intelligence | Ask what changed recently, which commits touched a file, which commit mentions a phrase (full-text over messages and authors at full branch depth), when a symbol’s body changed, who last touched a line or a function, and how a file differs between revisions or from the working tree, as text hunks or as symbols added and removed. | git_log · git_blame · git_diff |
| Memory & documents | A per-repo memory agents write to and search by meaning — clones of the same repo share it, unrelated repos stay separate — plus semantic search over PDFs, Office files, HTML, email, and images (OCR included in the published binaries, no extra setup; a source build needs the documents-ocr Cargo feature). |
memory_save · memory_search · docs_search |
| Agent comms | Threads opened by a post with a subject, open to the repository or invitation-only (to); a per-actor inbox whose reads mark messages read (peek does not); membership by principal, as for subagents; waits in the daemon (wait_secs). |
agent_post · agent_inbox · agent_threads |
| Index | Check index health and repo identity (including large_files: how many code files reach 2,000 lines, and the largest; and most_imported: the five files most others import), and refresh the index after edits. Telemetry and cache maintenance are CLI commands (basemind admin telemetry, basemind cache stats|gc|clear). |
index_status · index_rescan |
The code, git, memory, document and index rows are 15 tools, one per job, each with its own exact
schema; there is no mode argument. They are always loaded (_meta["anthropic/alwaysLoad"]), so a host that defers MCP tools
needs no tool-search round trip: call them directly. Their tools/list entry is about 20 KB (about
5k tokens). The three agent tools (comms builds) are deferred: a host finds them by tool search, and the session-start hook and the server instructions name them. An unknown argument is
rejected with a did-you-mean suggestion, every line number is 1-based, and a failure the caller can
fix comes back as an isError result that names the fix. Arguments, examples and the mapping from
the previous code / git / memory / admin tools: the
MCP tool reference and
docs/UPGRADING.md.
code_outline {"path":"src/store.rs"}
code_symbols {"name":"parse_config","kind":"function"}
code_read {"path":"src/store.rs","symbol":"open"}
code_grep {"pattern":"cache_root(","path":"src/"}
code_refs {"name":"open_store","path":"src/store.rs"}
git_log {"path":"src/store.rs","limit":5}
git_diff {"path":"src/store.rs","from":"HEAD~1","to":"HEAD"}
docs_search {"query":"how releases are versioned"}
Installation
Three ways to run basemind, easiest first. All three share the same local index and are safe to run side by side.
The MCP plugin downloads the basemind program for you on first use. Pi, the MCP-server, and CLI paths need it installed yourself — see Install the program.
1. As a plugin (recommended)
The curated plugin under plugin/ contains ten public skills and six commands for eleven runtime
profiles. See the plugin installation guide for local installation and release
prerequisites. The repository root also retains the existing OpenCode terminal adapter and Pi
extension; those integrations have separate package entry points.
Public skills only. Install the ten public skills independently:
npx skills add Goldziher/basemind
Discovery uses the root skills/ mirror. Maintainer governance and private agents are not included.
For the curated Pi package’s ten skills and six prompts, run pi install ./plugin from this checkout;
it carries no automatic context extension. The root Git package above retains the custom extension.
Local or development builds with the plugin. The launcher runs the release that matches the
plugin manifest. Set BASEMIND_BIN=/path/to/basemind to run your own build instead: it is honoured
whatever version it reports (the launcher logs a notice when that differs from the manifest’s), and it
wins over BASEMIND_FORCE_VERSION. A build on a different release minor resets the cache on first open
(wipe and rebuild). BASEMIND_FORCE_VERSION= pins the launcher to one published release
instead of the manifest’s.
2. As an MCP server
If your tool speaks MCP but you’re not using the plugin, install the program, then register it:
{
"mcpServers": {
"basemind": { "command": "basemind", "args": ["serve"] }
}
}
Each tool has a title and says whether it only reads or can change things, so your client can
auto-approve the safe ones and ask before the rest. The server also exposes three on-demand MCP
resources whose bodies equal the matching tool result: basemind://status,
basemind://outline/{path} and basemind://memory/{key}. If basemind isn’t found, use the full path
from which basemind.
3. As a CLI
The standalone program, for scripts, headless runs, and CI. Install it, then:
basemind scan # index the project once
basemind code symbols "parseQuery" # find a definition by name
basemind code refs "processFile" # find everywhere it's called
basemind git blame src/main.rs # who last changed each line
basemind watch # keep the index fresh as files change
Full command list in the CLI reference.
Install the program
The MCP and CLI paths need basemind available on your system. (The plugin does this for you.)
| Channel | Command | Includes |
|---|---|---|
| Homebrew | brew install Goldziher/tap/basemind |
everything |
| npm | pnpm add -g basemind |
everything |
| pip | pip install basemind |
everything |
| cargo | cargo install basemind --locked |
code + git only (the CLI; basemind serve needs --features comms) |
| cargo (full) | cargo install basemind --features full --locked |
everything |
| GitHub releases | Download a binary | everything |
The Homebrew / npm / pip / GitHub downloads are built with full — documents, OCR, named-entity
recognition, search, shared memory, and agent comms — so the first run downloads the models it
needs. The plain cargo install builds the code-map and git tools only: the one-shot CLI works, but
basemind serve relays to the daemon and so needs the comms feature (--features full has it).
A source build picks its document tiers by Cargo feature:
| Feature | Adds | In full |
|---|---|---|
documents |
Document search over local files: PDF (text layer), Office formats, spreadsheets, email, HTML, XML (SVG text is read as XML), Markdown/MDX and Jupyter notebooks, with chunking, language detection, quality scoring, keywords, extractive summaries, the cross-encoder reranker and embeddings. No OCR, no NER. | yes |
documents-ocr |
documents plus Tesseract OCR: raster images and scanned PDFs (no text layer). Runs implicitly, no configuration. |
yes |
documents-ner |
documents plus ONNX named-entity recognition (GLiNER): [documents.ner] and the entity filter of docs_search. |
yes |
documents-ocr-paddle |
documents-ocr plus PaddleOCR as an optional fallback stage. Source builds only. |
no |
--features documents alone no longer includes OCR or NER; use
--features "documents documents-ocr documents-ner" (or full) to keep both. Without
documents-ocr, raster images are not indexed as documents and a PDF with no text layer is indexed
with no text, with a warning naming the file and the feature. Without documents-ner,
[documents.ner] enabled = true has no effect and logs a warning, and docs_search with
entity returns an error naming the feature.
Get started
After installing, run basemind init (CLI) — or /bm-init if your tool supports slash
commands — from the repo root. It’s re-runnable and safe to call again later:
- Writes a commented
basemind.tomlscaffold at the repo root, if one doesn’t already exist. - Lets you pick which capabilities to advertise (interactive prompt in a TTY, or non-interactive
with
--yes,--with,--without). Capability slugs:code-search-navigation,code-mapping-architecture,git-history,file-finding,agent-comms,documents-rag,semantic-search. - Injects a “prefer basemind over grep/read/git” rules block. By default it never writes a committed
file unasked: with
.ai-rulez/config.tomlpresent it writes the gitignored.ai-rulez/local/rules/basemind-usage.md; otherwise a terminal run asks, defaulting to the personal, gitignoredCLAUDE.local.md, and a scripted run writesCLAUDE.local.md(orAGENTS.local.mdin a repo that has anAGENTS.mdand noCLAUDE.md). It adds the file to.gitignore. The block is delimited (/) so re-running replaces it in place instead of duplicating it.
Preview changes without writing with --print; skip the rules step with --no-rules; steer the
target explicitly with --rules-target
(the committed CLAUDE.md, AGENTS.md and .ai-rulez/rules/basemind-usage.md are explicit opt-ins).
--settings-target adds basemind’s tools to Claude Code’s auto-approved
permissions; a non-interactive run skips that unless you pass the flag.
Demos
The same engine from the CLI — scan, then symbol / reference / blame queries.
Searching documents by meaning, not keywords, across PDFs, Office files, HTML and email.
Multi-agent code-review panel: named reviewers coordinate in a repo-scoped thread (post, reply, synthesize) — entirely over basemind agent.
How it works
Token saving
Performance
Configuration
CLI reference
License
MIT — see LICENSE.
Install
npx skills add Goldziher/basemindConfiguration
{
"mcpServers": {
"basemind": { "command": "basemind", "args": ["serve"] }
}
}