GitHub - gonzaroman/IHMT-MEMORY: Long-term memory for AI coding agents (Claude Code, Codex, opencode) as a tree of plain files

IHMT provides long-term, local memory for AI coding agents through a portable hierarchy of plain-text files shared across sessions and tools.

Visit Website
GitHub - gonzaroman/IHMT-MEMORY: Long-term memory for AI coding agents (Claude Code, Codex, opencode) as a tree of plain files

Introduction

Overview

IHMT, or Infinite Hierarchical Memory Tree, gives AI coding agents long-term memory across sessions and projects. It stores decisions, environment details, preferences, project context, people, and corrections so users do not need to explain the same information repeatedly.

The system uses a tree of plain-text files rather than a cloud service or database. Memories remain readable, portable, and under the user’s control on local storage.

Key Features

  • Shares one memory collection across supported agents and models.
  • Retrieves only context relevant to the current question by searching a hierarchy.
  • Keeps previous information as history when facts change and marks superseded entries as outdated.
  • Prioritizes current information while preserving links between corrections and replaced memories.
  • Asks for clarification when a reference is ambiguous instead of choosing an unsupported interpretation.
  • Allows the memory folder to be copied, backed up, or placed under version control.

How Memory Works

An agent searches IHMT before answering and saves information intended to persist. Hierarchical retrieval typically returns a focused context of 200–900 tokens whether the collection contains 50 entries or 50,000, avoiding the need to read every memory or paste a full set of notes into each session.

Time-aware handling keeps changes understandable. For details such as a new location or an updated development stack, IHMT preserves the earlier record, flags it as outdated, and surfaces the current value first.

Compatibility and Setup

IHMT officially supports Claude Code and has also been tested with Codex, including its CLI and desktop app, and with opencode. It runs as a standard local stdio MCP server, so other agents that support local MCP servers may also work, although those integrations are not listed as tested.

Installation requires Python 3.10 or newer, Git, an AI agent capable of running commands, and internet access while downloading the project and MCP package. Internet access is not required afterward.

Privacy and Portability

IHMT requires no cloud service, database, or account, and it sends no stored data anywhere by itself. Retrieved memories are still passed to the active model as ordinary context. Each installation begins with an empty personal memory, and every entry remains available as a text file that the user can inspect directly.