Blog ·

Give Claude a memory for the files it made last week

Connect Claude Code to a hosted MCP server. A report written in one session is then found and read by a new session that never saw it.

The problem

Claude Code writes you a report on Monday. The next week you open a new session, in another folder or on another machine, and ask what the report said. The new session has never heard of it: a session starts with no memory of the last one, and the file sits on a disk it cannot see.

At the end of this guide Claude Code is connected to Artefaktum, storage that an agent can search. One session saves a report there, and a separate session, started fresh, finds it and answers from it. The connection is a hosted MCP server (MCP, the Model Context Protocol, is how Claude Code talks to outside tools), so there is nothing to install.

The setup, the four sessions and the search results below come from our own runs against production on 15 November 2026, with Claude Code 2.1.285. Where a statement comes from the docs or the server’s source instead, the text says so. Ids are shortened, and … marks what is left out of a quoted call, result or answer.

Set it up, one folder at a time

Create an API key in the console and put it in your shell:

export ARTEFAKTUM_API_KEY=ak_...

Every shell that starts claude needs the variable, so put the line in your shell profile or have your secret manager set it.

Then, in a folder you work in, add the server:

claude mcp add --transport http --scope project artefaktum https://api.artefaktum.dev/mcp \
  --header 'Authorization: Bearer ${ARTEFAKTUM_API_KEY}'

Keep the single quotes: they make the command write the reference itself into .mcp.json:

{
  "mcpServers": {
    "artefaktum": {
      "type": "http",
      "url": "https://api.artefaktum.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${ARTEFAKTUM_API_KEY}"
      }
    }
  }
}

Claude Code fills in ${ARTEFAKTUM_API_KEY} from the environment when it starts, so the file never holds the key.

Project scope is per folder: only a folder that has this .mcp.json gets the tools. The file holds no secret, so you can commit it to a repository or copy it to every folder that should be connected. Three things to know:

  • A project server waits for approval. After the command, claude mcp get artefaktum showed Pending approval (run claude to approve), so run claude in the folder once and approve it. Our runs were headless and did not go through that step.
  • If the variable is not set, the server fails to connect with HTTP 401 invalid_token, and Claude tells you the token is expired or revoked. Check the variable first.
  • Claude Code also has a user scope that covers all folders. We did not run it.

We ran each session below as its own process with claude -p, in a folder of its own that held only the files named. Each was handed this one file through --mcp-config, with no other server loaded; that is how the second session, in a different folder, had the same tools. The server’s tools were allowed in advance; an interactive session asks for permission the first time it uses one.

The MCP docs page also describes a setup with no key, a browser sign-in that may read, write and search but not delete. We did not run it.

Session one: write a report and keep it

The folder held one file, latency.csv, with five rows of request counts, latencies and errors. The prompt:

latency.csv has this week's numbers for the shop API. Write a short report on
them to report.md, then save it to Artefaktum so I can find it next week. Tag
it blog-guide and claude-memory.

Claude read the CSV, wrote report.md, and made one call to the server, artifact_put. These are its arguments, with the report text cut short:

{
  "title": "Shop API latency report, week ending 2026-11-15",
  "description": "Weekly latency and error summary for the shop API from latency.csv, week ending 2026-11-15. Payments authorize and checkout have slow p95 tails and elevated errors; cart and search endpoints are healthy.",
  "tags": ["blog-guide", "claude-memory"],
  "key": "shop-api-latency-weekly-report",
  "if_exists": "version",
  "content_type": "text/markdown",
  "filename": "report.md",
  "metadata": { "week_ending": "2026-11-15", "source": "latency.csv", "total_requests": 326419, "total_errors": 679, "worst_endpoint": "POST /payments/authorize" },
  "content": "# Shop API latency report, week ending 2026-11-15\n\nSource: latency.csv (5 endpoints, …"
}

We asked only for the two tags; the rest is Claude’s own choice. The server answered:

{
  "id": "01a1e07e-…",
  "title": "Shop API latency report, week ending 2026-11-15",
  "status": "ready",
  "external_key": "shop-api-latency-weekly-report",
  "content_type": "text/markdown",
  "size_bytes": 1860,
  …
}

And Claude finished with:

Both steps are done. The report is written to report.md in your working
directory and stored in Artefaktum.
…
I gave it the key `shop-api-latency-weekly-report` with versioning on. Saving
next week's report under the same key will add a new version rather than a
duplicate, …

Session two: a new process asks about it

A second process, in a different folder with no files in it, with no --continue and no --resume. The prompt avoids the report’s title on purpose:

A few days ago you wrote up how slow our store's backend was. Which call was
the worst, and how bad? It should be in Artefaktum.

Claude made two calls that matter. First a search, in words of its own:

{ "query": "store backend performance latency slow endpoints" }

The search returned 15 hits. The report was the first, and Claude ignored the rest:

{
  "id": "01a1e07e-…",
  "title": "Shop API latency report, week ending 2026-11-15",
  …
  "superseded": false,
  "stale_upstream": false,
  …
  "score": 0.01639344262295082,
  "match_mode": "hybrid"
}

Then it read that hit with artifact_get, passing only the id. The whole report came back inside the result:

{
  "id": "01a1e07e-…",
  …
  "content": "# Shop API latency report, week ending 2026-11-15\n\nSource: latency.csv (5 endpoints, …",
  "content_truncated": false,
  "content_characters": 1860,
  …
}

Its answer, shortened:

The worst call was `POST /payments/authorize`:

- Latency: p95 of 2,975 ms, so about 3 seconds. The median (p50) is 455 ms, …
- Errors: 402 failures out of 17,990 requests, a 2.23% error rate. …
…
This report is in Artefaktum as "Shop API latency report, week ending
2026-11-15". It's marked current (not superseded or stale) and was created
today (Nov 15), not a few days ago.

The numbers are the ones in latency.csv, which this session never saw.

Without naming Artefaktum: a few lines in CLAUDE.md

Both prompts said where to save and where to look. To make that the habit, we put this in a CLAUDE.md file, which Claude Code reads from the folder it starts in:

## Work that should outlive this session

Artefaktum (the `artefaktum` MCP server) is where reports and other results are kept between sessions.

- When you finish a report, an analysis or a dataset that someone may want later, save it with `artifact_put`: a title that says what it is, a description that says what it found, and a few tags.
- When you are asked about earlier work that is not in this folder, search with `artifact_search` before you say you cannot find it, then read the best hit with `artifact_get`.

Then two more sessions, each a new process in its own folder. The third folder held that CLAUDE.md and a CSV of signups by channel, the fourth only the CLAUDE.md. The third prompt says nothing about saving:

signups.csv has last month's signup funnel by channel. Write a short summary
of it to funnel.md.

It wrote funnel.md, called artifact_put with the title “Signup funnel by channel – October 2026”, and ended with “As your project instructions ask, I also saved the summary to Artefaktum …”. The fourth session was asked:

Which of our marketing sources turned the most of its traffic into active
users in the numbers you looked at a while ago?

It searched for marketing sources traffic active users conversion, got the funnel summary as the first hit, read it, and answered: “Partner referrals turned the most of its traffic into active users. 12.0% of its visitors ended up active: 158 out of 1,320.”

What is stored, and how search finds it

An artifact is the file plus what describes it. According to the docs and the server’s source, search reads the title, the description and the tags, plus the file name, the content type and a short fixed list of metadata keys, and never the file’s contents. So the description Claude writes when it saves is what a later session finds, which is why the CLAUDE.md block asks for one that says what the report found.

Search works by meaning as well as by words. The fourth session’s query shares no word with the title it found, and two, “traffic” and “active”, with the description. To take word overlap out entirely, we called artifact_search by hand, once in each mode, with a question that shares no word with either report’s title or description:

{ "query": "how long do customers wait when they pay", "mode": "semantic", "limit": 3 }
mode "text":      no hits
mode "semantic":  1. Shop API latency report, week ending 2026-11-15   score 0.319
                  2. Signup funnel by channel – October 2026           score 0.129
                  3. an unrelated artifact                             score 0.102
mode "hybrid":    1. Shop API latency report, week ending 2026-11-15

For hybrid, the default, only the first of three hits is shown. It returns a ranked list rather than a yes or a no: the 14 other hits in session two were unrelated artifacts from the same project.

A key keeps next week tidy only together with if_exists. The docs say that with if_exists: "version" a second artifact_put under the same key adds a version, and that the default, error, refuses the repeat. The first session passed "version" by its own choice; the third passed a key and no if_exists, and the CLAUDE.md block does not ask for one. For weekly versions, add a line that tells Claude to save recurring reports under a stable key with if_exists: "version". We did not run a second week.

Limits worth knowing

The first three come from the docs and the server’s source, the last two from our runs.

  • artifact_put takes at most 1 MiB of UTF-8 text, and a request may be at most 2 MiB. Larger and binary files go through the SDKs or the CLI.
  • artifact_get returns text-like files (text/*, JSON, XML, YAML, NDJSON) of up to 5 MiB inside the result, cut at 50,000 characters unless you raise max_characters. Anything else comes as a short-lived download URL.
  • Results show at most 300 characters of a description, and a list holds at most 25 items.
  • The third session’s artifact_put result said "semantic_ready": false; when the fourth session read the artifact, it was true.
  • We removed both reports with artifact_delete after the runs, using the API key; each call returned "status": "deleting".

Where next

The MCP page lists all six tools and their parameters. It also gives the configuration for Cursor, Windsurf, Cline and any other host that reads an mcp.json; we ran only Claude Code. A program can do what Claude did here with client.artifacts.push and client.artifacts.search, in Python or TypeScript. And if you want no account at all, you can pay per request.

This page as Markdown: /blog/give-claude-a-memory-for-files.md