bm-init

A setup command for adding Basemind configuration and usage instructions to a repository. Basemind is a context service that provides coding-agent tools such as code search, document retrieval, and Git history.

In plain words
What is it for?
Use it when first enabling Basemind or refreshing its configuration, choosing which capabilities to enable and which personal or shared rules file should contain the instructions.
Why use it?
It gives agents a consistent way to use Basemind in the project and can refresh the setup when enabled capabilities change.

Command

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-init
Clone the repo
git clone --depth 1 https://github.com/Goldziher/basemind
Per session 68 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 931 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.00068 $0.00931
Opus 5 $0.00034 $0.00465
Sonnet 5 $0.00014 $0.00186
Haiku 4.5 $0.00007 $0.00093

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

Security

Grade A, and why

bm-init 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 2d 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-init.md · 72 lines

How it starts

The opening of the file, as written. The whole thing — 72 lines — stays where its author put it; the contents beside it link to each section on GitHub.

bm-init — onboard basemind into this repo

Run basemind init so the repo has a committed basemind.toml and a rules block that tells every agent to prefer basemind's MCP tools over grep, file reads, and naked git. CLI and slash command share ONE implementation — this just drives basemind init with the right non-interactive flags.

When to use

First time setting up basemind in a repo, or to refresh the rules block after enabling new capabilities (documents/RAG, agent-comms, semantic search). Safe to re-run: it's idempotent.

How to use

  1. Ask which capabilities matter (one short question). The options are: code-search-navigation, code-mapping-architecture, git-history, agent-comms, documents-rag, semantic-search. If the user has no preference, enable all.

  2. Ask where the rules block should go — do NOT assume. Never write a committed CLAUDE.md or AGENTS.md without the user's explicit say-so. Present the choice:

    • CLAUDE.local.md — personal, gitignored (recommended default)
    • AGENTS.local.md — personal, gitignored (for AGENTS-based tools)
    • CLAUDE.md — committed, shared with everyone on the repo
    • AGENTS.md — committed, shared with everyone on the repo
    • none — write no rules

    Exception: if .ai-rulez/config.toml is present, ai-rulez owns governance — write the ai-rulez rule file instead of asking (it never touches CLAUDE.md/AGENTS.md).

  3. Run basemind init non-interactively with the matching flags. Pass the user's rules choice via --rules-target <claude-local|agents-local|claude|agents|ai-rulez|none> (default auto resolves to the gitignored local file, never a committed one):

    basemind init --yes --rules-target claude-local
    

    Narrow capabilities with repeatable --with (allow-list) or --without (subtract):

    basemind init --yes --rules-target claude-local --with code-search-navigation --with git-history
    

    Preview without writing using --print.

Read the full file on GitHub · 72 lines

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. 2d ago First seen · 72 lines · 68 tokens per session scan A e1e0eaa4ae4c

Subscribe to this mod's changes

bm-init is a command published in the GitHub repository Goldziher/basemind (91 stars, last pushed 6d ago), licensed MIT. It adds 68 tokens to every session and 931 once invoked, about $0.0003 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.