Skip to content

Repository files navigation

Second Brain — how this vault works

One vault, read by every Claude Code session, written through guarded doors, cleaned up every night while you sleep, and constitutionally changed only by you once a week.

This README is the methodology. Folder rules live in each folder's README and [[RESOLVER]]; design rulings live in [[Second Brain Decisions]] (D1–D9).


1. The core idea: executor vs curator

Borrowed from SkillOS ([[skillos-frozen-executor-trainable-curator]]): the agent that DOES work must never be the agent that REWRITES its own instructions mid-task.

        DOES tasks                          IMPROVES the brain
 ┌─────────────────────┐             ┌──────────────────────────┐
 │  EXECUTOR           │   traces    │  CURATOR                 │
 │  = any Claude       │ ──────────▶ │  = nightly dream cycle   │
 │    session          │  (inbox/)   │    + day-end judge       │
 │  reads brain,       │             │  the ONLY writer of      │
 │  writes only inbox/ │ ◀────────── │  knowledge/ & BRIEFs     │
 │  + project notes    │  (BRIEF.md) │                          │
 └─────────────────────┘             └──────────────────────────┘
                                                 │ proposals
                                                 ▼
                                     ┌──────────────────────────┐
                                     │  CONSTITUTION = YOU      │
                                     │  weekly review approves  │
                                     │  principals/, universe/, │
                                     │  skill-method changes    │
                                     └──────────────────────────┘

Why: if a session could edit its own methods the moment it thinks it learned something, one bad conclusion rewrites how every future session works. Separation makes every change auditable — and reversible, because every curator run is one git commit.

2. Who fills the roles: Human, Claude (CEO), Hermes (employee)

Two roles above (executor, curator) — but three actors fill them, split by cost and trust. Cheap routine work runs on Hermes, judgment and gates run on Claude, and the constitution is you (D10, [[Second Brain Decisions]]).

 ┌──────────────────────────────────────────────────────────────────────┐
 │  HUMAN (you) — the constitution · 1 of the 2 main gates              │
 │  • weekly review: approve / reject every proposal, WITH evidence      │
 │  • override the judge when it got something wrong                     │
 │  • rule design decisions; sole approver of principals/ · universe/ ·  │
 │    skill methods — nothing long-half-life moves without your sign     │
 └──────────────────────────────────────────────────────────────────────┘
 ┌──────────────────────────────────────────────────────────────────────┐
 │  CLAUDE (CEO) — the other main gate · sees ALL skills                 │
 │  • executor in every coding session (reads brain, writes inbox/)      │
 │  • supervises the dream cycle via MCP; reviews the staging diff       │
 │  • authors Hermes's skill variants at weekly review, keeps them pinned│
 │  • steps in on "inevitable events": pin mismatch · Hermes fails 2     │
 │    nights · score cliff on a note a Hermes skill wrote                │
 └──────────────────────────────────────────────────────────────────────┘
 ┌──────────────────────────────────────────────────────────────────────┐
 │  HERMES (employee) — cheap · routine · sees ONLY skills/hermes/       │
 │  • runs the nightly dream cycle (best case) on shortened, decoupled   │
 │    variants DERIVED from Claude's proven skills — never cold-start    │
 │  • writes to STAGING only; machine postconditions gate the merge      │
 │  • never touches knowledge/ or the constitution layers directly       │
 └──────────────────────────────────────────────────────────────────────┘

Where each actor shows up in the events below:

Event (section) Human Claude (CEO) Hermes (employee)
Session boot (§4) receives BRIEF, starts work
During session (§5) grep-first · cite or log-miss · file to inbox/
Nightly dream (§6) supervises via MCP · reviews staging diff runs it · writes to staging
Scoring & judge (§7) (judge runs inside the curator) executes judge during dream
Weekly review (§8) THE gate presents proposals + evidence

Read the table by column: the Human appears at exactly one recurring event (weekly review) plus ad-hoc design rulings — that scarcity is the design, not a gap. Everything routine is meant to run without you.

Until Hermes is installed, Claude runs the dream cycle itself via claude -p against the same staging gate. Swapping the runner from Claude to Hermes later is a one-line trigger change — the gate is what's load-bearing, not who pulls it.

3. Guardrails scale with half-life (D9)

The longer a mistake in a layer keeps hurting you, the harder that layer is to write.

 short half-life  ◀──────────────────────────────────▶  long half-life
 cheap to be wrong                                       expensive to be wrong

 daily/ stamps      inbox/ + project     knowledge/         SKILL methods,
 machine-only,      notes: free write,   curator-only,      principals/, universe/:
 no judgment        short & flexible     judged nightly     proposal → YOUR approval

The surprise (council-caught): a wrong fact fires once and decays, but a wrong method re-executes every session and compounds. So skill-method edits sit at the STRICT end with principals/, even though skills must keep adapting — changes happen, but through proposals with evidence, not silently.

4. Event: session boot

 you open Claude in a project folder
        │
        ▼
 SessionStart hook (C:\brain\hooks\session-brief.ps1)
        │
        ├─ maps cwd → project
        ├─ injects projects/<name>/BRIEF.md   (precomputed, ≤4k — no live RAG at boot)
        ├─ injects git delta since last session
        └─ shows dream-cycle "last successful run" stamp  → staleness fails LOUD

Why precomputed: a synthesis written calmly at night beats a frantic search at boot. The session starts already knowing the project instead of rediscovering it.

5. Event: during a session

 READ path (brain-first, forces STUDY not guess)         WRITE path
 ─────────────────────────────────────────────          ───────────────────────────
 question comes up                                       something worth keeping
        │                                                happens (decision, error,
        ▼                                                discovery)
 grep vault / gbrain search  ──hit──▶ cite it                   │
        │miss                         (source tier:             ▼
        ▼                              old code >               observation note
 log lookup MISS (counter),            knowledge >              → inbox/
 then research normally                context >                (session NEVER writes
                                       research)                 knowledge/ directly)

A failed lookup is not just an inconvenience — it is recorded evidence. Repeated misses on the same topic mean the knowledge itself is broken or missing (D8).

6. Event: nightly dream cycle (the curator at work)

 scheduled run, once per ~day, cwd = C:\brain
        │
        ├─ 1. digest inbox/ ──▶ file into projects/ per RESOLVER rules
        ├─ 2. run day-end JUDGE over yesterday's writes (see §7)
        ├─ 3. regenerate BRIEF.md per project (≤4k)
        │       └─ only from notes ABOVE the score floor, never from
        │          notes written in this same run (bad write can't
        │          propagate into tomorrow's boot untested)
        ├─ 4. mine repeated mistakes (≥3×) ──▶ write PROPOSALS (≤3/week)
        ├─ 5. stamp daily/ + update "last run" marker
        └─ 6. ONE git commit  ──▶ a bad night is `git revert`, not corruption

7. Event: scoring — counters + EMA + judge (D8/D9)

Two layers, so the expensive LLM judge stays OUT of the hot path (LOCAL HARNESS law, [[statistical-harness-local-gating]]):

 LAYER 1 — always-on counters (free, no LLM)      LAYER 2 — day-end LLM judge
 every note/skill accrues events:                 (low-frequency, digest reviewable
   kept in place      → good                       at weekly review, not silent):
   relocated / rejected → bad                       · citation ability + source tier
   lookup hit / miss    → useful / broken           · rejection & wrongness rate
   CONTRADICTED later   → heavy penalty             · quality: abstraction, reuse,
        │                                             actionability, faithfulness
        ▼                                           · cost — does it earn its keep?
 EMA score  =  α·today + (1-α)·yesterday's score
 (α = 0.2, cold-start 0.5)

Why EMA and not raw counts: raw counts never forget — a note that was right all of last year but wrong since March still looks great. EMA weights the recent weeks most (your working rhythm) while old signal fades gradually instead of vanishing. The contradicted event exists because popularity ≠ truth: a confidently wrong note that gets cited often would otherwise climb the score.

Sprint-3 upgrade path: same counters feed a γ-discounted LinUCB bandit — EMA generalized to context features. Log schema is kept replayable for exactly that.

8. Event: weekly review (the human gate)

 you run /brain-weekly-review
        │
        ├─ proposals queue (from dream cycle) presented one by one, WITH evidence
        │      approve ──▶ moves into principals/ | universe/ | skill method
        │      reject  ──▶ archived with the reason (reason = future training signal)
        ├─ judge digests from the week — override anything it got wrong
        └─ commit `review: <date>`

Nothing with a long half-life changes without passing through this room. That is the whole anti-calcification / anti-churn balance: short-half-life layers churn freely, long-half-life layers move only on evidence plus your signature.

9. Life of one piece of knowledge

 raw thought ──▶ inbox/ ──dream──▶ project note ──earns keep──▶ knowledge/
                                        │  (EMA high, cited, judged)     │
                                        │                                │
                                     decays ◀── relocated / rejected / contradicted
                                        │                                │
                                        ▼                                ▼
                                    archived                 pattern repeats ≥3×
                                                                    │
                                                              proposal ──you──▶ principals/

Related: [[Second Brain Mission]] · [[Second Brain Decisions]] · [[RESOLVER]]

About

Second Brain for Top tier Agentic System especially Claude. Heavily experimental and research-oriented.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors