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.
npx agentmods add instructions/algometrix/second_brain_builder/claude-mdgit clone --depth 1 https://github.com/algometrix/second_brain_builderWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.02048 | $0.02048 |
| Opus 5 | $0.01024 | $0.01024 |
| Sonnet 5 | $0.00410 | $0.00410 |
| Haiku 4.5 | $0.00205 | $0.00205 |
Grade A, and why
second_brain_builder CLAUDE.md scanned grade A 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 yesterday.
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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- **src/cli.ts** -- typed `child_process.spawn` boundary (`SpawnedCliProcess`, `spawnCli`) How it starts
The opening of the file, as written. The whole thing — 96 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What This Is
An Obsidian plugin ("Second Brain Builder") that generates detailed explanation notes using Claude Code CLI, Gemini CLI, Codex CLI, or a local Ollama server. Users select text in a note, pick a teaching style (mode), and the plugin spawns the CLI to produce a new note or inline enhancement. Desktop only; supports Windows, macOS, and Linux.
Build Commands
npm install # install dependencies
npm run build # type-check (tsc -noEmit) + production bundle
npm run dev # esbuild watch mode (rebuilds on save)
The build produces main.js (CJS bundle) from the single entry point main.ts via esbuild. Use the Hot-Reload plugin in Obsidian for live dev.
Project Structure
Source lives in src/, bundled to a single root main.js by esbuild (entry point src/main.ts).
- src/main.ts --
ClaudeExplainerPlugin: commands, context menus, the generation queue, CLI/Ollama providers, note orchestration - src/types.ts -- shared interfaces: modes, inline actions, queue items, settings (+ defaults), provider labels
- src/inline-actions.ts -- the
INLINE_ACTIONScatalog (expand, simplify, add diagram, ...) - src/output-rules.ts -- formatting rules appended to every prompt (
getOutputRules, inline/append variants) - src/cli.ts -- typed
child_process.spawnboundary (SpawnedCliProcess,spawnCli) - src/logger.ts -- in-memory ring logger behind the "Enable logging" setting
- src/utils.ts -- filename sanitizing, JSON array extraction, empty-note detection
- src/ui.ts -- shared modal helpers (title, mode cards, searchable mode grid)
- src/fixers.ts -- output post-processing fixers (code fences, mermaid, callouts, dataview, currency)
- src/modals/ -- one file per modal family:
generation.ts,folder.ts,analysis.ts,queue.ts,system-design.ts - src/settings-tab.ts -- the settings UI, including per-provider setup guides
- modes.json -- note generation modes loaded as
BUILTIN_MODESat build time. Gitignored; resolved before every build byscripts/sync-modes.js(frommodes.config.json'smodesFileif present, else an existingmodes.json, elsemodes.sample.json) - modes.sample.json -- committed sample set of general-purpose modes (Explain, Deep Inquiry, Feynman, etc.); the default build input for fresh clones
- modes.config.json -- optional, gitignored;
{ "modesFile": "<path>" }points the build at a personal modes file (conventionallymodes.personal.json, also gitignored) - styles.css -- modal and queue UI styles
- manifest.json -- Obsidian plugin manifest (id:
second-brain-builder) - scripts/ -- build helpers and vault fix scripts:
- sync-modes.js -- prepares
modes.jsonbefore builds (see above); wired intonpm run buildandnpm run dev - vault-root.js -- shared vault path resolution for the fix scripts (first non-flag CLI argument,
OBSIDIAN_VAULTenv var, orOBSIDIAN_VAULT=in a gitignored repo-root.env) - fix-all.js -- unified runner that executes all fix scripts below in order
- fix-callout-fences.js -- fixes callout code fences missing the
>prefix on closing ``` or content lines - fix-currency-dollars.js -- escapes unescaped
$currency signs that Obsidian misinterprets as LaTeX - fix-mermaid-end.js -- strips extra
endkeywords with no matching block opener (subgraph, or sequence-diagram par/alt/opt/loop/rect/critical/break/box) and inserts zero-width space into "end" inside larger words - fix-mermaid-missing-end.js -- re-inserts missing
endkeywords (indentation-based placement) and puts the closing ``` fence on its own line - fix-split-end.js -- rejoins lines corrupted by an old regex that split words like "Send" into "S\nend"
- fix-mermaid-parens.js -- quotes unquoted mermaid node labels containing parentheses or slashes
- fix-mermaid-quotes.js -- strips nested double quotes inside already-quoted mermaid labels (inner
"to') - fix-mermaid-list.js -- fixes "Unsupported markdown: list" errors by converting
N./N)toN:in labels and joining- itemlines with<br/>
- sync-modes.js -- prepares
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.
- yesterday First seen · 96 lines · 2,048 tokens per session scan A c5186e11fb47
second_brain_builder CLAUDE.md is an instructions file published in the GitHub repository algometrix/second_brain_builder (4 stars, last pushed 1mo ago), licensed MIT. It adds 2,048 tokens to every session, about $0.0102 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other instructions, from other repositories
claude-obsidian GEMINI.md
Gemini CLI instructions for AgriciDaniel/claude-obsidian: Read AGENTS.md as the canonical host-neutral contract. Skills live in skills/ /SKILL.md and the portable core lives in claudeobsidian/.
claude-obsidian copilot-instructions.md
Copilot instructions for AgriciDaniel/claude-obsidian: Read AGENTS.md before proposing changes. The repository is an Agent Skills package, Claude Code adapter, standard-library Python core, and deterministic vault template—not the default live user vault.
obsidian-claude-sidebar CLAUDE.md
Instructions for derek-larson14/obsidian-claude-sidebar, covering claude sidebar - agent guide, what this plugin does, two things you can help the user do, step 1: diagnose and step 2a: file a bug report.
vault-operator AGENTS.md
Instructions for pssah4/vault-operator, covering vault operator, projekt-regeln, navigation, zuerst lesen, projekt, tech stack and build und deploy.
obsidian-claude-sidebar AGENTS.md
Instructions for derek-larson14/obsidian-claude-sidebar: This repo's contributor guide lives in CLAUDE.md. Read that for context on filing issues, opening PRs, and what fits the project's scope.
obsidian-vault-mcp CLAUDE.md
Instructions for ebullient/obsidian-vault-mcp, covering obsidian vault mcp, code style and qa.