In the rapidly evolving landscape of AI agents, persistent memory has emerged as a crucial differentiator. While the open-source Hermes agent gained massive popularity due to its robust ability to remember past conversations, many users are deterred by its separate runtime requirements, security concerns, and strict limitations. Replicating and enhancing the best features of Hermes’ memory system directly inside Claude Code creates a private, cost-effective, and semantic-search-enabled memory setup that overcomes these limitations.
The Three Pillars of Agent Memory
To understand how to improve memory, we must analyze its three core phases: storage (saving important data), injection (loading context at session start), and recall (retrieving past data). While Claude Code’s default memory is historically limited, Hermes excels by injecting curated snapshots and writing turn-by-turn memories. However, Hermes relies on keyword matching (FTS5) for recall, meaning it fails to find past conversations unless the exact terms are used.
Rebuilding Memory Inside Claude Code
By building a custom memory framework directly inside Claude Code, developers can bypass Hermes’ drawbacks—such as the risk of its self-rewriting loops and the complexity of managing a separate virtual private server (VPS). The custom solution leverages three core concepts from Hermes:
- Frozen Snapshots: A size-capped (max 2,500 characters) file loaded silently at the start of each session to prevent context bloat.
- Dynamic Storage: An agent-led hook that runs after each turn to determine if new facts should be committed to short-term or long-term memory.
- Complete Capturing: Saving full conversation transcripts alongside summaries to ensure no context is permanently lost.
Enhancements Beyond Hermes
The rebuilt memory system addresses critical limitations in Hermes by introducing four advanced recall features:
- Semantic Search: Replaces keyword matching with vector embeddings, allowing the system to search by meaning rather than exact words.
- Source Citation: Tracks exactly who made a decision, when, and inside which conversation transcript, eliminating AI hallucinations.
- Historical Session Import: Allows importing and indexing months of existing Claude Code history, preventing a “day-one” empty slate.
- Team and Client Isolation: Enables a shared team brain while isolating client data based on ownership tags.
Conclusion
Continuity of context is far more valuable than endless tool integrations. By implementing a local, file-based memory system within your Claude plan, you achieve a highly portable, secure, and cost-effective AI assistant that never forgets past decisions.
Mentoring question
How could implementing a semantic, history-aware memory system in your current AI workflow change the way you delegate complex, multi-day development tasks?
Source: https://youtube.com/watch?v=9CiOwbmOKdU&is=0hlgJxYXMrT_Zq8Y