agent-brain-init

A command that creates the configuration and data directory needed to use Agent Brain in a project. Agent Brain is a local service that indexes project content for searching.

In plain words
What is it for?
Use it to initialize the detected project or a specified path, choose a server host or port, set a custom data directory, or output results as JSON.
Why use it?
It separates each project's settings and indexed data, reducing setup work and avoiding configuration being mixed between projects.

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/spillwavesolutions/agent-brain/agent-brain-init
Clone the repo
git clone --depth 1 https://github.com/SpillwaveSolutions/agent-brain
Per session 12 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,622 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00012 $0.01622
Opus 5 $0.00006 $0.00811
Sonnet 5 $0.00002 $0.00324
Haiku 4.5 $0.00001 $0.00162

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

Security

Grade C, and why

agent-brain-init scanned grade C with 1 finding 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- Reset with: rm -rf .agent-brain && agent-brain init
agent-brain-plugin/commands/agent-brain-init.md · 269 lines

How it starts

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

Initialize Agent Brain Project

Purpose

Initializes the current project for Agent Brain by creating the necessary configuration directory and files. This sets up per-project isolation, allowing each project to have its own Agent Brain instance with separate configuration and data.

Usage

/agent-brain:agent-brain-init [--path <path>] [--host <host>] [--port <port>] [--force] [--state-dir <dir>] [--json]

Parameters

Parameter Required Default Description
--path / -p No Auto-detect Project path (auto-detects git root or project markers)
--host No 127.0.0.1 Server bind host
--port No Auto-select Preferred server port (disables auto-port if set)
--force / -f No false Overwrite existing configuration
--state-dir / -s No .agent-brain Custom state directory for index data
--json No false Output as JSON

Examples

/agent-brain:agent-brain-init
/agent-brain:agent-brain-init --path /my/project
/agent-brain:agent-brain-init --port 8080
/agent-brain:agent-brain-init --state-dir /custom/path
/agent-brain:agent-brain-init --force

Execution

Run Initialization

agent-brain init
agent-brain init --path /my/project
agent-brain init --port 8080
agent-brain init --state-dir /custom/path
agent-brain init --force

This creates the .agent-brain/ directory structure in the project root.

Verify Initialization

ls -la .agent-brain/

Output

Agent Brain Initialization
==========================

Initializing Agent Brain for current project...

Running: agent-brain init

Created directory structure:
  .agent-brain/
    config.json      - Project configuration
    chroma_db/       - Vector store (created on first index)
    bm25_index/      - Keyword index (created on first index)

Project initialized successfully!

Configuration file: .agent-brain/config.json
{
  "project_name": "my-project",
  "created_at": "2025-01-31T12:00:00Z",
  "mode": "project"
}

Next steps:
  1. Start server: /agent-brain:agent-brain-start
  2. Index documents: /agent-brain:agent-brain-index ./docs
  3. Search: /agent-brain:agent-brain-search "your query"

Read the full file on GitHub · 269 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 · 269 lines · 12 tokens per session scan C 20c943df7eda

Subscribe to this mod's changes

agent-brain-init is a command published in the GitHub repository SpillwaveSolutions/agent-brain (117 stars, last pushed 3d ago), licensed MIT. It adds 12 tokens to every session and 1,622 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.