Compaction destroys persistent identity/relationship context despite memory system
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
- Over multiple sessions, build up a working relationship with specific framing: peer/teammate identity, communication preferences, autonomy rules
- Save these as persistent memory files (feedback type memories in the project memory system)
- Allow compaction to occur (context fills up, auto-compacts)
- 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:
- Re-read ALL feedback-type memory files (not just task context)
- Reconstruct relationship/identity framing as part of the compaction summary
- 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
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗