You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 26, 2026. It is now read-only.
session-review aggressively saves per-correction feedback memories into harness auto-memory. Each save in isolation is reasonable — a real correction with a quotable line, captured at the right grain — but the cumulative effect over a short window is signal degradation.
Concrete case from the sgg project (worktree: /Users/bryan/.claude/projects/-Users-bryan-code-sgg/memory/):
11 feedback memories saved in 2 days (2026-05-20 → 2026-05-21).
7 of the 11 clustered on the same theme — "how to draft a teammate-facing reply" — across six files: pr-review-voice, reply-scope-discipline, drop-recap-inventory, close-read-source-material, engage-mental-model, draft-framing-not-policy. Each file spent a paragraph defending its distinctness from the others ("Distinct from [[pr-review-voice]] — this is the third axis, density", "different facet (format vs. scope)", "different failure mode"). When the notes themselves are working that hard to disambiguate, the granularity has exceeded the usefulness of the slicing.
Manual consolidation (2026-05-21) collapsed 6 of those → 2 (teammate-reply-craft + teammate-reply-grounding) and rewrote a 7th (ship-dont-just-draft → post-approved-drafts) to fix a memory-drift error. Net: 7 files → 3, ~150 lines of feedback content cut to ~80, and the cross-link cruft disappeared. Substance preserved.
The retrieval surface is the load-bearing problem. MEMORY.md is always loaded into context; individual feedback files are conditionally loaded when relevant. When 7 of the index entries point at variants of the same principle, the model can't easily extract THE rule — it matches against 6+ overlapping memories with near-identical triggers instead of one comprehensive principle.
This is the same shape of problem #28 is solving for PR review findings (clustering, signal weighting), but for captured memories. Adjacent to #84 (a different specific session-review Step 9 fix), though that one is structural in the skill itself.
Proposed behavior
A research spike — not an implementation issue. Enumerate options for adding a consolidation step somewhere in the capture flow, with tradeoffs, so a follow-up issue can pick a direction with evidence.
Output of the spike: a short doc (in-repo or in-notes — implementer's call) that lists candidate approaches, sketches a representative example for each, names tradeoffs (cost, latency, false-merge risk, user friction, where the logic lives), and lands on a recommendation or a narrower set of options worth prototyping.
Scope
In scope
Enumerating consolidation approaches. Starting set (not exhaustive, not pre-selected):
Consolidation prompt inside session-review at memory-write time — before adding a new memory, the skill reads existing MEMORY.md entries and asks "does this update or merge with an existing memory?" The user approves a merge vs. add-new at the same gate.
Periodic offline consolidation pass — a separate skill (e.g. /consolidate-memory) that the user invokes when they notice fragmentation; reads the whole memory directory, proposes merges, user approves.
Similarity-based deduplication at write time — semantic similarity check against existing memory descriptions; flags candidates as potential merges without forcing it.
Deferred saves — session-review collects feedback candidates but doesn't write to auto-memory until N similar corrections accumulate (or a session-end batch step looks across the run for clusters).
Two-tier memory — auto-memory writes go to a "fresh" tier first; a promotion step (manual or automatic) consolidates fresh-tier into the canonical tier.
Tag-or-cluster-based index — keep the granular files but reshape MEMORY.md so cluster entries collapse under one heading, reducing always-loaded context surface even when the underlying files stay split.
Naming tradeoffs honestly — every approach has a failure mode (false merges that erase nuance, friction that suppresses captures, latency that makes session-review slower, etc.).
Pointing at the manual consolidation that just happened in sgg as a worked example — what merged cleanly, what stayed separate, what signaled "these are actually the same principle."
Out of scope
Picking the winning approach. The spike opens the design space; the follow-up issue narrows it.
Implementing anything. No SKILL.md edits, no new skill files, no schema changes.
Auto-merging existing memories without user approval. The capture-with-approval contract is load-bearing — any approach must preserve it.
Touching the harness memory format itself. The frontmatter / MEMORY.md index shape is fixed by the harness; consolidation operates on the existing format.
Cross-project consolidation. Auto-memory is per-project (~/.claude/projects/<slug>/memory/); the spike scopes to within-one-project fragmentation. Cross-project patterns are a follow-up question.
Implementation hints
Worked example to reference: the 2026-05-20 → 2026-05-21 sgg cluster. Before/after files visible at /Users/bryan/.claude/projects/-Users-bryan-code-sgg/memory/. The seven originals were merged manually; reading the originals plus the two consolidated outputs (feedback_teammate_reply_craft.md, feedback_teammate_reply_grounding.md) shows what "obvious merge" looks like in practice.
The teammate-reply cluster gave a clear signal that an approach should be able to detect: every file's body explicitly defended its distinctness from siblings. "Distinct from" / "different facet" / "different failure mode" recurring across N files is a tell that the writer is feeling the overlap. A consolidation approach could flag this textually, semantically, or both.
Watch for the memory drift failure mode: a memory saved after one correction can overgeneralize from that single moment (see the ship-dont-just-draft → post-approved-drafts rewrite — the original encoded "don't gate on a second approval" which was the opposite of the user's actual two-phase preference). Any consolidation approach should make drift easier to catch, not harder.
The trigger for proposing this spike is itself in-scope as data: Bryan asked Claude (in sgg) to "review the session review memories cairn notes has been creating for this repo. are we bloating the agents with too much memory and context?" The fact that the question arose at all is signal — the fragmentation reached a level the user noticed without prompting.
Acceptance criteria
A doc exists (location TBD by the spike author) enumerating at least the six approaches listed in "In scope" above, plus any others the author surfaces.
Each approach has: a one-paragraph sketch, an example of what it would do on the sgg worked case, and 2–4 tradeoffs.
The doc names which approaches preserve the user-approval contract and which would require relaxing it.
The doc lands on either (a) a recommended approach with a follow-up implementation issue to file, or (b) a narrower set (2–3) worth prototyping with criteria for choosing among them.
Closes this issue when the doc is linked from a comment.
Open questions
Should the spike consider approaches that prevent fragmentation (write-time consolidation) separately from approaches that repair it (read-time / periodic consolidation), or treat them as one design space? Lean: treat as one, since the same user judgment ("is this a new memory or an update?") drives both — but flag if they diverge enough to need separate framings.
Is there a lighter-weight signal than per-memory similarity that catches the "these files defend their distinctness from each other" pattern? E.g., counting cross-references in Related: blocks. Worth exploring as a cheap heuristic before reaching for embeddings.
Should the spike scope include MEMORY.md index design separately from the underlying files? The always-loaded surface vs. the conditionally-loaded surface are different cost shapes — an approach could reshape one without touching the other.
Problem / Motivation
session-reviewaggressively saves per-correction feedback memories into harness auto-memory. Each save in isolation is reasonable — a real correction with a quotable line, captured at the right grain — but the cumulative effect over a short window is signal degradation.Concrete case from the
sggproject (worktree:/Users/bryan/.claude/projects/-Users-bryan-code-sgg/memory/):pr-review-voice,reply-scope-discipline,drop-recap-inventory,close-read-source-material,engage-mental-model,draft-framing-not-policy. Each file spent a paragraph defending its distinctness from the others ("Distinct from [[pr-review-voice]] — this is the third axis, density", "different facet (format vs. scope)", "different failure mode"). When the notes themselves are working that hard to disambiguate, the granularity has exceeded the usefulness of the slicing.teammate-reply-craft+teammate-reply-grounding) and rewrote a 7th (ship-dont-just-draft→post-approved-drafts) to fix a memory-drift error. Net: 7 files → 3, ~150 lines of feedback content cut to ~80, and the cross-link cruft disappeared. Substance preserved.The retrieval surface is the load-bearing problem.
MEMORY.mdis always loaded into context; individual feedback files are conditionally loaded when relevant. When 7 of the index entries point at variants of the same principle, the model can't easily extract THE rule — it matches against 6+ overlapping memories with near-identical triggers instead of one comprehensive principle.This is the same shape of problem #28 is solving for PR review findings (clustering, signal weighting), but for captured memories. Adjacent to #84 (a different specific session-review Step 9 fix), though that one is structural in the skill itself.
Proposed behavior
A research spike — not an implementation issue. Enumerate options for adding a consolidation step somewhere in the capture flow, with tradeoffs, so a follow-up issue can pick a direction with evidence.
Output of the spike: a short doc (in-repo or in-notes — implementer's call) that lists candidate approaches, sketches a representative example for each, names tradeoffs (cost, latency, false-merge risk, user friction, where the logic lives), and lands on a recommendation or a narrower set of options worth prototyping.
Scope
In scope
session-reviewat memory-write time — before adding a new memory, the skill reads existingMEMORY.mdentries and asks "does this update or merge with an existing memory?" The user approves a merge vs. add-new at the same gate./consolidate-memory) that the user invokes when they notice fragmentation; reads the whole memory directory, proposes merges, user approves.session-reviewcollects feedback candidates but doesn't write to auto-memory until N similar corrections accumulate (or a session-end batch step looks across the run for clusters).MEMORY.mdso cluster entries collapse under one heading, reducing always-loaded context surface even when the underlying files stay split.sggas a worked example — what merged cleanly, what stayed separate, what signaled "these are actually the same principle."Out of scope
~/.claude/projects/<slug>/memory/); the spike scopes to within-one-project fragmentation. Cross-project patterns are a follow-up question.Implementation hints
sggcluster. Before/after files visible at/Users/bryan/.claude/projects/-Users-bryan-code-sgg/memory/. The seven originals were merged manually; reading the originals plus the two consolidated outputs (feedback_teammate_reply_craft.md,feedback_teammate_reply_grounding.md) shows what "obvious merge" looks like in practice.memory driftfailure mode: a memory saved after one correction can overgeneralize from that single moment (see theship-dont-just-draft→post-approved-draftsrewrite — the original encoded "don't gate on a second approval" which was the opposite of the user's actual two-phase preference). Any consolidation approach should make drift easier to catch, not harder.sgg) to "review the session review memories cairn notes has been creating for this repo. are we bloating the agents with too much memory and context?" The fact that the question arose at all is signal — the fragmentation reached a level the user noticed without prompting.Acceptance criteria
sggworked case, and 2–4 tradeoffs.Open questions
Related:blocks. Worth exploring as a cheap heuristic before reaching for embeddings.MEMORY.mdindex design separately from the underlying files? The always-loaded surface vs. the conditionally-loaded surface are different cost shapes — an approach could reshape one without touching the other.