bm-scan

bm-scan is a command for coding agents from Goldziher/basemind. It costs 47 tokens per session (377 once invoked), scanned A, original, MIT.

A command that builds or refreshes the Basemind code index, which is a searchable map of files and code in a project. It can scan the whole working tree or a specified path.

In plain words
What is it for?
It is for running a full or path-specific Basemind scan from the command line. It also provides alternatives when the Basemind executable is not on the system path.
Why use it?
It helps when Basemind has no index, incomplete results, or outdated information after large code changes. It reports what was scanned, updated, or skipped.

Command

Part of the basemind plugin — 15 skills, 10 commands, 6 agents, 2 hooks, 1 MCP server shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/goldziher/basemind/bm-scan
Clone the repo
git clone --depth 1 https://github.com/Goldziher/basemind

Or install basemind, the plugin that ships this one along with the rest of its 15 skills, 10 commands, 6 agents, 2 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bm-scan

README.md
[![agentmods](https://agentmods.dev/badge/commands/goldziher/basemind/bm-scan.svg)](https://agentmods.dev/commands/goldziher/basemind/bm-scan)
Your own site
<a href="https://agentmods.dev/commands/goldziher/basemind/bm-scan"><img src="https://agentmods.dev/badge/commands/goldziher/basemind/bm-scan.svg" alt="Measured on agentmods" height="20"></a>
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 377 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00047 $0.00377
Opus 5 $0.00023 $0.00188
Sonnet 5 $0.00009 $0.00075
Haiku 4.5 $0.00005 $0.00038

Measured 4d ago against content hash 87b14366c071, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bm-scan scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.codex-plugin/commands/bm-scan.md · 39 lines

What it actually says

bm-scan — build or refresh the basemind index

Run basemind scan via the CLI so the code map exists and is current.

When to use

basemind (or its statusline) reports "no index" / "no indexed files", an MCP tool returns empty results that shouldn't be empty, or the index is stale after large changes.

How to use

basemind scan ${ARGUMENTS:-}
  • No argument → full working-tree scan.
  • A path argument (/bm-scan src/mcp) → scope the scan to that path (incremental).
  • If basemind isn't on PATH: use the plugin-managed cache (${XDG_CACHE_HOME:-~/.cache}/basemind/bin/<version>/basemind), or build a dev binary with cargo build --release and use ./target/release/basemind.

Notes

  • Report files scanned / updated / skipped and elapsed time. Non-extractable files are skipped, not failures.
  • If a basemind serve MCP server already holds the store lock for this repo, scan errors on the lock — use admin { mode: "rescan" } over MCP instead, or stop the server first.

See also

The basemind-scan skill for the full workflow, binary-resolution order, and extra_roots config for indexing directories outside the repo.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 39 lines · 47 tokens per session scan A 87b14366c071

Subscribe to this mod's changes

bm-scan is a command published in the GitHub repository Goldziher/basemind (91 stars, last pushed 8d ago), licensed MIT. It adds 47 tokens to every session and 377 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.