Skip to content

Migrate the feedback-memory store into KB events or shared guidance #859

Description

@williamthorsen

Problem

Generalizable behavioral feedback has accumulated as per-project agent memories. A memory is scoped to one project on one machine, so a rule meant to apply everywhere lives in a single context and is absent — or divergent — across the rest. #721 establishes the going-forward rule (codify generalizable feedback in the shared source; reserve memories for local facts) but explicitly defers auditing and migrating the existing store to its own ticket. This is that ticket.

Context

  • Feedback memories live in per-project stores under ~/.claude/projects/<project>/memory/, which is machine-local. This machine holds 174 feedback-type memories across 10 project stores (codeassembly 79, devtools-afg 36, configs-macos 15, sidekicks-atlassian 14, coding 12, node-monorepo-tools 8, workshop 7, plus three single-entry stores). The other machines hold their own stores, countable only by running the enumeration there: the work machine (used most) likely holds the largest, the second personal machine (used least) the smallest.
  • Because ~/.claude is machine-local, the migration runs once per machine. The git-synced codeassembly KB vault is the cross-machine backstop: the same memory already migrated from another machine is detected by its origin and routed to deletion rather than re-captured.
  • Recurrence is signal, not noise. The KB counts and ranks events by how often a pattern recurs, so a lesson recorded in several projects is genuine evidence and must survive as one event per origin. Only a re-encounter of the same origin memory — a re-run here, or a memory already migrated from another machine — is a true duplicate, so dedup keys on origin provenance (origin project and session), not on topic-equivalence.
  • The migration routes each memory to one of three destinations; it does not author shared guidance itself:
    • Capture — a generalizable rule that should propagate is recorded as a codeassembly KB event via capture-event, which migrates the memory out of its store. A later distillation pass codifies these events into shared guidance (shared/AGENTS.md, a skill body, or .agents/PROJECT.md), per Codify generalizable feedback in shared guidance, not per-project memories #721.
    • Retain — a genuinely local, non-propagating fact (a project deadline or quirk) stays a memory.
    • Delete — a memory redundant with a prior capture or with existing shared guidance is removed, including the feedback-capture-feedback-in-kb-not-memory redirect rule, whose guidance now lives in shared/AGENTS.md.

Proposed solution

Audit every feedback-type memory in every project store on each machine and route each to its proper home with the #650 skill: capture as a codeassembly KB event (a later distillation pass codifies events into shared guidance, per #721), retain as a memory only when genuinely local, or delete when redundant. Dedup on origin, not topic — a lesson that recurred across separate projects is captured as one event per origin, and a candidate is deleted as redundant only when an existing event shares its origin, which is what converges a re-run or another machine's run. On a machine with many memories, scope each pass to one store with the skill's --store <slug> flag, so classification runs in a lean, single-project context. Before classifying a store, ground the routing in the origin project: the enumerator resolves each store's slug to its working directory when it maps to a live repo on the machine, and the classifier reads that project's .agents/PROJECT.md so a rule the project already codifies is caught. Grounding is best-effort — a store whose slug does not resolve is classified ungrounded, never blocked. Run once per machine; pull the vault before and push after. Leave each store holding only genuinely local, non-propagating memories.

Acceptance criteria

Must have

  • Every feedback-type memory in every project store on the machine is triaged to exactly one destination: a captured codeassembly KB event, a retained local memory, or deletion as redundant.
  • No generalizable feedback remains as a per-project memory on any machine after migration; only genuinely local facts persist.
  • Dedup keys on origin provenance: a lesson recurring across separate stores is captured as one event per origin occurrence, and a candidate is deleted as redundant only when an existing event shares the same origin (origin project and session), whether from a re-run or another machine.
  • A memory that narrates a violation of already-codified guidance is captured as a ,mistake event, not deleted — an agent breaking a codified rule is fresh signal that the guidance is not landing. Only a memory that merely restates existing guidance, adding no signal the guidance does not already carry, is deleted as redundant.

Should have

  • Each affected MEMORY.md reflects its post-migration store.
  • Classification is grounded in the origin project's own guidance when the store's slug resolves to a live repo on the machine; grounding is best-effort and never blocks a store that does not resolve.

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions