basemind-scan
Skill125 starsChanged 47 days agoMITView on GitHub
Build or refresh the basemind index by running `basemind scan` via the CLI. Use this when basemind reports "no index" / "no indexed files", or when `index_status` reports `degraded` or `rescan_needed`. Works without the MCP server — it shells the basemind binary directly.
- Reads credentials
In this repository10 other files it gives its agents.
- llms.txtllms.txt
- basemind-cliSkill
- basemind-code-searchSkill
- basemind-commsSkill
- basemind-doctorSkill
- basemind-documentsSkill
- basemind-git-historySkill
- basemind-multi-agent-roomSkill
- basemindSkill
- basemind-statsSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
Not for a healthy index that misses a file you just created: run basemind rescan <path> (or index_rescan {"paths":[…]}) for that file.
- Very specific: line 70
If a daemon is running, scan is forwarded to it and prints scan via daemon.
- Very specific: line 91
After a successful scan, both the MCP tools and basemind code … have a fresh index.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!--
AI-RULEZ :: GENERATED FILE — DO NOT EDIT
Content-Hash: blake3:fa2b9f49ce3d009ebfecf51f1748703195fde17ec79c0de5ab39afb36097e508
Source-Hash: blake3:607e3840e47d250c023513008342b4e723eff1841b0530d2a109acaf0dc5dbc6
Schema-Version: v1
-->basemind-scan — build or refresh the index (no MCP server required)
basemind answers code-map questions from an index in a machine-global cache (Linux
~/.local/share/basemind/, macOS ~/Library/Application Support/basemind/; override
BASEMIND_DATA_HOME), keyed by workspace. That index is built by
basemind scan. This skill runs the scan via the CLI, so it works even when the MCP server
(basemind serve) is not running — which is exactly the situation when basemind reports
"no index" or "no indexed files", or when MCP tools aren't loaded in the session.
When to use
- basemind / the statusline reports no index for this repo.
- An MCP tool returns "no indexed files".
- The MCP server isn't running or isn't reachable and the index is missing or unhealthy. A healthy
cached index still answers CLI queries (
basemind code …) without a scan. index_statusreportsdegradedorrescan_needed: trueand you want a full rebuild. Either one qualifies: a scan that stops after writing the code map setsdegradedalone.- Files under
scan.extra_rootschanged: only a full scan re-indexes them (rescan <path>skips them). With a livebasemind serveholding the lock,index_rescan {}is the full pass; with a standalonebasemind watch, stop it, runbasemind scan, then restart it.
Not for a healthy index that misses a file you just created: run basemind rescan <path> (or
index_rescan {"paths":[…]}) for that file. A running server already re-indexes the files you edit
in the repository; it does not watch scan.extra_roots.
How to run
From the repository root:
basemind scan # full working-tree scan
basemind rescan <path> # re-index only these paths (incremental)Finding the binary (in order of preference). The plugin runs its own version-matched binary, so
use it first: a bare basemind from PATH can be a different version over the same cache.
- The plugin launcher, which installs and execs the version-matched binary:
${CLAUDE_PLUGIN_ROOT}/scripts/mcp-launch.sh scan(in other hosts,scripts/mcp-launch.shin the plugin directory). Its binary is cached at${XDG_CACHE_HOME:-~/.cache}/basemind/versions/<version>/basemind. - Fallback when no plugin launcher exists:
basemindonPATH. - A dev build:
cargo build --releasethen./target/release/basemind scan.
Notes
- The scan writes the content-addressed blob store + Fjall inverted index into the machine-global cache (never inside the repo). Seconds for small repos; ~22 s for an ~80k-file TypeScript monorepo.
- The code map (outline, symbols, refs) covers code only. Markdown, JSON, YAML, TOML, XML, CSV, INI
and similar prose/config/data files go to the document tier instead: chunked for
docs_search(search by meaning), never incode_symbolsorcode_outline, butcode_grepfinds exact text in them andfind_fileslists them. Anything that is neither code nor an extractable document is skipped, not counted as a failure. Existing indexes migrate on the next scan, which also reclaims stale blobs (cleanup: reclaimed N orphaned blob(s)). - If a daemon is running,
scanis forwarded to it and printsscan via daemon; it never starts one. A flag the daemon cannot apply (--rebuild-git-history, a--documents-*/--llm-*override) exits 2 naming it. Another process holding the store lock (basemind watch, another scan) makesscanexit 3 and name the holder; stop a standalone watcher, scan, then restart it. - Indexing directories outside the repo — set
scan.extra_rootsin the repo-rootbasemind.tomlto a list of absolute paths (e.g. a Bazel external repo cache) to index them alongside the repo. This needsBASEMIND_ALLOW_EXTRA_ROOTSin the environment that launches basemind (1, or a:-separated list of absolute workspace roots to grant only those): the config file lives inside the repository, so without that operator opt-in the entries are ignored with a warning. A filesystem or volume root and credential directories (.ssh,.aws,.gnupg,/etc) are refused either way. Their files are keyed by absolute path (so results for them are absolute, not repo-relative) and are (re-)indexed on a fullscanonly — the live watcher does not track them. Git tools (blame) don't apply to external files; the code map (symbols / usages / outlines) and document search do. - Credential and key files (
.env*,.aws/,.ssh/,.npmrc,*.pem,*.key, ...) are never indexed.[scan] floor_allowopts a class back in (.env.*also matches.env.example), but a credential entry needsBASEMIND_ALLOW_REPO_CREDENTIALSin the environment that launches basemind — a repository's own file cannot un-exclude your secrets.[languages.<grammar>]re-maps or disables a misdetected grammar. - After a successful scan, both the MCP tools and
basemind code …have a fresh index. - The CLI shares the exact same machine-global cache as the MCP server — see the
basemind-cliskill for the full query surface, orbasemind-code-search/basemind-git-history/basemind-documentsfor the per-capability workflows.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

