AI coding agents are notorious for amnesia, forcing developers to re-explain project context in every session. A new open-source project called IHMT (Infinite Hierarchical Memory Tree) aims to fix this by implementing long-term memory using a simple tree of plain text files. Rather than relying on heavy vector databases or cloud services, IHMT stores knowledge locally in a recursive structure that agents can search efficiently, offering a portable and transparent solution for persistent context.
The Architecture of Remembering
IHMT organizes information into a hierarchy: raw text leaves at the bottom, recursive JSON summaries in the middle, and a single root.json file at the top. When an agent queries the memory, it walks down this tree, opening only the necessary branch files. This approach ensures that retrieval costs grow logarithmically with the amount of stored data, not linearly. The system claims to retrieve relevant context in just 200β900 tokens, whether the memory holds 50 entries or 50,000, significantly reducing token usage compared to pasting entire note dumps into the prompt.
Cross-Agent Compatibility and Privacy
The tool is designed as a standard stdio MCP (Model Context Protocol) server, making it compatible with a wide range of agents including Claude Code, Codex, and opencode. Because it operates entirely on the local disk, IHMT ensures privacy by sending no data to external servers. Users can copy the memory folder to back it up or move it between machines, and the plain text format allows for easy inspection and version control. The system also handles temporal changes by flagging outdated information, ensuring agents prioritize current facts while retaining historical context for reference.
Honest Performance Metrics
While IHMT promises efficiency, the documentation is candid about its limitations. In A/B tests with headless Claude Code sessions, the model often preferred using standard tools like grep over the IHMT project tools, and forcing the use of IHMT sometimes increased costs. The primary value proposition remains the cross-session memory, where the reduction in repetitive context loading offers tangible savings. The project also includes a graphical interface for browsing the memory tree, diagnosing search confidence, and viewing timelines of fact changes, all without external dependencies.
Key Takeaways
- IHMT uses a hierarchical tree of plain text files for local, portable long-term memory.
- It supports multiple agents like Claude Code, Codex, and opencode via the MCP standard.
- Retrieval is efficient, costing 200β900 tokens per query regardless of total memory size.
- The system tracks fact changes over time, flagging outdated information automatically.
- No cloud services, databases, or API keys are required; everything runs on the local disk.
The Bottom Line
IHMT is a pragmatic answer to agent amnesia, trading complex vector infrastructure for the transparency and portability of plain files. Itβs a win for developers who want their AI context to be inspectable, local, and shared across tools.