thebrain-mcp: Instructions file for Claude Code

CLAUDE.md

thebrain-mcp CLAUDE.md is an instructions file for Claude Code from yBookoff/thebrain-mcp. It costs 2,857 tokens per session, scanned A, original, MIT.

Working instructions for an MCP server that connects to TheBrain 15, a personal knowledge-management application, through its local API.

In plain words
What is it for?
Use it to implement or maintain tools that read and change TheBrain data while requiring an explicit brain identifier and consent for irreversible actions.
Why use it?
They help prevent ambiguous updates, accidental deletion, truncated notes, and writes to the wrong knowledge base.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths.

This is yBookoff/thebrain-mcp's own configuration. It tells Claude Code how to work on thebrain-mcp 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 thebrain-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to yBookoff/thebrain-mcp. 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/yBookoff/thebrain-mcp/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/yBookoff/thebrain-mcp

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 thebrain-mcp CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/ybookoff/thebrain-mcp/claude-md/github.svg)](https://agentmods.dev/instructions/ybookoff/thebrain-mcp/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/ybookoff/thebrain-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/ybookoff/thebrain-mcp/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 thebrain-mcp CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ybookoff/thebrain-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/ybookoff/thebrain-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,857 This file is loaded in full into every session.
When invoked 2,857 The same file — it is already loaded in full.
Security scan A 0 findings. 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.02857 $0.02857
Opus 5.5 $0.01143 $0.01143
Sonnet 5.5 $0.00571 $0.00571
Haiku 4.5 $0.00286 $0.00286

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

Security

Grade A, and why

thebrain-mcp CLAUDE.md 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 13d 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.

CLAUDE.md · 201 lines

How it starts

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

thebrain-mcp — working notes for Claude

An MCP server for TheBrain 15, built on its local API.

ARCHITECTURE.md carries the reasoning and the shortcuts that are forbidden; docs/api-map.md carries what the API does, with the measurements (rows L1…). Read the first before a non-trivial change. This file is the short form — the rules that bite.

Invariants

These are not preferences. Breaking one is a bug even if the tests pass.

  1. brainId is explicit on every tool. Never infer the active brain from app/state. Writing into whichever brain the user happens to have open is the worst failure this project can produce.
  2. Bad input is isError: true inside the result, never a JSON-RPC error. The model sees the former and can recover; the latter is invisible to it. guard() in src/server/respond.ts enforces this — keep handlers inside it.
  3. Nothing irreversible without human consent, and a failed consent request counts as refusal. Deletion is additionally gated behind THEBRAIN_ALLOW_DESTRUCTIVE=1.
  4. Notes are never truncated on read. A truncated note silently corrupts the agent's picture of what is already recorded.
  5. After a write, address thoughts by identifier, never by name. findByName lags creation by ~5.6 s.
  6. No LLM calls inside the server. Judgement belongs to the calling agent, which can see the conversation. The server stays deterministic and testable.
  7. The server holds no methodology. Heuristics about how to decompose material belong in skills/*/SKILL.md, not in code.

What it is built for

One agent; tool calls one after another, a few per message; brain_ingest plans of up to about 200 thoughts; the user possibly editing in the app meanwhile. Design for that, not for bursts of concurrent writes: what TheBrain does under those is in docs/api-map.md, and nothing in the code guards it.

Layout

src/api/          HTTP client, error normalisation, typed resource calls
src/semantic/     vector store, embedder, indexer, search, document builder
src/operations/   ingest (plan → topological write), traverse (BFS)
src/server/       tool definitions, schemas, formatting, confirmation
skills/           methodology as markdown, installed into ~/.claude/skills
test/             unit + contract tests, never shipped

Read the full file on GitHub · 201 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. 13d ago Changed · -150 lines · -2,957 tokens per session 2bd451feb0fd
  2. 15d ago Changed · +242 lines · +4,553 tokens per session 9406892364c7
  3. 27d ago Changed · +5 lines · +88 tokens per session e6293c14c9da
  4. 1mo ago First seen · 104 lines · 1,173 tokens per session scan A 961cfc663960

Subscribe to this mod's changes

thebrain-mcp CLAUDE.md is an instructions file published in the GitHub repository yBookoff/thebrain-mcp (8 stars, last pushed 14d ago), licensed MIT. It adds 2,857 tokens to every session, about $0.0114 per session on Opus 5.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-31.

Related

Other instructions, from other repositories