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
- Personal markdown vault — plain files in a local folder; opens in Obsidian, VS Code, or any editor
- SQLite-backed index — stdlib only, no install; FTS5 BM25 with backlink-boosted ranking scales to 10K+ pages
- Compounding synthesis — new sources merge into existing pages when the topic matches; two-stage dedup (cheap FTS shortlist, then LLM judgment)
- Compiled truth + timeline —
research/andcontract/pages keep current understanding above an HR separator (rewritten freely as evidence changes) and an append-only timeline below; corrections never overwrite history - Provenance everywhere — every factual claim traces back to its source (local page, email, or URL)
- Daily briefings —
/brain-statusbuilds a prioritized todo from email and recent activity, three times a day - Continuous audit at the tail — every status run auto-invokes theme classification and risk escalation
- Vault hygiene —
/brain-fixsurfaces broken brainlinks, orphan pages, missing provenance, contradictions, and staleness; safe auto-repairs on opt-in
The Skills
Knowledge Skills
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.
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.
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
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.
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
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.
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.
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.
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.
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
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.
Getting Started
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 eight slash-command skills
and three subagents the harness can dispatch automatically.
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.
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.
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.
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.