Memory system not automatically consulted after context compaction

Open 💬 5 comments Opened May 8, 2026 by logimania

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

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗