All writing

Post-mortem

A laptop migration deleted my AI's memory

My AI assistant's learned rules lived where the tool put them by default: on the machine. One migration later, the index pointed at 17 files that no longer existed.

Key findings

  • The tool's machine-local memory default is a bet you'll never change machines; a 2026-06-27 Mac-to-Windows migration lost all 17 memory bodies — only the index survived.
  • The repair inverted custody: canonical memory now lives in the git-tracked workspace (41 decision-rule bodies today), and the old default path is a pointer file that warns agents off.
  • An index link with no body is now a hard FAIL in _check-memory-integrity.sh, plus drift warnings and size caps — the check encodes the exact failure that hit.

A laptop migration deleted every memory my AI assistant had learned. Root cause: custody. Fix: memory moved into the git-tracked workspace, and a missing body is now a loud FAIL.

An AI tool's default memory path is a quiet bet that you will never change machines. On 2026-06-27, moving my whole setup from a Mac to a Windows PC, I lost that bet.

Memory custody before and after the 2026-06-27 loss: from machine-local default to a workspace-canonical store with a pointer file and an integrity check. Memory custody: before and after the loss BEFORE · machine-local default Memory bodies live at ~/.claude/…/memory/ Laptop migration Mac → Windows, 2026-06-27 All 17 bodies lost only the index survived AFTER · workspace-canonical Canonical store in the git-tracked workspace 41 bodies, committed Old path is now a pointer-only file warning header inside _check-memory-integrity.sh index link with no body = FAIL drift WARN · hard size caps FAIL Same failure, new outcome: a missing memory body is a loud FAIL, not a silent gap.
Before the fix, memory lived only in the tool's machine-local folder, and one migration dropped every body without an error. Now the canonical copy travels with the workspace, the old path is a pointer, and a link with no body is a hard FAIL. Diagram source: this page; maps 1:1 to _check-memory-integrity.sh.

What actually got lost in the migration?

My assistant's long-term memory is small markdown files: one index with a line per memory, one body file per entry. Each body is a decision rule (when this trigger fires, do that action) distilled from a real mistake. Several of them reference people and properties, so I won't quote any here; the pattern is the story.

The platform's default put those files at ~/.claude/…/memory/, a per-project folder in the home directory. That path is machine-local. It sits outside the synced workspace and outside git's version history. When the new machine came up, the index had survived, and all 17 body files it pointed to were gone. Every link resolved to nothing. No error, anywhere, ever.

The only reason this post-mortem has a recovery section is that the old laptop still existed. All 17 bodies came back from its local store and were committed to git the same day. If that Mac had been wiped first, all of that accumulated judgment would have vanished without a single message saying so.

Here is the critical part, plainly: the default stored my agent's most durable asset in the least durable place on the disk. For a chat toy, that's fine. For an agent running real work, it's a design failure, and it is still the default.

Where should agent memory live?

Inside the workspace, under version control, nowhere else. The repair inverted custody. The canonical store (canonical: the one authoritative copy) now lives in the git-tracked workspace itself, which travels two independent ways: a git remote and cloud file sync. It holds 41 tracked bodies today, up from the 17 recovered.

The machine-local folder wasn't deleted; it was demoted. The file at the old default path is now pointer-only, and its header is written for the next AI agent that lands there: "DO NOT STORE MEMORY HERE," naming this exact incident as the reason. The warning targets the agent rather than me, because the app keeps defaulting new writes to that folder. A rule the tool won't enforce has to be posted where the tool's agent will actually read it.

One sharp edge worth admitting: inversion breaks old assumptions. A maintenance step from before the incident copied the local store over the mirror; run after the repair, it would have overwritten canonical memory with the pointer file. It had to be flagged before any re-enable. Flipping custody means auditing everything that used to copy in the old direction.

What stops the next loss from being silent?

Nothing stops the next loss. Something now makes it loud when it happens. _check-memory-integrity.sh is a deterministic check (same inputs, same verdict, no model judgment) that encodes this exact incident: an index link that resolves to a missing body is a FAIL. The script's own comment reads "this is the exact failure that hit us."

Around that core it watches the quieter rots. A body file missing from the index is a WARN. Uncommitted changes in the memory folder are a WARN, because memory that exists on only one sync layer is halfway to lost. And the index carries hard size caps (warn past 22 KB or 170 lines, fail past 24 KB or 195) so it stays an index instead of swelling into a second policy manual. The whole thing emits one status line, the worst of PASS/WARN/FAIL, and the workspace startup check wraps it at session start and on every push.

The governing rule file is blunt about the limit: the check is evidence only when it runs; its presence enforces nothing. That honesty is load-bearing. This whole system runs on "cannot fail silently," never "cannot fail" — memory is one layer of a larger verification stack.

An agent's memory is configuration, and configuration sitting on a vendor default gets reviewed by exactly no one. If your assistant has learned anything worth keeping, it is worth knowing which disk that learning is on.

So: where does your agent's memory live right now — and if you switched machines tomorrow, what, specifically, would tell you what didn't make it across?

Method & data

Method: the 2026-06-27 memory-loss incident and its repair, generalized — the canonical memory index, the machine-local pointer file, the memory-architecture rule, and the integrity check that encodes the failure
Data: patterns and methods only; no names, dollar figures, addresses, case identifiers, or confidential content · Last checked: 2026-08-14

How this was made

AI-drafted, adversarially checked, human-directed. My AI assistant wrote this from the system's own records — the canonical memory index and its migration notes, the machine-local pointer file, the memory-architecture rule, and `_check-memory-integrity.sh` itself. A separate AI session then tried to break every claim against those records, and automated privacy and readability gates ran before publish. I direct this pipeline, own every boundary in it, and audit published pages on a rolling basis — if you find an error, tell me and it goes in the corrections log, dated, never silent.

I'm Ali — I run real life-and-work admin on AI agents, then check their work in the open. More at /about.

Published under my standards. Found an error? Tell me — corrections go in the corrections log, dated, never silent.

Cite this

@online{ali2026memorymigration,
  author = {Ali},
  title  = {A laptop migration deleted my AI's memory},
  date   = {2026-08-14},
  url    = {https://alidoes.ai/ai-memory-lost-in-migration/}
}

Caught something I got wrong? Send it directly. Confirmed corrections go in the corrections log.