agentleFS
NeerajG03NeerajG03/JEFF/memory/CLAUDE.md

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 —…

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
  1. Very specific:

    After a successful curate pass, sweepRetention(home) removes:

    line 95
  2. Very specific:

    Does NOT touch archive/ or canonical memory.

    line 98
  3. Very specific:

    No CGO. SQLite (when needed) uses modernc.org/sqlite.

    line 102

≈ “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.

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

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 + /learn slash 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

FileWhat it doesOwner
types.goMemoryType, ScopeKind, Bucket, path resolvers, EnsureLayoutFND
disable.goDisabled(jeffHome) gate — checks JEFF_MEMORY_DISABLE env var and jeff.json memory.disabledR3
frontmatter.goYAML frontmatter parse/write — worker-facing 3-field schema + canonical (bi-temporal) schemaFND
proposals.goproposals/<persona>/<task>/*.md CRUDFND
queue.goqueue/sessions/*.json CRUD + archive/<iso-week>/queue/ rollover; dedupes by (task, transcript)FND
store.goCanonical-memory access (ListEntries, ReadEntry, EntryFilter), write helpers (WriteCanonical, Invalidate, Supersede). Skips corrupt entries with stderr warning. Refuses duplicate non-core writes.FND
inject.goMemory-pack composition + CLAUDE.md/GEMINI.md addendum. Index capped at 30 entries per scope. Atomically writes via tmp+rename.A (stub)
suppress.goNative-memory suppression (Claude/Gemini/opencode)A (stub)
curate.gomarlowe 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.gojeff memory doc contentD (stub)
init.goInitialize/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 entries

Schema

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)

PersonaJEFF_MEMORY_CAN_ADDAllowed ops
jenko, schmidt, eric, hardy, dicksonunset / 0propose, list, show, status, doc
marlowe1all 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 propose returns an error.
  • memory/disable.go provides the Disabled(jeffHome string) bool helper. The memory package must NOT import the root jeff package (import cycle risk).

Corrupt-file resilience

  • ListEntries and ListScope skip entries that fail to parse, emitting a fmt.Fprintf(os.Stderr, "warning: …") and continuing. Only I/O errors on the directory walk itself remain fatal.
  • listQueueItems similarly skips malformed or unreadable JSON files.

Duplicate-write refusal

  • WriteCanonical refuses to overwrite an existing non-core entry. Returns an error mentioning --supersede.
  • The core bucket (a single well-known file per scope) is exempt — it is meant to be rewritten.
  • Supersede writes a new entry then invalidates the old one; covered by existing tests.

Queue dedupe

  • WriteQueueEntry keys on <task>-<transcriptBase>.json when a transcript path is available. Same task + same transcript → idempotent overwrite.
  • Falls back to <task>-<unixnano>.json when transcript is empty.

Index cap

  • buildMemoryIndex caps each scope's bullets at 30, sorted by importance desc then valid_from desc. 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.log files 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 real JEFF_HOME.
  • Frontmatter parser must round-trip cleanly (worker- and canonical-schema both).
  • New canonical writes are owned by Worker C only — store.go is read-only here.

See also

  • exports/memory-research/specs/EPIC.md — full design
  • exports/memory-research/specs/FND.md — this package's spec
  • exports/memory-research/00-synthesis.md — TL;DR

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.