Prompt file imported from ai-enhanced-engineer/aiee-cortex (
.claude/commands/notebook-capture.md). Fill in{{arguments}}before use. Copyright stays with the author.
/notebook-capture
Capture the working session you just had as a dated journal entry in wiki/journal/, and create raw/ metadata cards for any papers or repos the session mentioned. This is the front door of the vault — the capture half of the Karpathy capture → ingest loop.
Writes only to wiki/journal/, raw/papers/, raw/repos/, wiki/_index.md, wiki/_hot.md, and wiki/_log.md. It never compiles sources — that is /notebook-ingest's job.
Scope Gate
!test -f raw/.manifest.json && echo NOTEBOOK_VAULT || echo NOT_NOTEBOOK
If NOT_NOTEBOOK, stop and tell the user: "cd into the notebook vault root before running /notebook-capture". Then confirm wiki/_templates/journal-entry.md exists — if it is missing, stop and report that the vault is incomplete.
Phase 1 — Context
Determine:
- Focus slug — from
{{arguments}}if given (kebab-case it); otherwise infer a short kebab-case slug from the dominant theme of the session. - Date — today,
YYYY-MM-DD. - Repo / branch — if the session worked inside a git repo, capture the branch (
git rev-parse --abbrev-ref HEAD) and the repo name. If not, leave both blank.
Read wiki/_hot.md and wiki/_index.md for oracle context (skip silently if either is absent).
Phase 2 — Oracle check
- Existing entry — look in
wiki/journal/forYYYY-MM-DD-{focus-slug}.md. If one exists, propose updating it or appending a-Nsuffix (per CLAUDE.md Rule 7). Never silently overwrite. - Papers / repos — scan the session for:
arxiv.org/abs/<id>,doi.org/<path>, or an explicit paper mention → queue a card atraw/papers/{slug}.mdgithub.com/<owner>/<repo>→ queue a card atraw/repos/{owner}-{repo}.mdSkip any card that already exists (dedupe by path).
- Related pages — match concepts, sources, and entities named in the session against existing files in
wiki/concepts/,wiki/sources/,wiki/entities/. Collect the resolving wikilinks for the journal frontmatter.
Phase 3 — Compose
Build the journal entry from wiki/_templates/journal-entry.md:
- Frontmatter:
title,date,session_focus,repo,branch,related_concepts,related_sources,related_entities,tags,created,updated,status. - What I Did — 3–6 concrete bullets: actions taken, decisions executed, code shipped.
- What I Decided — key choices with rationale and outcome, first person.
- What's Open — unresolved threads, next-session TODOs.
- Energy / Tone — optional one-liner if the session had a notable arc.
- Links Out —
[[wikilinks]]to the related pages and any queued raw cards.
Phase 4 — Review
Show the user a summary table before writing anything:
- Journal file path
- Raw cards to be created (count + paths)
- The
_log.mdline,_index.mdrow, and_hot.mdupdate
Offer: Write all (journal + raw cards + index/log/hot) · Journal only (skip raw cards) · Show full journal first · Skip.
Phase 5 — Write (on approval)
- Journal —
Writethe composed entry towiki/journal/YYYY-MM-DD-{focus-slug}.md. - Raw cards (only if "Write all") — for each queued paper/repo,
Writeraw/{papers|repos}/{slug}.mdwith frontmatter:type,title(paper) orname(repo),url,added: YYYY-MM-DD,cited-by: ["[[journal/YYYY-MM-DD-{focus-slug}]]"],tags. Do not add these toraw/.manifest.json— uncompiled cards stay out of the manifest until/notebook-ingestruns. _log.md— read the actual last line, thenEditto append one line below it (never overwrite, never reorder):
The prefix column is space-padded to 8 characters (YYYY-MM-DD | CAPTURE | [[journal/YYYY-MM-DD-{focus-slug}]] — {one-line summary} (+N papers, +M repos)CAPTURE+ one space)._index.md—Editthe Journal table: add a row (replace the_(no entries yet)_placeholder on first run, otherwise append below the last row)._hot.md— setLast Updatedto today and add one bullet underRecent Changesdescribing the capture.
Phase 6 — Summary
Report: journal path, raw cards created (+N papers, +M repos), and the handoff note:
Run
/notebook-ingest --allto compile the new raw cards into source, entity, and concept pages.
Boundary reminders
- Writes ONLY to
wiki/journal/,raw/papers/,raw/repos/,wiki/_index.md,wiki/_hot.md,wiki/_log.md. - NEVER touches
wiki/sources/,wiki/entities/,wiki/concepts/— that is/notebook-ingestterritory. - NEVER modifies an existing
raw/card; only creates new ones on first mention. - Commits stay manual.
