I Gave Claude Code a Permanent Memory
TL;DR
A 7-minute walkthrough (Taoufik) that rebuilds — a fourth
independent time in this vault — the Karpathy-style second brain: two
folders, raw/ (the inbox you write into) and
wiki/ (the brain, where Claude Code links pages together),
plus an index and log. Nothing here is new to
the graph at the layout level; its value is as corroboration
and in two mechanisms it makes concrete. First, ingestion is
staged behind operator approval — a "watch" skill drops
a report.md into raw/, dedups against the wiki
("already documented, doesn't duplicate"), and refuses to write to the
brain until the operator says "ingest it now" (watch → report → approve
→ ingest → verify). Second, writes are wrapped in deterministic
Python hooks: a session-start hook loads who-you-are, and a
pre-write "brain-lint" hook checks the store is healthy enough to add to
and flags orphan pages before anything lands. The opening frame crosses
out "the bigger the better?" — a bigger graph is worse if it is mostly
noise the agent can't use. The rest (typed templates per capture kind,
/sweep to batch-process the inbox, a Dataview dashboard,
Obsidian + Templater + Dataview as the stack, a "grill me" profile-setup
skill) restates cluster claims.
Concepts introduced
- AI Second Brain — the whole video
is another independent instance of the store:
raw/+wiki/+index+log, credited to Karpathy, extraction via a "grill me" interview skill. Updated, not duplicated. - Knowledge-Graph Lint — the one genuinely additive node. The "brain-lint" pre-write hook: a deterministic structural-health check (orphan/relatedness) that gates writes to the store.
- Knowledge Graph Retrieval — why the lint matters: the link structure is the index, so an orphan page is unreachable by the agent's graph-walk.
- Agent Rituals — the session-start hook (load who-you-are) and pre-write hook are begin/before- write rituals delivered as deterministic code hooks rather than context-file instructions.
- Validation-Gated Update — the brain-lint gate is its structural sibling: accept a write only if the graph stays connected, vs accept an edit only if a held-out score improves.
- Multimodal Video Ingestion — the "watch" skill: an agent ingests a YouTube video, dedups it against the wiki, and stages a report for approval.
- Evergreen vs Volatile Context — the "bigger graph ≠ better / too much noise" opening, at the store level: curate what gets in.
Held, not dropped (touched, no concept page yet):
- Approval-staged ingest pipeline (watch → report → approve → ingest → verify) — a named, human-in-the-loop staging flow. Currently folded into AI Second Brain and Multimodal Video Ingestion as a best-practice claim; spin out as its own concept if a second source names the same five-stage shape.
/sweepas an on-demand batch consolidation command — process only the unprocessedrawentries into the wiki. Corroborates Incremental Indexing (do only what changed) and Offline Consolidation Cycle (batch inbox→brain); held rather than given its own page.- Typed capture templates (article/asset/book/brainstorm) via Obsidian Templater — the note-type analogue of Golden Templates' adapt-a-template move; held as a claim on AI Second Brain.
/save-chat(persist a conversation intoraw/) and the Dataview dashboard /sourcestracker — concrete surfaces; held.- The tool stack itself — Obsidian + Templater + Dataview + Notion kit; tool-specific, not concept-worthy.
Key claims
- A second brain is two folders —
raw/(inbox) andwiki/(agent-linked brain) — inspired by Karpathy. observation — the source's framing; a fourth independent convergence on theraw/wiki/index/loglayout already held by AI Second Brain. - Bigger graph isn't better: noise and unusable context hurt the agent's retrieval. (principle, as the source asserts) — the crossed-out "the bigger, the better?"; restates Evergreen vs Volatile Context at the store level.
- Don't write to the brain until the operator approves; dedup
against the wiki at watch time.
best practice — context:
agent-driven ingestion where provenance/trust matter; the report sits in
raw/unprocessed until "ingest it now," and re-watching a documented source reports "already documented" instead of duplicating. → AI Second Brain, Multimodal Video Ingestion. - Wrap agent writes in deterministic code hooks — a session-start hook loads the profile; a pre-write hook validates and lints the store — so a stochastic write can't degrade the graph without passing a mechanical check. best practice — context: harnesses with pre-write hooks, unattended/frequent writes. → Knowledge-Graph Lint, Agent Rituals.
- "Brain lint" checks the store is healthy enough to add to and flags orphan pages before writing. (observation → principle) — the source's description of the health gate; generalized as Knowledge-Graph Lint (orphans break reachability in a link-indexed store).
- A template per capture type lets the agent fill a fixed structure instead of inventing one. best practice — context: an Obsidian+Templater store; classify type, instantiate that template. → Golden Templates (code-exemplar sibling), AI Second Brain.
/sweepbatch-processes only the unprocessedrawinbox into the wiki. observation — incremental consolidation; → Incremental Indexing.- The ingested demo report asserts Anthropic launched
"Routines" (schedule/webhook/API-triggered managed cloud
sessions). (observation — the ingested source's claim, not
adjudicated here) — shown on-screen inside the staged
report.md; flagged for a later grounding pass, not verified.
Why this corroborates the second-brain cluster
This is the highest-frequency signal in the video, so it sets
graph_relation. Taoufik's build is the fourth
independent instance in this vault of the same store —
raw/+wiki/+index+log,
credited to Karpathy, with a "grill me" interview skill for extraction —
after Nate Herk, Austin Marchese, and the Fable-5 LLM-wiki gist (see AI Second Brain). Convergence from four
unrelated creators on the same layout, origin story, and
extraction move is itself the finding: this is a stable pattern, not one
author's idiosyncrasy. Because it corroborates, no concept is duplicated
— the claims are appended to AI Second
Brain with Taoufik as the new source.
Two threads are more than corroboration and are recorded as such. It builds on the cluster by making the approval-staged ingest pipeline (watch → report → approve → ingest → verify) and the deterministic write-hook delivery explicit — new best-practice detail on AI Second Brain and Agent Rituals. And it is novel in exactly one place: the brain-lint health gate, spun out as Knowledge-Graph Lint — a structural gate (keep the graph connected; no orphans) distinct from Validation-Gated Update's content-score gate and Input & Output Guardrails' model-I/O gate. That node lands squarely on firehose's own orphan-check discipline.
Illustrated walkthrough
- t=00:08 — "those kinds of graphs… the bigger, the
better?" An Obsidian graph view of the whole second brain,
deliberately crossed out. The file tree names the real layout:
docs/,projects/,raw/,references/, andwiki/{concepts, content, daily-memory, entities, sources, system, templates}plusdashboard,index,AGENTS,CLAUDE. The claim under it: more nodes aren't automatically better — "if the AI agent can't actually use the right information or there's too much noise, it will be very hard to track." - t=01:05 — "a second brain is two folders. the idea: Andrej
Karpathy." A clean diagram:
raw("the inbox, you write here") → a flower/agent glyph ("the agent links it all") → the wiki. Raw holds brainstorms, desktop captures, prior AI chats, daily notes; the agent (Claude Code / Codex) makes the links between them. - t=02:30 — the live test, "the report, staged in
raw." Timeline across the top: watch · report · approve
· ingest · verify. On screen, a report the watch skill wrote to
raw/watched/claude-routines-nick-saraev-2026-06-30/report.mdwith front-matter (source,title: "Claude Routines Just Dropped, And It's Perfect",duration: 18:07,watched_at,hero_frames,transcript_source: captions) and a TL;DR — not yet ingested. It "won't process before I'm agreeing to this." (The ingested report's own content asserts Anthropic launched "Routines" — schedule/webhook/API-triggered managed sessions; that is the ingested source's claim, surfaced here as check-worthy, not adjudicated.) - t=03:20 — "the structure that makes it scale." An
indexnode fanning out to a template per type: article, asset, book, brainstorm, … Before writing, the agent classifies the input's type and instantiates that type's template./sweepis the command that batch-processes therawinbox — "analyze all your folders, see what needs processing and what's already processed." - t=03:56 — "the hooks: automatic guards. small Python
scripts, triggered before anything is written." Three boxes:
session start → write validation → brain lint. Behind
them, a Notion page "Build Your Own Second Brain with Claude Code"
listing the kit:
/sweep(process your inbox),/brain-lint(keep your vault healthy),/save-chat(keep a conversation), the Dataview dashboard, the hooks,grill me(set up your profile — "run this first"), and "what every file is for (the anatomy)." The brain-lint hook "checks the brain is healthy enough to add new information, or [flags] pages that are orphans and not related to each other." - t=06:52 — "build your own." Recap card: what-it-is
· how-it-works-live · the-structure-that- scales, with
/sweep,/brain-lint,grill-meand "the kit · link in description."