---
title: Compare self-hosted memory tools for coding agents
description: Compare Git instructions, a file-backed MCP memory server, and Loom on cross-session handoff, changed code, and audit history.
seo:
  title: Compare coding-agent memory tools
lastModified: '2026-11-25T19:30:36.000Z'
---

Choose memory by what the next coding session needs. Put reviewed rules in a Git-tracked
`AGENTS.md`. Use a file-backed MCP memory server when clients on the same host need a
shared store of observations. Use Loom when readers need separately issued credentials,
warnings tied to indexed source changes, or a SQL audit of who changed a decision.

## Three setups on the same repository

The fixture contains a Python retry function. A writer saves that `should_retry`
retries on HTTP 503 and points to the source revision. A fresh reader retrieves the
same decision. The fixture then changes the function to retry on HTTP 429, without
changing the saved decision. After reading it again, the reviewer records a correction.

| What the reader checks                      | Git-tracked `AGENTS.md`                                                                           | File-backed MCP reference server                                                                           | Loom                                                                                                   |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ |
| Did the decision survive a fresh session?   | A fresh checkout contained the exact note and source revision.                                    | A separate MCP process retrieved the exact observation from the shared JSONL file.                         | A separate MCP session retrieved the same memory ID, value, and source revision.                       |
| Did the read warn that the source changed?  | The note was unchanged. Comparing its recorded revision to the current revision exposed the edit. | The read still returned the original observation. Comparing the recorded revision in Git exposed the edit. | After indexing, the original lesson returned `changed` and the exact commit that altered the function. |
| Could an operator attribute the correction? | `git log` reported both commit authors for the note.                                              | The graph returned both observations. Those records carried no writer or revision fields.                  | A scoped SQL reader retrieved the two values, version numbers, and authenticated writer identities.    |

The Git author is commit metadata. The Loom SQL actor is the subject of the credential
that performed the write. The reference server's second observation was explicitly
appended by the reviewer. It does not establish which statement is current.

## Operating trade-offs

- **Git instructions.** Put rules every checkout needs under existing repository review
  and access controls. Readers need the relevant checkout. Record a source revision
  when a decision refers to code that can change independently of the instruction file.
- **File-backed MCP memory.** Give both clients access to the same durable storage path
  and back up that file. The test used sequential processes on one host. Configure
  filesystem permissions for the people and processes allowed to read it.
- **Loom.** Run the server and ClickHouse, provision scoped credentials, and configure
  the repository index if you need code-change checks. Back up the stores you operate.
  A code change is surfaced after indexing. The reviewer still validates the current
  behavior before using the lesson.

If the team is deciding between options, run a small pilot on a repository it maintains.
Keep the same tasks, starting revisions, and acceptance tests. Count model use, indexing,
maintenance, and human review time before assigning a budget. See the
[paired coding-task scorecard](/docs/getting-started/evaluate#compare-coding-agents-with-and-without-memory).

## Reproduce the comparison

Clone the [Loom repository](https://github.com/ClickHouse/loom) and run these commands
from its root. Use Docker, Node.js 24 or later with npm, Git, `jq`, `curl`, and `uv`.

```bash
uv sync --locked --python 3.12 --extra dev --extra code
bash examples/run_coding_agent_memory_comparison.sh
```

The runner creates a temporary repository, storage file, local server, and ClickHouse
container. It installs `@modelcontextprotocol/server-memory@2.2.1` as the MCP reference
arm and prints the two source revisions, the fields returned by the graph, and the
observed author and version records. If a default port is taken, set
`COMPARISON_CH_HTTP_PORT`, `COMPARISON_CH_NATIVE_PORT`, or `COMPARISON_API_PORT` to
unused ports before running it.

This is a protocol and storage check for one fixture. It exercises separate MCP
sessions and does not invoke a coding model. Use the
[Claude Code-to-Codex handoff](/docs/getting-started/connect-a-coding-agent#verify-shared-memory-between-claude-code-and-codex)
to check your clients and credentials. The comparison gives no estimates of model
accuracy, semantic recall, latency, throughput, or hosted cost.

[Read how Loom tracks code-linked decisions](/docs/use-cases/memory-linked-to-code) or
[query memory history with SQL](/docs/use-cases/self-hosted-clickhouse#audit-a-changed-decision-with-sql).
