Before the recent upgrade to Claude Code's memory system, I shared a plan for adding memory to Claude Code. Recently, a new round of upgrades was implemented, with the core change being the separation of "what to remember, when to remember, and where to store" into three layers:
**Capture Layer** — Defines which signals are worth recording: over 15 minutes of troubleshooting, counterintuitive technical discoveries, trade-offs in strategic decisions. Not all conversations are worth remembering; key is filtering. **Timing Layer** — Controls the writing rhythm: after completing each task, record progress; after each commit, update project context; upon detecting leave signals ("That's it," "Leaving"), immediately save everything. No manual trigger needed. **Routing Layer** — Ensures data is written to the correct location: technical pitfalls → project; reusable experience → daily progress. Uses ChromaDB for vector storage + BM25 keyword search as a plain text backup. Implements double writing (database + file); indexes are incrementally synchronized rather than rebuilt entirely.
Each layer manages one aspect: adding new capture rules doesn't require changing the writing logic; changing storage locations doesn't affect signal recognition. Claude Code's hooks mechanism is naturally suited for this event-driven pipeline.
**Result:** Cross-session memory is finally stable. Claude can remember last week's troubleshooting experiences, and during debugging, it will review historical records before acting.
View Original
This page may contain third-party content, which is provided for information purposes only (not representations/warranties) and should not be considered as an endorsement of its views by Gate, nor as financial or professional advice. See Disclaimer for details.
Before the recent upgrade to Claude Code's memory system, I shared a plan for adding memory to Claude Code. Recently, a new round of upgrades was implemented, with the core change being the separation of "what to remember, when to remember, and where to store" into three layers:
**Capture Layer** — Defines which signals are worth recording: over 15 minutes of troubleshooting, counterintuitive technical discoveries, trade-offs in strategic decisions. Not all conversations are worth remembering; key is filtering.
**Timing Layer** — Controls the writing rhythm: after completing each task, record progress; after each commit, update project context; upon detecting leave signals ("That's it," "Leaving"), immediately save everything. No manual trigger needed.
**Routing Layer** — Ensures data is written to the correct location: technical pitfalls → project; reusable experience → daily progress. Uses ChromaDB for vector storage + BM25 keyword search as a plain text backup. Implements double writing (database + file); indexes are incrementally synchronized rather than rebuilt entirely.
Each layer manages one aspect: adding new capture rules doesn't require changing the writing logic; changing storage locations doesn't affect signal recognition. Claude Code's hooks mechanism is naturally suited for this event-driven pipeline.
**Result:** Cross-session memory is finally stable. Claude can remember last week's troubleshooting experiences, and during debugging, it will review historical records before acting.