second_brain_builder: Instructions file for Claude Code

CLAUDE.md

second_brain_builder CLAUDE.md is an instructions file for Claude Code from algometrix/second_brain_builder. It costs 2,242 tokens per session, scanned A, original, MIT.

A guide for Second Brain Builder, an Obsidian plugin that turns selected note text into explanations or improved passages using Claude Code, Gemini, Codex, or Ollama. Obsidian is a note-taking application, and Ollama runs language models locally.

In plain words
What is it for?
Use it when changing explanation modes, inline enhancements, command-line or local-model providers, the generation queue, settings, or the plugin build process.
Why use it?
It explains how the plugin connects notes to different text-generation tools and how its source is built into an Obsidian plugin file.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code; runs codex exec.

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

Reuse

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.

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/algometrix/second_brain_builder/claude-md/github.svg)](https://agentmods.dev/instructions/algometrix/second_brain_builder/claude-md)
Your own site
<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.

agentmods 80×15 button for second_brain_builder CLAUDE.md

Your own site · 80×15
<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>
Per session 2,242 This file is loaded in full into every session.
When invoked 2,242 The same file — it is already loaded in full.
Security scan A 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.02242 $0.02242
Opus 5.5 $0.00897 $0.00897
Sonnet 5.5 $0.00448 $0.00448
Haiku 4.5 $0.00224 $0.00224

Measured 28d ago against content hash 1f5207a26c79, 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_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`)
CLAUDE.md · 101 lines

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_ACTIONS catalog (expand, simplify, add diagram, ...)
  • src/output-rules.ts -- formatting rules appended to every prompt (getOutputRules, inline/append variants)
  • src/cli.ts -- typed child_process.spawn boundary (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_MODES at build time. Gitignored; resolved before every build by scripts/sync-modes.js (from modes.config.json's modesFile if present, else an existing modes.json, else modes.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 (conventionally modes.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.json before builds (see above); wired into npm run build and npm run dev
    • vault-root.js -- shared vault path resolution for the fix scripts (first non-flag CLI argument, OBSIDIAN_VAULT env var, or OBSIDIAN_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 end keywords 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 end keywords (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) to N: in labels and joining - item lines with <br/>
    • fix-mermaid-sequence-note.js -- in sequenceDiagram blocks, folds a note/message whose text wrapped onto a following list line (1./1)/-/*) back into the preceding line joined with <br/> (converts N./N) to N:, strips bullets); fixes got '1' parse errors from lines starting with a bare number

Read the full file on GitHub · 101 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. 28d ago Changed · +5 lines · +194 tokens per session 1f5207a26c79
  2. 2mo ago First seen · 96 lines · 2,048 tokens per session scan A c5186e11fb47

Subscribe to this mod's changes

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.

Related

second_brain_builder CLAUDE.md compared with instructions from other repositories

second_brain_builder CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
second_brain_builder CLAUDE.mdalgometrix/second_brain_builderInstructions file63d agoMITA2,242Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143ktodayMITA7,461Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file275k3d agoMITA4,313Codex, OpenCode