Back to Tools

Second Brain

A personal knowledge vault for internal auditors that compounds contracts, contacts, and research into synthesized markdown pages with FTS5 search, deterministic dedup, and append-only timelines.

How It Works

Second Brain is a personal knowledge vault that lives in a local folder of markdown files. The vault holds your synthesis: contracts, correspondents, research notes, and daily logs. Each page has typed frontmatter, internal [[brainlinks]] form a connected graph, and every factual claim carries a [source: ...] tag back to its origin.

Every source you feed in gets synthesized into structured pages with inline provenance. Topics are deduplicated at add time (FTS5 shortlist + LLM judgment), so your research compounds instead of fragmenting. Research and contract pages follow a compiled-truth-plus-timeline discipline: current understanding above an HR separator, an append-only timeline below. A daily rhythm — morning, midday, EOD — keeps logs flowing and automatically classifies new sources into risk themes, then escalates emerging patterns back onto project pages.

Key Features

The Skills

Knowledge Skills

1
/brain-add — Ingest a URL, File, or Text

Paste a URL, pass a file path, or drop in raw text. Content is saved to sources/, then synthesized into research, contact, and contract pages with inline provenance. Duplicates are caught at add time via FTS5 shortlist + LLM judgment, so overlapping topics merge. Pass --no-synth to save only.

2
/brain-ask — Cited Synthesis

Ask anything against the vault. Expands the question into 2 keyword-distinct paraphrases, runs FTS5 BM25 with backlink-boosted ranking, and unions hits across queries. Every claim in the synthesized answer is tagged with its source; gaps and contradictions are called out rather than glossed over. Add --explore to file the answer as a new research page.

3
/brain-fix — Vault Health Check

Structural checks (broken brainlinks, orphans, provenance gaps) run as free SQL over the index; LLM checks (contradictions, staleness) run targeted against candidates. Use --auto to apply safe repairs (link casing, normalize frontmatter). Never edits body content.

Daily Rhythm Skills

AM
/brain-status — One Skill, Three Modes

A single entry point for the whole day; auto-detects mode from the state of today's log. Morning creates today's log JSON with a dad joke, carries forward open todos from yesterday, and pulls actionable items from email and calendar. Midday absorbs new activity since the last update (creates a skeleton if morning never ran). EOD auto-closes verifiable todos and prompts for the rest. Every run invokes /brain-classify, /brain-escalate, and finally /brain-today to render the updated log.

PM
/brain-today — Render the Latest Log

Visualizes the latest daily log JSON in a consistent markdown format: date header, dad joke, stats line, open todos grouped by source (Canvas, Email, Calendar, Scheduled, Voicemail, Manual) with age and provenance, completed todos collapsed underneath. The shape is owned by .brain/scripts/render_log.py so every render looks the same. Pass a YYYY-MM-DD argument to view a specific day. Auto-invoked at the tail of every /brain-status run.

Continuous Audit Skills

T2
/brain-classify — Tier 2 Continuous Audit

Scans recent sources (or a specific page via --source) and classifies each into a 39-theme risk taxonomy across fraud, cybersecurity, access control, control failure, and compliance. Appends to themes/<category>/<slug>.md with confidence and provenance. Idempotent across reruns.

T3
/brain-escalate — Tier 3 Continuous Audit

Reads recent theme classifications and runs four pattern detectors: theme clustering, velocity spike, cross-domain correlation, and high-confidence fraud. Findings land on the relevant project pages in projects/ plus a one-line summary in today's log.

Agents

Subagents the harness can dispatch automatically when their description matches a request, or that you can invoke explicitly. Each agent has a tightly scoped tool list — read/write boundaries are enforced at the tool-grant layer, so e.g. brain-ingestor literally cannot send mail or create events.

A1
brain-cleaner — Vault Health Sweep

Wraps /brain-fix with severity bucketing. Runs structural + LLM checks, applies only safe auto-repairs, and writes a fix-report-YYYY-MM-DD.md with high-severity findings first. Pure local cleanup — no web, no external systems.

A2
brain-ingestor — Email + Calendar Sync

Pulls recent Gmail threads and Calendar events through your Claude.ai connectors, filters out noise (auto-mailers, OTPs, recurring standups), dedupes against the vault, and files substantive items as sources/ — then synthesizes contacts and research notes. Read-only access only; never sends mail or creates events.

A3
brain-researcher — Brain-First Cited Research

Multi-query vault search first; web search as a fallback when vault coverage is thin. Synthesizes 1–3 paragraphs with every claim tagged. Files exploratory answers as research/<slug>.md using the compiled-truth + timeline template.

Setup

S
/brain-setup — Scaffold a New Vault

Creates the folder layout, drops helper scripts into .brain/scripts/, writes CLAUDE.md conventions, seeds .brain/config.json, and initializes .brain/index.sqlite. Idempotent — safe to re-run to refresh generated artifacts without touching your content.

Customization Without Forking

The plugin code stays read-only — all customization lives in the vault. Edit a file, run the next skill, and the change takes effect. Five override surfaces, ordered broadest to narrowest:

C1
.brain/config.json — Parameters

Every numeric or list-shaped knob: enabled skills, auto-invoke chains, detector thresholds for /brain-escalate (cluster window, velocity multiplier, cross-domain category count), email filtering rules (skip / no_todo / keep at three scopes, actionable keywords, auto-promotion thresholds), redaction policy (internal vs. external), MCP provider selection (Gmail vs. Outlook, Google vs. Microsoft Calendar).

C2
.brain/themes.json — Risk Taxonomy

The 39-theme audit taxonomy ships as a JSON file with definitions and examples for each theme. Add categories, refine definitions, prune themes that don’t apply to your domain. /brain-classify reads the file each run and passes the definitions to the LLM — sharper boundaries, fewer false positives. /brain-curate keeps the file and the theme pages in sync.

C3
.brain/user.md — Persona

Free-form markdown — voice, recurring people, projects you live in, banned phrases, working style. Read by brain-draft, brain-ask, brain-prep, brain-status (morning prioritization), brain-handoff, and brain-digest. Keep under ~2 KB so it doesn’t crowd out actual context.

C4
.brain/prompts/<skill>.md — Per-Skill Override

Drop a file matching a skill’s slug (e.g. brain-draft.md) to extend that skill’s operating context — tone, ordering, emphasis, citation density, output shape. Cannot relax the hard rules in the skill’s Boundaries section (no Canvas writes outside /brain-share, no source-bypass, no skipping redaction).

C5
templates/<type>.md — Page Templates

Page-body skeletons for each page type (research.md, contract.md, contact.md, etc.). Customize once and every new page of that type starts from your shape. Used by /brain-add, the email/calendar ingestor, and brain-researcher.

All five surfaces survive plugin upgrades. Re-run /brain-setup --refresh-config after upgrading to pull in new config fields without redoing the full setup wizard.

Getting Started

1
Install the plugin

Download the plugin below and install it in Claude Code — the .claude-plugin/plugin.json manifest sits at the root of the zip. The plugin registers seventeen slash-command skills and eight subagents the harness can dispatch automatically.

2
Run /brain-setup

Create a new folder for your vault and open it in your harness (Cowork or Claude Code). Run /brain-setup to generate the vault layout, runtime scripts, conventions, and the empty SQLite index. Safe to re-run — only regenerates runtime files, never touches your content.

3
Add your first source

Run /brain-add <url-or-file> to ingest a source. The skill will save the raw content to sources/ and synthesize into research, contact, and contract pages.

4
Start your daily rhythm

Run /brain-status three times a day (morning, midday, EOD). Schedule it if your harness supports cron; otherwise invoke manually. Each run will classify new sources and escalate emerging patterns automatically.

5
Ask, and keep it healthy

Use /brain-ask <question> whenever you want cited synthesis across the vault. Run /brain-fix weekly to catch drift — broken links, missing provenance, stale pages, and contradictions.

Open source under the MIT License. Free to use, modify, and distribute.