Borrowing it
Nothing to install: this file belongs to algometrix/second_brain_builder. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/algometrix/second_brain_builder/main/CLAUDE.mdgit clone --depth 1 https://github.com/algometrix/second_brain_builderWrote 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.
[](https://agentmods.dev/instructions/algometrix/second_brain_builder/claude-md)<a href="https://agentmods.dev/instructions/algometrix/second_brain_builder/claude-md"><img src="https://agentmods.dev/badge/instructions/algometrix/second_brain_builder/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.
<a href="https://agentmods.dev/instructions/algometrix/second_brain_builder/claude-md"><img src="https://agentmods.dev/badge/instructions/algometrix/second_brain_builder/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02242 | $0.02242 |
| Opus 5.5 | $0.00897 | $0.00897 |
| Sonnet 5.5 | $0.00448 | $0.00448 |
| Haiku 4.5 | $0.00224 | $0.00224 |
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 28d 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.
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 — 101 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.
Beauty Review
This is a TypeScript codebase. When reviewing code here (/code-review, or any request to review, critique, or audit changes), invoke the global ts-js-beauty-reviewer agent alongside any other reviewers. It judges intent, scope, type-level contracts, async/error handling, tests, and measured performance — not just lint. Run it on the changed .ts files; treat its correctness and security findings as must-fix and its taste notes as suggestions.
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/> - fix-mermaid-sequence-note.js -- in
sequenceDiagramblocks, folds a note/message whose text wrapped onto a following list line (1./1)/-/*) back into the preceding line joined with<br/>(convertsN./N)toN:, strips bullets); fixesgot '1'parse errors from lines starting with a bare number
- 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.
- 28d ago Changed · +5 lines · +194 tokens per session 1f5207a26c79
- 2mo ago 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 (6 stars, last pushed 3d ago), licensed MIT. It adds 2,242 tokens to every session, about $0.0090 per session on Opus 5.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.
second_brain_builder CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| second_brain_builder CLAUDE.mdalgometrix/second_brain_builder | Instructions file | 6 | 3d ago | MIT | A | 2,242 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 275k | 3d ago | MIT | A | 4,313 | Codex, OpenCode |