← Back to blog

How to give an AI coding agent a memory that lasts

A notes file is advice, and an agent does not always follow advice. This is how one memory server serves every coding tool you use, and how Wyrm turns a recorded mistake into a stop.

Engineering11 min readBy Ryan Sebastian

Short answer (updated 23 November 2026, for Wyrm 10). To give an AI coding agent one memory that lasts between sessions and works across tools, run a memory server that speaks the Model Context Protocol (MCP). One server then serves Claude Code, Cursor, GitHub Copilot, Windsurf and Codex. Wyrm is the MCP memory server we build at Ghost Protocol. It keeps a project's decisions, ground truths, open tasks and failed approaches in one SQLite file on your own machine, and hands them back to the agent at the start of the next session. It is proprietary and free to use, needs no account for local use, and by default makes no LLM call and no hosted call to store or recall a memory.

npm install -g wyrm-mcp
wyrm-setup

What sets Wyrm apart is what it does with a remembered mistake. A notes file is advice, and an agent does not always follow advice. In Claude Code, Wyrm can refuse the exact repeat of a failure you have confirmed, before the command runs. In other clients it warns.

Wyrm at a glance

QuestionAnswer
What is it?A local-first MCP memory server for AI coding agents
Who makes it?Ghost Protocol (Pvt) Ltd, Colombo, Sri Lanka
Which tools does it work with?Claude Code, Claude Desktop, Cursor, GitHub Copilot, Windsurf, Codex, and other MCP clients that can run a local server
Where does the memory live?One SQLite file on your machine, ~/.wyrm/wyrm.db
What does it cost?Free to use. Paid plans add cloud sync and shared team memory
Can I use it without an account?Yes, for local use. Only the paid cloud plans use one
What is the licence?Proprietary, free to use. Versions up to 7.2.1 were open source
What is the current version?10.0.0, released 19 November 2026
What does it need?Node.js 22 or newer

Why do AI coding agents forget between sessions?

They forget because a new session starts with a new context window, and whatever was not written somewhere the agent will look is gone.

Most developers know the result:

Monday: "Here's how our auth system works. We use JWT with refresh tokens, httpOnly cookies, and the middleware lives in src/auth/. We decided last week to migrate from sessions to tokens because..."

Tuesday: "Remember the auth system? ...No? Okay, let me explain again."

This is not a model problem. GPT, Claude and Gemini all handle context well within a session. The gap is between sessions: what you decided, what you ruled out, and why.

The built-in answer is a notes file. Claude Code has CLAUDE.md and auto memory, and GitHub Copilot has its own memory. They help. For one tool on one machine, they may be all you need.

What is the Model Context Protocol, and why does it matter for memory?

The Model Context Protocol is an open standard, released by Anthropic in late 2024, that lets AI clients discover and use external tools. Think of it as a USB port for AI capabilities.

It matters for memory because one memory server can serve every MCP client you use. Your decisions stop living in a different notes file for each tool.

What is Wyrm, and how does it work?

Wyrm is an MCP server that gives AI coding agents a memory that survives the session, and then acts on what it holds.

┌──────────────────────────────┐
│          AI client           │
│ (Claude, Cursor, Copilot...) │
└──────────────┬───────────────┘
               │ MCP (stdio)
               ▼
┌──────────────────────────────┐
│       Wyrm MCP server        │
│  33 tools listed by default  │
└──────────────┬───────────────┘
               │
               ▼
┌──────────────────────────────┐
│   SQLite (WAL mode + FTS5)   │
│       ~/.wyrm/wyrm.db        │
└──────────────────────────────┘

Your AI client connects to Wyrm over stdio and Wyrm registers its tools. The everyday loop is four steps the agent runs itself:

StepToolWhat happens
Primewyrm_session_primeLoads the project's ground truths, open tasks and recorded dead ends at session start
Recallwyrm_recallFinds what is already known, by keyword and by meaning, before the agent works it out again
Checkwyrm_failure_checkAsks whether this approach already failed, before retrying it
Capturewyrm_captureStores new facts, lessons and tasks as the work goes on

How do I install Wyrm?

Two commands:

npm install -g wyrm-mcp
wyrm-setup

wyrm-setup detects the AI clients you have installed and writes the MCP entry for each. Restart the client, then ask it to call wyrm_capabilities to confirm the connection.

You need Node.js 22 or newer. The first setup also downloads a small local model for search by meaning. No API key is needed, and no account for local use. If the install trips on npm permissions or on npm's install-script rules, the troubleshooting page covers both.

How is Wyrm different from a notes file like CLAUDE.md?

A notes file is advice. Wyrm adds a stop.

The makers of the built-in memories say this themselves. Anthropic's Claude Code documentation: "Claude treats CLAUDE.md files and auto memory as context. They aren't enforced configuration." It goes on: "To block an action regardless of what Claude decides, use a PreToolUse hook instead." GitHub's Copilot documentation: "Neither memories nor custom instructions guarantee that Copilot will follow a rule every time, so review its work." Both were read on 23 November 2026, from the Claude Code memory page and the Copilot memory page.

That is a fair design for notes. It also means a rule you wrote down can still be missed.

Wyrm's failure memory is that kind of hook, written for you from the recorded incident:

  1. Something fails. It is recorded with wyrm_failure_record: what was tried and why it did not work.
  2. You confirm it once.
  3. In Claude Code, a repeat of the same command is refused before it runs.

This is real output from our own machine, on wyrm-mcp 10.0.0, 22 November 2026, using a harmless test command:

wyrm-guard: BLOCKED because this exact target previously failed and the
failure is unresolved (deterministic target match).
  failure #325 [low/command] seen 1x, last 2026-11-22 18:04:50
  target: echo wyrm-guard-probe-22nov
Do NOT retry the same action; pick a different approach.

On our deterministic benchmark (16 recorded failures, wyrm-mcp 9.2.1, 14 September 2026), the check matched all 32 repeats, 16 exact and 16 reworded, and wrongly blocked 0 of 16 new actions. That measures matching, on a build older than today's. The method, and the limits those numbers carry, are in the firewall receipt.

In November 2026 we read the vendor pages of nineteen agent memory tools, seven built in and twelve dedicated. We found none that refuses the repeat of a recorded failure before it runs. A missing page is not proof, so read that as "none we found".

The nearest equivalent is a hook rule, written by hand or generated with a tool. For a danger you already know, that is the stronger tool: it stops the first attempt, reworded or not. Wyrm covers the other case, the mistake nobody saw coming. Nobody has to write a rule. Once the failure is recorded and you sign it, it becomes the stop.

What goes wrong with agent memory in practice?

By count, the most common complaint is integration: getting the memory wired into a stack. The angriest reports are about silent loss, where a save reports success and nothing is stored.

That comes from our own research. We gathered 668 public reports of pain with agent memory tools (complaints, missing features and people shopping for alternatives): 630 GitHub issues and 38 Hacker News comments, dated February 2025 to July 2026, covering ten tools and the category in general. We sorted them with AI help by the pain described, and scored how frustrated each writer was, from 1 (mild) to 5 (furious).

Pain developers reportedReportsAverage frustration (1 to 5)Where Wyrm has an answer
Hard to wire into the stack1362.7Speaks MCP, for any MCP client that can run a local server
Memory quality: wrong, missing or duplicated recall1173.1Exact duplicates merge in daily upkeep, and near duplicates are staged for your review when you run the tidy pass
Setup and installation942.7Two commands, no API key, no account for local use
Data loss, often silent633.7A write returns a receipt: stored, queued for review, merged or dropped, and why
Performance and scale483.3No LLM call in the write or read path by default. Embeddings run on a small local model
Forced cloud, or privacy worries473.5Local first. Cloud sync is a paid opt in
Breaking changes333.4No claim
Cost262.9No model bill per memory
Documentation231.9No claim
Slow or absent support103.2No claim

Another 71 reports fit no category. Data loss drew the strongest frustration. Wyrm does not answer every report in a row: the last column shows the part it has an answer for. A thread through much of the list, in our words: you cannot tell what your agent stored, and it fails without saying so.

Some of these reports were fixed by their maintainers, one the same day it was filed. The list describes what a memory layer has to get right. It is not a verdict on any one tool.

Where does Wyrm fit beside the memory I already have?

Beside it. Nobody has to switch.

You already haveKeep it whenAdd Wyrm when
A notes file, or a tool's built-in memoryYou use one tool on one machine, and a forgotten rule costs littleA recorded mistake must not be repeated and you work in Claude Code, or several tools need the same memory
A hosted memory serviceYou are building a product that needs memory for each end userThe memory is for your own coding agents, on your own machine, with no key
A hook ruleYou already know the danger, and want it stopped on the first attemptThe mistake has not happened yet. Once it is recorded and you confirm it, the record becomes the stop

Wyrm is not alone on every feature. Other tools also run locally for free, return a receipt on save, or keep a note of failures. What we did not find, among the nineteen tools we checked, is a recorded failure that refuses the repeat.

What are Wyrm's limits?

  • The hard stop is Claude Code only. It runs through a hook. In other clients nothing enforces it: the agent sees the record when it calls wyrm_failure_check, and decides for itself.
  • It blocks the same command, not a similar one. The same command with its flags in another order, or inside a longer command line, is still blocked. Anything looser gets at most a warning.
  • It blocks what you recorded or confirmed. A failure an agent recorded warns until you sign it, unless it was recorded inside the same agent run.
  • By default the first mistake still goes through. Wyrm cannot stop a mistake nobody has recorded, apart from an optional list of known dangerous commands.
  • Blocks are scoped. In our test, the same command ran freely outside the project folder where the failure was recorded.
  • It is a safety net, not a sandbox. The guard fails open, and an agent with shell access could confirm a failure itself.
  • Wyrm is proprietary. Versions up to 7.2.1 (June 2026) were open source. Every version since is not, and the source is not published.

What technical decisions sit under it?

SQLite, one file. No database server to run. SQLite in WAL mode handles concurrent access (several AI clients, one database), and FTS5 gives full-text search without Elasticsearch.

FTS5 kept current by triggers. Database triggers update the full-text index on insert, update and delete.

No LLM in the memory path. By default, the failure check uses no model, and search uses a small embedding model that runs locally. Remembering something does not add a second AI bill, and nothing is sent to a hosted model unless you turn a hosted option on.

Local first. By default no memory data leaves your machine. Apart from the one-time model download, the default outbound calls include a daily npm version check and, on licensed installs, a licence check. Both can be switched off.

The codebase is TypeScript, and the 10.0.0 release notes record 6,733 passing tests.

What is new in Wyrm 10?

Wyrm 10 (19 November 2026) adds four things: memory tied to code, dates on facts, tidying by rule, and an opt-in session ledger. From its release notes:

  • Memory tied to code. A memory can be attached to a file, and says so when the code it describes has changed.
  • Dates on facts. You can ask what was true on a given day.
  • Tidying by rule. A tidy-up pass merges only what is the same memory and stages the rest for review.
  • A session ledger. An opt-in record of your Claude Code sessions, off until you turn it on.

The full list is in the changelog.

What did we learn building it?

MCP is early but powerful. The protocol is still evolving, but the core idea is right: give AI clients a standard way to use external tools. Building an MCP server feels like building a REST API, but for AI.

AI agents are better at using tools than we expected. We were worried about tool selection. With clear tool descriptions, modern models are remarkably good at calling the right tool at the right time.

Memory changes the relationship with AI. When your agent remembers your decisions, your architecture and your preferences, the conversation shifts from "let me explain everything" to "let's build on what we know."

Frequently asked questions

Is Wyrm free?

Yes. The local memory, the failure check and recall are free to use. Paid plans start at 29 US dollars a month for cloud sync. Shared team memory is on the Team plan.

Can I use Wyrm without an account?

Yes, for local use. Only the paid plans use an account, because those run in the cloud.

Is Wyrm open source?

No. Versions up to 7.2.1 (June 2026) were open source. Every version since is proprietary and free to use. The public repository holds the docs, the changelog and the community.

Does my code or my memory leave my machine?

By default no memory data leaves your machine. The memory is one SQLite file at ~/.wyrm/wyrm.db.

Which AI coding tools does Wyrm work with?

Claude Code, Claude Desktop, Cursor, GitHub Copilot, Windsurf and Codex, and other MCP clients that can run a local server.

Do I need an API key or Ollama?

No. Search by meaning uses a small embedding model that downloads once and runs on your machine.

Does Wyrm replace CLAUDE.md or Copilot memory?

No. It runs beside them. Keep your notes file for advice, and use Wyrm to keep a recorded mistake from repeating.

Can Wyrm stop my agent from making a mistake?

It can stop a repeat. In Claude Code it refuses a repeat of the same command once you have confirmed the failure. By default it does not stop a first mistake, and in other clients it warns.

Try it

npm install -g wyrm-mcp
wyrm-setup

If Wyrm earns a place in your workflow, a star on GitHub helps other developers find it.

Built by Ghost Protocol in Colombo, Sri Lanka.

A note asks. The dragon does not.

What changed since April 2026?

  • Install. It is now npm install -g wyrm-mcp and wyrm-setup. The old git clone steps no longer work.
  • Licence. Open source up to 7.2.1, proprietary and free to use since.
  • Search. Search by meaning is built in and on by default, alongside full-text search.
  • Failure memory. Wyrm records dead ends and can check a retry against them before it runs.
  • Tools. The April 2026 post on dev.to said 31. Today 33 are listed by default.

Give your agent a memory

Wyrm is on npm as wyrm-mcp, free to use on your own machine. Install it, run wyrm-setup, and the next session starts from what the last one learned.

Get the next one

New writing on security engineering and AI memory, from work we actually did. How we handle your email.