agentleFS
mazze93mazze93/claude-code-skills/skills/engram/SKILL.md

engram

Skill1 starsChanged 11 days agoMITView on GitHub

Memory-as-first-class system for Claude sessions across a multi-domain workspace (~15+ active projects). USE THIS SKILL for: (1) setting up ENGRAM on a new device ("set up ENGRAM", "install memory system", "set up my context", "set up memory"); (2) capturing thoughts in-session ("remember X", "add to memory", "note that", "log that", "capture this"); (3) surfacing project context ("what's my context", "surface my memory", "what am I working on", "restore context", "what do I know about X"); (4) inbox consolidation ("consolidate my memory", "process my inbox", "clean up memory"); (5) creating per-repo CLAUDE.md stubs. Trigger when any workspace project is mentioned and context appears missing. Trigger on new-device setup and memory restoration. Workspace source of truth: ~/Code/WORKSPACE.md

  • Commits and pushes

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 6 are distinctive, and 9 are very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 9

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run on first-time setup or reinstall on a new device.

    line 78
  2. Very specific:

    Write the script to ~/engram-setup.sh using the Write tool, or present it for the user to copy if write access is unavailable.

    line 81
  3. Distinctive:

    After the script completes, ask: "Run brain-dump session now to populate memory files, or continue later?"

    line 86
  4. Distinctive:

    If now → go to Brain-dump mode.

    line 87
  5. Very specific:

    Read references/brain-dump-interview.md and run the full interview.

    line 106
  6. Very specific:

    Post-restore variant: Use the interview to *update* files rather than replace.

    line 115
  7. Distinctive:

    Never categorize, tag, or route at capture time.

    line 132
  8. Very specific:

    Never modify any file other than inbox.md in this mode.

    line 133
  9. Very specific:

    If running in Cowork without shell access to ~/.claude/, output the formatted entry as text for the user to paste manually.

    line 134
  10. Distinctive:

    Run when the user explicitly requests consolidation.

    line 145
  11. Very specific:

    Read ~/.claude/memory/inbox.md.

    line 149
  12. Very specific:

    If the only content is the header and the HTML comment, there is nothing to process — say so plainly (0 entries) and go to step 4.

    line 150
  13. Distinctive:

    Run stale decay marking:

    line 187
  14. Very specific:

    Commit and push. push-memory does git add -A across ~/.claude, which holds session transcripts and credentials.

    line 193
  15. Very specific:

    If a memory file is missing, say so explicitly: identity.md not found — run brain-dump to populate.

    line 232

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

ENGRAM — Memory System

Inbox-first, file-native memory layer for Claude sessions. Plain Markdown in ~/.claude/. Claude reads it automatically. You capture without decisions.


Locked Configuration

These decisions are final. Do not re-litigate them.

IDDecisionChoice
D-01Capture interfaceBoth: shell alias + natural language in-session
D-02Storage formatPure Markdown — no YAML frontmatter
D-03Project scopingGlobal + per-repo on demand (15+ projects — stubs created as needed)
D-04ConsolidationManual on-demand only
D-05Session ritualzsh precmd hook — auto-surface on terminal open
D-06Memory decaySoft: [STALE] prefix after 60 days, at consolidation time

Machine constants: MacBook Pro M5 Pro · Apple Silicon · /opt/homebrew · iTerm2 · zsh Workspace: ~/Projects (alias ~/Code) · Map: ~/Code/WORKSPACE.md · Repo: mazze93/projects-workspace


File Architecture

~/.claude/
├── CLAUDE.md              ← Claude reads this automatically (Claude Code + Cowork)
└── memory/
    ├── inbox.md           ← append-only capture log; never reorganized manually
    ├── identity.md        ← who Mazze is, machine config, preferences
    ├── projects.md        ← Claude-specific context per project (status, open questions, decisions)
    ├── patterns.md        ← recurring conventions across projects
    └── decisions.md       ← architectural decisions log

~/Code/{repo}/
└── CLAUDE.md              ← per-repo scoped context; created on demand via engram-stub-repo

~/Code/WORKSPACE.md        ← authoritative project registry (source of truth for project list/domains)

Mode Routing

Identify the mode from user intent, then execute that mode's steps in full.

User signalMode
"set up ENGRAM", "install memory system", first-time setup on new device→ Setup
"run brain-dump", "rebuild my context", "interview me for context"→ Brain-dump
"remember X", "add to memory", "note that", "log that", "capture this"→ Capture
"consolidate", "process my inbox", "clean up memory"→ Consolidate
"what's my context", "surface memory", session start, project name + missing context→ Surface

Mode 1 — Setup

Run on first-time setup or reinstall on a new device.

  1. Read references/setup-script.sh.
  2. Write the script to ~/engram-setup.sh using the Write tool, or present it for the user to copy if write access is unavailable.
  3. Tell the user to run:
    chmod +x ~/engram-setup.sh && ~/engram-setup.sh
  4. After the script completes, ask: "Run brain-dump session now to populate memory files, or continue later?"
  5. If now → go to Brain-dump mode.

Restore path (existing memory on the GitHub remote): m3.local does not resolve from this machine (checked 2026-09-12) and identity.md only ever listed it as a candidate remote, never a wired one — so do not plan a restore around it. Memory lives on GitHub. Restore from mazze93/dotfiles-claude before running the setup script, so nothing is overwritten:

git clone https://github.com/mazze93/dotfiles-claude.git ~/.claude   # fresh machine
git -C ~/.claude pull                                                # or, if ~/.claude exists

Then run the setup script to scaffold any missing files and install shell additions.


Mode 2 — Brain-dump

Populate all memory files from scratch via structured interview.

Read references/brain-dump-interview.md and run the full interview. Do not skip or batch sections. After each section, write the corresponding file before moving to the next. All writes use the Write tool (or Bash echo for appends).

Files produced in order:

  1. ~/.claude/memory/identity.md
  2. ~/.claude/memory/projects.md
  3. ~/.claude/memory/patterns.md
  4. ~/.claude/memory/decisions.md
  5. ~/.claude/CLAUDE.md — synthesized last, from the four above

Post-restore variant: Use the interview to update files rather than replace. Identify stale content, add missing context, and prefix outdated entries with [STALE].


Mode 3 — Capture

Handle natural-language memory capture mid-session.

  1. Extract the core fact, decision, or context item from the user's message.
  2. Format it: YYYY-MM-DD HH:MM: [content]
  3. Append to ~/.claude/memory/inbox.md via Bash:
    echo "$(date '+%Y-%m-%d %H:%M'): [content]" >> ~/.claude/memory/inbox.md
  4. Confirm: → captured to inbox

Rules:

  • Never categorize, tag, or route at capture time. Inbox is append-only.
  • Never modify any file other than inbox.md in this mode.
  • If running in Cowork without shell access to ~/.claude/, output the formatted entry as text for the user to paste manually.

Shell path (wired by setup script — no action needed):

remember "text here"

Mode 4 — Consolidate

Run when the user explicitly requests consolidation. Never run automatically.

Consolidation is performed inline by these steps. There is no separate skill.

  1. Read ~/.claude/memory/inbox.md. Each capture is one line, YYYY-MM-DD HH:MM: text. If the only content is the header and the HTML comment, there is nothing to process — say so plainly (0 entries) and go to step 4. Never manufacture consolidation work out of an empty inbox.
  2. Route each entry to exactly one structured file, preserving its date:

    Entry is aboutGoes to
    who Mazze is, machine config, tooling preferenceidentity.md
    a specific project's status, open question, in-flight stateprojects.md
    a convention that recurs across projectspatterns.md
    a dated choice with a rationaledecisions.md (format: YYYY-MM-DD · scope · decision · rationale)
    Append under the appropriate ## heading — never rewrite or reorder existing
    content. An entry that fits nowhere stays in the inbox; report it as unrouted
    rather than forcing it into a file.

    Entries starting [promote] come from session-journal's close-out. Route them by gist like any other entry, and carry the -> <pointer> across as a source suffix — for decisions: YYYY-MM-DD · scope · decision · rationale · src: <pointer>. ENGRAM holds the pointer, never a copy of the journal text.

    Pointer liveness (the rot rule, applied to memory) — before writing a [promote] entry, check its pointer:

    • <repo>/docs/journal/<file> § <title> — the file exists and grep -F '<title>' <file> finds the title.
    • stratum:<log>/<dec> — resolve with stratum status <dec> --log <log>. If Stratum is unreachable, mark it src: [UNVERIFIED-SRC] <pointer>.
    • Dead pointer — mark it src: [DEAD-SRC] <pointer> and list it in the report as outstanding. Never drop the entry.

    Markers go inside the src: suffix, never at the start of the line: the line must still begin with its date or engram-mark-stale (which matches ^YYYY-MM-DD) stops ageing it. [DEAD-SRC] is not [STALE]: stale means old per D-06; dead-src means the citation no longer resolves.

    Liveness only reports; it never blocks consolidation or push-memory.

  3. Once every entry is written and the writes are verified, truncate inbox.md back to its two header lines. Processed entries live in the structured files from then on; the inbox is a buffer, not an archive.
  4. Run stale decay marking:
    engram-mark-stale   # installed by setup script
    The function always prints "stale items marked" whether or not it changed anything, so verify the real count yourself: grep -c '\[STALE\]' ~/.claude/memory/*.md.
  5. Commit and push. push-memory does git add -A across ~/.claude, which holds session transcripts and credentials; that directory's .gitignore is a deny-by-default allowlist that keeps them out. Read git status --short before pushing, and prefer staging explicit paths (memory/ CLAUDE.md) over the blanket sweep.
    push-memory         # installed by setup script
  6. Report: entries processed, entries unrouted, stale items flagged (counted, not assumed), [DEAD-SRC] / [UNVERIFIED-SRC] pointers written, git push status.

Stale decay rule: Any dated entry (line beginning YYYY-MM-DD) older than 60 days receives a [STALE] prefix. Items are never deleted automatically. The user triages [STALE] items manually at the next consolidation.


Mode 5 — Surface

Present a compact context digest. Read directly from files — never infer or fabricate.

Format:

── ENGRAM ────────────────────────────────────────
Machine: M5 Pro · /opt/homebrew · iTerm2 · zsh

Active projects:
  · [list from projects.md ## ACTIVE section]

Last inbox entries:
  [last 3 non-blank, non-comment lines from inbox.md]

[If project-scoped]: {Project} context:
  Stack:          [from per-repo CLAUDE.md]
  Status:         [active / maintenance / paused]
  Open questions: [list]

[If stale items exist]: ⚠ stale items present — run consolidation
──────────────────────────────────────────────────

If a memory file is missing, say so explicitly: identity.md not found — run brain-dump to populate. Do not guess at content.


Guardrails

  • Never overwrite existing memory file content outside of Mode 2. Inbox is append-only. Structured files are updated only through Mode 4's routing steps.
  • Never fabricate project context not present in memory files. Missing context is surfaced as a gap, not filled in.
  • No auto-consolidation. D-04 = manual. Consolidation requires explicit user request.
  • precmd digest stays compact: ≤8 lines. Verbose terminal output defeats the purpose.
  • All paths use $HOME — never hardcode /Users/mazze/.
  • [STALE] is additive: prefixes are added, never removed automatically.
  • Per context-synapse: operational context inference is a permanent hard stop. Never suggest, implement, or discuss it.
  • Per secure-pride: any auth, identity, or data-handling change requires explicit GDPR/CCPA/SOGI compliance check before proceeding.

References

  • references/setup-script.sh — complete idempotent bash setup script
  • references/brain-dump-interview.md — structured interview, 5 sections, workspace-aware (reads WORKSPACE.md)
  • references/repo-stubs.md — generic + domain-specific CLAUDE.md templates; use engram-stub-repo for any project

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.