agent-brain-index

agent-brain-index is a command for coding agents from SpillwaveSolutions/agent-brain. It costs 10 tokens per session (1,723 once invoked), scanned A, original, MIT.

A command that builds searchable indexes from documents and, optionally, code files. Semantic search finds related meaning, while keyword search matches exact words.

In plain words
What is it for?
Use it to index a file or folder of Markdown, PDF, text, or code files, with options for file types, languages, folder depth, chunk size, and code splitting.
Why use it?
It makes large collections easier to search and only reprocesses files that changed during later indexing runs.

Command

Part of the agent-brain-plugin plugin — 29 commands, 3 agents 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/spillwavesolutions/agent-brain/agent-brain-index
Clone the repo
git clone --depth 1 https://github.com/SpillwaveSolutions/agent-brain

Or install agent-brain-plugin, the plugin that ships this one along with the rest of its 29 commands, 3 agents.

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 agent-brain-index

README.md
[![agentmods](https://agentmods.dev/badge/commands/spillwavesolutions/agent-brain/agent-brain-index.svg)](https://agentmods.dev/commands/spillwavesolutions/agent-brain/agent-brain-index)
Your own site
<a href="https://agentmods.dev/commands/spillwavesolutions/agent-brain/agent-brain-index"><img src="https://agentmods.dev/badge/commands/spillwavesolutions/agent-brain/agent-brain-index.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,723 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.00010 $0.01723
Opus 5 $0.00005 $0.00861
Sonnet 5 $0.00002 $0.00345
Haiku 4.5 $0.00001 $0.00172

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

Security

Grade A, and why

agent-brain-index 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.

agent-brain-plugin/commands/agent-brain-index.md · 212 lines

How it starts

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

Index Documents

Purpose

Indexes documents at the specified path for semantic search. Processes markdown, PDF, text, and optionally code files. Creates vector embeddings for semantic search and builds the BM25 index for keyword search. Supports incremental indexing — only changed files are re-processed on subsequent runs.

Usage

/agent-brain:agent-brain-index <path> [options]

Parameters

Parameter Required Default Description
path Yes - Path to documents (file or directory)
--include-code No false Include code files (.py, .ts, .js, .java, etc.)
--include-type No - File type presets (e.g., python,docs,typescript). Use agent-brain types list to see all.
--chunk-size No 512 Target chunk size in tokens
--chunk-overlap No 50 Overlap between chunks in tokens
--no-recursive No false Don't scan subdirectories
--languages No - Comma-separated language list for code files
--code-strategy No ast_aware Code splitting strategy: ast_aware or text_based
--include-patterns No - Additional glob include patterns
--exclude-patterns No - Additional glob exclude patterns
--generate-summaries No false Generate LLM summaries for better search quality
--force No false Force re-indexing (bypass manifest, evict all prior chunks)
--allow-external No false Allow indexing paths outside the project directory
--json No false Output results as JSON

Examples

/agent-brain:agent-brain-index docs/
/agent-brain:agent-brain-index ./src --include-code
/agent-brain:agent-brain-index ./project --include-type python,docs
/agent-brain:agent-brain-index ./src --include-type typescript --include-patterns "*.json"
/agent-brain:agent-brain-index ./docs --force
/agent-brain:agent-brain-index ./src --include-code --chunk-size 1024 --generate-summaries
/agent-brain:agent-brain-index ./src --allow-external

Read the full file on GitHub · 212 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. 4d ago First seen · 212 lines · 10 tokens per session scan A 4d180d9e686f

Subscribe to this mod's changes

agent-brain-index is a command published in the GitHub repository SpillwaveSolutions/agent-brain (117 stars, last pushed 4d ago), licensed MIT. It adds 10 tokens to every session and 1,723 once invoked, about $0.0001 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.