claude-code - 💡(How to fix) Fix Memory system not automatically consulted after context compaction

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

After context compaction, Claude Code does not automatically consult its own memory system before taking actions. This leads to:

  1. Repeating known mistakes — Operational rules saved in memory (e.g., VPS connection info, port configurations, service management procedures) are ignored after compaction
  2. Wasted tokens and time — The agent re-investigates problems that were already solved and documented in memory files
  3. User frustration — Users have to re-explain the same things every time compaction occurs

Concrete Example (2026-05-09)

  • Memory file feedback_vps_operations.md clearly states: "Service port is 5004, configured via systemd PORT=5004"
  • Memory file reference_vps_connection.md documents full VPS connection details
  • After compaction, agent saw an old crash log (port 3000 EADDRINUSE from 2026-05-02) and started investigating a non-existent problem
  • Agent proposed unnecessary fixes (port changes, Docker container stops) instead of simply answering the user's question (today's race schedule)
  • The memory files existed and contained the correct information, but were not consulted before acting

Expected Behavior

  • After context compaction, the memory system should be automatically loaded and consulted before any VPS/server/deployment operations
  • Memory rules should function as persistent operational knowledge that survives compaction
  • The agent should check memory before starting investigations, not after wasting tokens

Related

  • #29890 — Context compaction loses operational knowledge (148+ upvotes)

This is a systemic issue, not a procedural one. The memory system exists but is not integrated into post-compaction behavior.

🤖 Generated with Claude Code

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING