JEFF / memory
CLAUDE.md1 starsChanged 3 months agoMITView on GitHub
This package is in a dual-API transitional state during EPIC gig-1d33 (memory subsystem v1). The two APIs share a Go package but no function names collide. They will coexist until E migrates callers and deletes the legacy file. cmd/jeff/memory/*.go mirrors this with one cobra subcommand per file. The root Cmd is wired into cmd/jeff/main.go. Worker-facing — 3 fields, mirrors Claude Code: Canonical (marlowe-enriched, bi-temporal) adds: status, scope, goal_served, importance, valid_from, valid_to, supersedes, superseded_by, verifier, provenance, source. Soft-invalidate via valid_to —…
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- crew/AGENTS.mdAGENTS.md
- hooks/AGENTS.mdAGENTS.md
- memory/AGENTS.mdAGENTS.md
- persona/AGENTS.mdAGENTS.md
- skill/AGENTS.mdAGENTS.md
- tui/AGENTS.mdAGENTS.md
- workspace/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- crew/CLAUDE.mdCLAUDE.md
- embed/CLAUDE.mdCLAUDE.md
- hooks/CLAUDE.mdCLAUDE.md
- persona/CLAUDE.mdCLAUDE.md
- skill/CLAUDE.mdCLAUDE.md
- tui/CLAUDE.mdCLAUDE.md
- workspace/CLAUDE.mdCLAUDE.md
- provider-integrationSkill
The file
We split this CLAUDE.md into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 95
After a successful curate pass, sweepRetention(home) removes:
- Very specific: line 98
Does NOT touch archive/ or canonical memory.
- Very specific: line 102
No CGO. SQLite (when needed) uses modernc.org/sqlite.
≈ “Common” is an estimate: at least 1 in 5 of the 29,248 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
memory/ — JEFF memory subsystem
This package is in a dual-API transitional state during EPIC gig-1d33 (memory subsystem v1).
- Legacy /learn API (in
memory.go,memory_test.go): persona memory + repo learnings +/learnslash command. Function names:PersonaMemoryDir,RepoLearningsDir,EnsurePersonaDir,EnsureRepoDir,LoadPersonaMemory,LoadRepoLearnings,InstallLearnCommand,AutoCurate. Phased out by Worker E (gig-1d33.6). - v1 API (everything else in this package): typed schema, propose/curate/store/queue primitives, cobra command tree under
cmd/jeff/memory/. New work uses this API.
The two APIs share a Go package but no function names collide. They will coexist until E migrates callers and deletes the legacy file.
v1 API — file roles
| File | What it does | Owner |
types.go | MemoryType, ScopeKind, Bucket, path resolvers, EnsureLayout | FND |
disable.go | Disabled(jeffHome) gate — checks JEFF_MEMORY_DISABLE env var and jeff.json memory.disabled | R3 |
frontmatter.go | YAML frontmatter parse/write — worker-facing 3-field schema + canonical (bi-temporal) schema | FND |
proposals.go | proposals/<persona>/<task>/*.md CRUD | FND |
queue.go | queue/sessions/*.json CRUD + archive/<iso-week>/queue/ rollover; dedupes by (task, transcript) | FND |
store.go | Canonical-memory access (ListEntries, ReadEntry, EntryFilter), write helpers (WriteCanonical, Invalidate, Supersede). Skips corrupt entries with stderr warning. Refuses duplicate non-core writes. | FND |
inject.go | Memory-pack composition + CLAUDE.md/GEMINI.md addendum. Index capped at 30 entries per scope. Atomically writes via tmp+rename. | A (stub) |
suppress.go | Native-memory suppression (Claude/Gemini/opencode) | A (stub) |
curate.go | marlowe curation loop, supersede semantics, archive sweep, .last-curated stamp, retention sweep. No longer archives on agent error (inputs preserved for retry). CurateOptions.Auto removed. | C |
doc.go | jeff memory doc content | D (stub) |
init.go | Initialize/Update/Migrate (retires legacy /learn API) | E (stub) |
cmd/jeff/memory/*.go mirrors this with one cobra subcommand per file. The root Cmd is wired into cmd/jeff/main.go.
v1 layout (created by EnsureLayout)
JEFF_HOME/
├── memory/ canonical — only marlowe writes
│ ├── personas/<name>/{GOAL.md,core.md,procedural/,semantic/,episodic/}
│ ├── repos/<repo>/{core.md,procedural/,semantic/,episodic/}
│ ├── projects/<key>/{core.md,procedural/,semantic/,episodic/}
│ └── orchestrator/ marlowe's own memory
├── proposals/<persona>/<task>/*.md workers write here
├── queue/sessions/*.json SessionEnd hook drops here
├── transcripts/<task>/ copies of session transcripts
└── archive/<iso-week>/ processed proposals + queue entriesSchema
Worker-facing — 3 fields, mirrors Claude Code:
---
name: <slug>
description: <one-liner>
type: user | feedback | project | reference
---
<body>Canonical (marlowe-enriched, bi-temporal) adds: status, scope, goal_served, importance, valid_from, valid_to, supersedes, superseded_by, verifier, provenance, source. Soft-invalidate via valid_to — entries are never deleted.
Permission model (enforced in B's add command)
| Persona | JEFF_MEMORY_CAN_ADD | Allowed ops |
| jenko, schmidt, eric, hardy, dickson | unset / 0 | propose, list, show, status, doc |
| marlowe | 1 | all of the above + add, curate |
Disable gate
The memory subsystem can be disabled via JEFF_MEMORY_DISABLE=1 env var or jeff.json memory.disabled: true. When disabled:
- Session-start and session-end hooks are no-ops.
- Pickup omits legacy persona-memory and repo-learnings sections from CLAUDE.md.
jeff memory proposereturns an error.memory/disable.goprovides theDisabled(jeffHome string) boolhelper. Thememorypackage must NOT import the rootjeffpackage (import cycle risk).
Corrupt-file resilience
ListEntriesandListScopeskip entries that fail to parse, emitting afmt.Fprintf(os.Stderr, "warning: …")and continuing. Only I/O errors on the directory walk itself remain fatal.listQueueItemssimilarly skips malformed or unreadable JSON files.
Duplicate-write refusal
WriteCanonicalrefuses to overwrite an existing non-core entry. Returns an error mentioning--supersede.- The
corebucket (a single well-known file per scope) is exempt — it is meant to be rewritten. Supersedewrites a new entry then invalidates the old one; covered by existing tests.
Queue dedupe
WriteQueueEntrykeys on<task>-<transcriptBase>.jsonwhen a transcript path is available. Same task + same transcript → idempotent overwrite.- Falls back to
<task>-<unixnano>.jsonwhen transcript is empty.
Index cap
buildMemoryIndexcaps each scope's bullets at 30, sorted byimportancedesc thenvalid_fromdesc. Overflow is reported as "…and N more — run 'jeff memory list --scope<scope>'".
Retention sweep
- After a successful curate pass,
sweepRetention(home)removes:transcripts/files older than 28 days (by mtime).queue/sessions/*-start.logfiles older than 7 days.
- Does NOT touch
archive/or canonical memory.
Conventions
- No CGO. SQLite (when needed) uses
modernc.org/sqlite. - Tests use
t.TempDir()— never touch a realJEFF_HOME. - Frontmatter parser must round-trip cleanly (worker- and canonical-schema both).
- New canonical writes are owned by Worker C only —
store.gois read-only here.
See also
exports/memory-research/specs/EPIC.md— full designexports/memory-research/specs/FND.md— this package's specexports/memory-research/00-synthesis.md— TL;DR
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
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.

