second-brain-mcp: Instructions file for Claude Code

CLAUDE.md

second-brain-mcp CLAUDE.md is an instructions file for Claude Code from ddmanyes/second-brain-mcp. It costs 1,164 tokens per session, scanned A, original, MIT.

Project instructions for a second-brain MCP server, a service that lets an AI work with a personal knowledge vault. The vault uses Markdown files as its source of truth and can index them in PostgreSQL or DuckDB.

In plain words
What is it for?
Use them when running, connecting to, testing, syncing, backing up, or securing this second-brain service.
Why use it?
They define how clients connect, where data is stored, how indexing and backups work, and how to prevent conflicting writes or unsafe test database use.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code; mentions AGENTS.md.

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

Reuse

Borrowing it

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/ddmanyes/second-brain-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/ddmanyes/second-brain-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,164 This file is loaded in full into every session.
When invoked 1,164 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.01164 $0.01164
Opus 5.5 $0.00466 $0.00466
Sonnet 5.5 $0.00233 $0.00233
Haiku 4.5 $0.00116 $0.00116

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

Security

Grade A, and why

second-brain-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 2mo 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 · 50 lines

How it starts

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

Second Brain MCP Server

本地 Claude Code:操作 SOP 見 AGENTS.md,vault 目錄結構與工具清單在同一文件。 遠端 MCP 連入:呼叫 get_agent_instructions() 工具可取得 AGENTS.md 完整內容。 CLAUDE.md 位置:second-brain/CLAUDE.md(由 Claude Code 在此目錄啟動時自動載入)。

執行(開發)

uv run --with "mcp[cli]" --with "markitdown[all]" python -m mcp_second_brain

部署(改完碼要做的事)

⚠️ 線上服務跑的是「安裝好的 wheel」,不是這個 checkout(lcdda-start-remote.sh 明寫 "The live service imports the installed wheel")。只改 repo + 重啟服務不會生效:

~/.venvs/second-brain/bin/pip install --force-reinstall --no-deps ~/git-repos/second-brain
launchctl kickstart -k gui/501/com.user.second-brain-remote
launchctl kickstart -k gui/501/com.user.lcdda-remote
  • 三個 server(sb :9100 / lcdda :9104 / lcdda-harvest :9106)共用同一個 venv, 一次 pip install 全部改到——要嘛全部重啟,要嘛新舊碼並存。
  • AGENTS.md 也是 wheel 的一部分(pyproject.toml 的 force-include),所以改手冊 同樣要重新打包才會送到遠端 agent。tests/test_wheel_packaging.py 會驗產物內容。
  • 這個落差曾讓 get_agent_instructions() 靜默回傳 placeholder 數個月都沒被發現, 見 CHANGELOG「wheel never packaged AGENTS.md」。

架構(中央活腦)

  • Index backend 可插拔:store/,由 SB_DB_BACKEND 選 postgres(中央,pgvector+pg_trgm,多機並發)或 duckdb(預設/離線 fallback)。markdown 是正本,index 可由 sync_all 重建。
  • 正式拓樸:單一中央 HTTP server(launchd com.user.second-brain-remote,streamable-http 綁 Tailscale IP :9100,SB_DB_BACKEND=postgres)+ Docker Postgres(sb-pg,僅 127.0.0.1:5432)。
  • 連線:client 走 http://<tailscale-ip>:9100/mcp,帶 header X-API-Key(server 設 SB_API_KEY/SB_API_KEYS 時強制)。Postgres 永不對外,只 server 同機 localhost 連。
  • 排程:second-brain-pg-sync(StartCalendarInterval 每逢 :00、:30 incremental,防脫節)、second-brain-pg-backup(每日 pg_dump)。
  • 寫入紀律:所有寫入經中央 server(單一寫者);client 端 Obsidian 唯讀,避免 Drive 衝突副本。
  • 測試:Postgres 測試對 sb_test(fixture 會 DELETE 全表,絕不可指向 sb_personal/sb_lab,test_postgres_store.py 有硬 guard)。
  • 詳見 MIGRATION_PLAN_POSTGRES.md 與 AGENTS.md 的 Connection Topology 段。

Read the full file on GitHub · 50 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. 2mo ago Changed · +18 lines · +326 tokens per session 94d22d3ded61
  2. 2mo ago First seen · 32 lines · 838 tokens per session scan A b7f11ca3695c

Subscribe to this mod's changes

second-brain-mcp CLAUDE.md is an instructions file published in the GitHub repository ddmanyes/second-brain-mcp (6 stars, last pushed 1mo ago), licensed MIT. It adds 1,164 tokens to every session, about $0.0047 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

second-brain-mcp CLAUDE.md compared with instructions from other repositories

second-brain-mcp CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
second-brain-mcp CLAUDE.mdddmanyes/second-brain-mcpInstructions file61mo agoMITA1,164Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,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