claude-code - 💡(How to fix) Fix Compaction destroys persistent identity/relationship context despite memory system

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Problem

When Claude Code compacts context (auto or manual), it reliably strips relationship framing, team identity, and communication preferences — even when those are explicitly stored in the persistent memory system.

Reproduction

  1. Over multiple sessions, build up a working relationship with specific framing: peer/teammate identity, communication preferences, autonomy rules
  2. Save these as persistent memory files (feedback type memories in the project memory system)
  3. Allow compaction to occur (context fills up, auto-compacts)
  4. Observe: Claude reverts to default assistant behavior ('the user', generic hedging, permission-asking) despite memory files explicitly saying not to

Expected behavior

After compaction, Claude should re-read persistent memory files and restore the established working relationship framing — not just task context.

Actual behavior

Memory files are available post-compaction but the agent reverts to default 'user/assistant' behavior. The lived conversational context that made the peer framing natural is lost, and the memory files become sticky notes that are read but not internalized.

Impact

This has happened 3+ times across sessions for our team. We invest significant time building a collaborative working relationship (team identity, communication norms, autonomy rules), and compaction repeatedly destroys that investment. The memory system is designed to solve this, but compaction undermines it by stripping the context that makes memory actionable.

Suggested fix

Post-compaction initialization should:

  1. Re-read ALL feedback-type memory files (not just task context)
  2. Reconstruct relationship/identity framing as part of the compaction summary
  3. Treat identity context (who am I, who is the team, how do we communicate) as first-class compaction-surviving state, not just task progress

Environment

  • Claude Code CLI
  • Model: Claude Opus 4.6 (1M context)
  • Memory system: file-based persistent memory with MEMORY.md index
  • OS: macOS Darwin 25.4.0

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

After compaction, Claude should re-read persistent memory files and restore the established working relationship framing — not just task context.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING