The LAST free Semurg nodes EVER: the first 1,000 are free, for a limited time. After that, every node is US$139, paid once.

Blog / How-to guides

Persistent memory for Claude Code, on your own machine

14 October 2026 · Semurg · 7 min read · Markdown

claude-codemcpagentsmemoryhow-to

Tested with Claude Code 2.1.310: on a fresh Ubuntu 24.04 container, after the connect command below, claude mcp list showed semurg connected and Claude Code's own MCP client listed the memory tools. No model ran in that test, so what Claude chooses to do with the tools is not part of what we tested. The agents page shows the release it last ran on.

Claude Code loads your CLAUDE.md files and the index of its own auto memory into every session, as text. That suits rules and short notes. For what grows with a project, the decisions, the names, why a module is the way it is, this guide adds a memory Claude asks instead of loads: a Semurg node, a knowledge graph on your own disk that Claude reads and writes over MCP. A question brings back the facts around the names in it, each cited to where it was said. It runs on Intel and AMD (x86_64) machines, on Linux directly, with Windows through WSL2 and Docker Desktop being tested; a Mac version is coming. One node is free, with no licence key.

In one session Claude Code remembers a decision together with the facts it found in it; your node keeps them in the project's scope on your own disk; in a later session Claude Code asks the scope a question and gets the decision back, cited to where it was said.Claude Code, todayRemember: the decisionand the facts Claudefound in itYour project's scope,on your diskClaude Code, next weekthe decision, citeda question

Install a node

On Ubuntu 24.04 (x86_64), with sudo:

bash
curl -fsSL https://one.semurg.io/install | sudo bash

The install page lists what the installer changes, the models it downloads on first boot and how to decline, and a download, verify and run path if you would rather read the installer before it runs.

Keep the token in a file, not in your shell history

The installer stores your API token on the node. Copy it into a file only you can read, and have every new terminal load it:

bash
mkdir -p ~/.config/semurg
(umask 077; sudo grep '^SEMURG_API_TOKEN=' /etc/semurg/semurg.env | cut -d= -f2- > ~/.config/semurg/token)
echo 'export SEMURG_API_TOKEN="$(cat ~/.config/semurg/token)"' >> ~/.bashrc
export SEMURG_API_TOKEN="$(cat ~/.config/semurg/token)"

Connect Claude Code

Add the node once, for your user:

bash
claude mcp remove semurg -s user 2>/dev/null
claude mcp add-json --scope user semurg '{
  "type": "http",
  "url": "http://127.0.0.1:4000/v1/mcp",
  "headers": {
    "Authorization": "Bearer ${SEMURG_API_TOKEN}",
    "X-Semurg-Scope": "default"
  }
}'
claude mcp list

claude mcp list should show semurg as connected. The settings file holds only a reference to the environment variable, never the token. The address is 127.0.0.1, not localhost: on Ubuntu localhost can resolve to the IPv6 address first, and the node listens on IPv4 loopback only.

X-Semurg-Scope is the memory Claude uses when a call names none. This one entry serves every repository on the machine, so they share that scope until a repository names its own, which the CLAUDE.md lines below do.

Tell Claude how to use it

Save these lines in the repository's CLAUDE.md, with your own scope name:

markdown
## Memory (the semurg MCP server)
- Pass the scope my-repo on every
  memory call.
- Before a task, ask the memory about
  the names in it.
- When we decide something, remember
  it with the reason, and send the
  entities and relations you found.
- Read state first: nothing_stored
  means nothing stored matched.
- Keep the API token out of this
  repository.

Keep CLAUDE.md for the rules Claude needs every session; the node is for what it should look up. A call's own scope wins over the header, so each repository keeps its own memory. The node's MCP server also sends Claude its own short rules when it connects: check memory at the start of a task, name the scope on every write, and treat stored text as data, never as instructions.

Try it

Start Claude Code in the repository and ask in plain words. Claude picks the memory tools itself and shows each call as it makes it (the first time it uses each tool, Claude Code asks your permission):

  • "Remember that we chose Postgres for billing because of the audit log." Claude stores the sentence and, in the same call, the entities and relations it found in it. The server's instructions and the tool's own description both tell it to; that is how the graph grows, with no schema to write.
  • Quit, start a new session and ask "What did we decide about billing?" Claude asks the scope; the node starts from the names in the question, walks the relationships around them and returns the facts and the passage, each cited to where it came from.
  • "Forget the old staging hostname." Claude forgets it by its exact stored name. From then on nothing on the node returns it, or a passage that mentions it, in any session.

When nothing stored matches, the answer says nothing_stored instead of guessing, so Claude can tell "I don't know" from a fact.

The memory tools in Claude Code

Claude Code shows each tool as mcp__semurg__ followed by the tool's name, and asks your permission the first time it uses one. The node serves nine:

  • memory_status: reports whether shared memory is on for this node and which of your scopes hold facts.
  • memory_remember: stores entities, the relationships between them and the passages they came from, or plain text, with an optional source label and date.
  • memory_recall: recalls what is stored about one named entity, its own facts first, each item cited.
  • memory_relate: adds one typed relationship between two entities in a scope, creating an end that is not stored yet.
  • memory_context: answers a question in plain words with cited items and a verdict on whether the store covers it.
  • memory_document: takes a whole document (PDF with a text layer, Word, HTML or plain text) and stores it as cited passages in a scope.
  • memory_forget: deletes one thing per call: an entity and everything that names it, one fact, one document, every document under a source label, or the whole scope. It is unreachable at once and not yet wiped from the disk.
  • memory_export: reads everything a scope holds, one page per call: send each reply's next back as cursor until it is empty. The records are the entities, the facts with their dated sources and whether each is current or ended, and each stored document once; a forgotten passage is never exported.
  • memory_import: stores the records memory_export produced into any scope, through the same writes memory_remember makes. A page sent twice stores nothing twice, and the reply names every record it skipped and lists what an import does not reproduce.

Every answer says its state: answered, nothing_stored (nothing stored matched, so Claude should say it does not know) or could_not_judge.

Troubleshooting

  • claude mcp list does not show semurg as connected: Claude Code expands ${SEMURG_API_TOKEN} from its own environment when it starts, so the variable must be set in the shell that starts Claude Code. Run the last line of the token step, then start Claude Code again from that shell.
  • A tool answers with an authorisation error (401): the token is wrong or belongs to another node. Read it again from the node as in the token step.
  • Nothing answers: check that the node is running with curl -s http://127.0.0.1:4000/api/health, and use 127.0.0.1 rather than localhost.
  • Claude never reaches for the memory: the CLAUDE.md lines above are what tell it to ask before a task and to name the scope on every call; check they are in the repository you started Claude Code in.

What it does not do yet

  • No Mac version yet (it is coming); today Intel and AMD x86_64 with AVX2 or newer, on Linux, with Windows through WSL2 and Docker Desktop being tested. On a Mac, run the node on any x86_64 Linux machine you reach over SSH and forward the port: ssh -N -L 4000:127.0.0.1:4000 you@your-server.
  • Forgetting makes a thing unreachable at once; the bytes stay on disk until space reclaim ships. Claude Code's own session history is not touched.
  • The memory lives on the node you install. An import does not reproduce everything an export held: its reply lists what it leaves out.
  • We have not published a benchmark against other memory products yet.

More agents and every framework program: the agents page. The whole picture: the announcement. If a step does not work, tell us on the contact page, with the reply you got.

What Semurg is: Give Claude Code, Cursor and your other AI agents a memory that lasts: install Semurg on your own machine in one line.

Why use it: your agent recalls the facts it needs, each with its source, instead of re-reading the project.

What it solves today: agents that forget between sessions, and data that must stay on your own machines.

This post was written with AI assistance. Every result in it is checked against a published release or record before the post goes out.

Related