brainctl: Instructions file for Claude Code

CLAUDE.md

brainctl CLAUDE.md is an instructions file for Claude Code from TSchonleber/brainctl. It costs 6,298 tokens per session, scanned B, original, MIT.

Project instructions for brainctl, an agent-memory system that stores information in a database and provides command-line and MCP access. MCP is a standard way for an AI agent to use external tools.

In plain words
What is it for?
It helps maintain and use the brainctl and agentmemory codebase, including its database, command-line program, MCP server, and project-specific setup.
Why use it?
It gives developers one reference for the system's files, database, build and test process, migrations, and available tools.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: positional $N argument; mentions Claude Code.

This is TSchonleber/brainctl's own configuration. It tells Claude Code how to work on brainctl itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything brainctl configures →

Reuse

Borrowing it

Nothing to install: this file belongs to TSchonleber/brainctl. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/TSchonleber/brainctl/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/TSchonleber/brainctl

Made for: Claude Code.

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 brainctl CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/tschonleber/brainctl/claude-md/github.svg)](https://agentmods.dev/instructions/tschonleber/brainctl/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/tschonleber/brainctl/claude-md"><img src="https://agentmods.dev/badge/instructions/tschonleber/brainctl/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for brainctl CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tschonleber/brainctl/claude-md"><img src="https://agentmods.dev/badge/instructions/tschonleber/brainctl/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 6,298 This file is loaded in full into every session.
When invoked 6,298 The same file — it is already loaded in full.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.06298 $0.06298
Opus 5.5 $0.02519 $0.02519
Sonnet 5.5 $0.01260 $0.01260
Haiku 4.5 $0.00630 $0.00630

Measured 7d ago against content hash 43449d64f6eb, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

brainctl CLAUDE.md scanned grade B 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 7d 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.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

non-custodial keypair at `~/.brainctl/wallet.json` (chmod 0600). The
CLAUDE.md · 440 lines

How it starts

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

Claude Code — brainctl / agentmemory

What This Is

Unified agent memory system. SQLite-backed (brain.db) with FTS5, vector embeddings (sqlite-vec + Ollama nomic-embed-text), knowledge graph, affect tracking, belief collapse mechanics, and AGM conflict resolution.

Published as brainctl on PyPI (v2.2.1+, current 2.9.1).

Key Paths

  • DB: db/brain.db (WAL mode, foreign keys ON, 59 user-facing tables, 84 numbered migrations, 002–085 with no gaps, plus the unnumbered V2-4 file db/migrations/quantum_schema_migration_sqlite.sql). The runner only picks up files matching ^\d+_.+\.sql$, so brainctl migrate never applies the quantum file; its quantum columns (confidence_phase, hilbert_projection, coherence_syndrome, decoherence_rate, is_superposed, belief_density_matrix, coherence_score, ...) and belief_collapse_events ship in init_schema.sql instead. Slot 050 is 050_thalamus.sql.
  • CLI: bin/brainctl — main CLI entry
  • MCP server: the brainctl-mcp console script points at agentmemory.mcp_entrypoint:run, which prints the pip install 'brainctl[mcp]' hint when the MCP extra is missing and otherwise delegates to agentmemory.mcp_server:run (also runnable as python -m agentmemory.mcp_server). As of v2 surface consolidation (2026-05-20): 100 visible tools (370 registered internally; 270 hidden behind action-discriminated dispatchers). Installed as the brainctl-mcp console script via pip. See MCP_SERVER.md for the tool reference and docs/TOOL_MIGRATION_V2.md for v1→v2 migration. The legacy standalone bin/brainctl-mcp script was removed after 2.8.1; use the console script.
  • Bench: bin/brainctl-bench — retrieval eval harness (P@k / MRR / nDCG@k regression gate, fixtures under tests/bench/)
  • Source: src/agentmemory/ — Python package
  • Config: config/ — quiet hours, consolidation schedules
  • Agents: agents/ — per-agent config (pipeline, engram, etc.)

Build & Test

pip install -e .                                      # dev install
brainctl stats                                        # verify DB
brainctl search "test"                                # test search
python3 -m agentmemory.mcp_server --list-tools        # 100-tool v2 MCP surface
python3 -m tests.bench.run                            # retrieval quality benchmark
python3 -m tests.bench.run --check                    # fail on >2% regression vs baseline

Read the full file on GitHub · 440 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. 7d ago Changed · +4 tokens per session 43449d64f6eb
  2. 14d ago Changed · +1 lines · +182 tokens per session 766d491055dd
  3. 2mo ago First seen · 439 lines · 6,112 tokens per session scan B ad0a78853454

Subscribe to this mod's changes

brainctl CLAUDE.md is an instructions file published in the GitHub repository TSchonleber/brainctl (78 stars, last pushed 8d ago), licensed MIT. It adds 6,298 tokens to every session, about $0.0252 per session on Opus 5.5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

brainctl CLAUDE.md compared with instructions from other repositories

brainctl CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
brainctl CLAUDE.mdTSchonleber/brainctlInstructions file788d agoMITB6,298Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode