My AI Chats Had a 30-Day Self-Destruct Timer. So I Built Them a Memory.

I use a lot of AI tools. Claude in the browser, Claude Code on my laptop, Codex, and a handful of agents on a Mac mini at home that work while I sleep. Each one keeps its own history, in its own format, in its own corner of the disk.

A few weeks ago I asked Claude Code a simple question: do our past conversations still exist somewhere? Digging into the answer, I found out that Claude Code clears out session transcripts after 30 days by default. My coding history had been sitting on a timer I never set.

That stung. A lot of my thinking happens in those sessions. Why I picked one tool over another. What broke at midnight, and what fixed it. It was all there, and nobody was keeping it.

Three Kinds Of Context

My first instinct was to push everything into Notion, which I already use to track my projects. That would have been a mistake. Notion is good for decisions and project status. It is terrible as a dumping ground for thousands of chat transcripts, and a source of truth buried in transcripts stops being one.

So I split “context” into three layers, each kept in a different place:

  • Instructions. One plain text file that tells any AI agent who I am, how I work and what it must never do. Claude, Codex and Cursor all read the same file. I update it once and every tool picks it up.
  • Live decisions. Notion, reached by the agents through its official connector. What is being built, what was decided, what comes next.
  • History. Every conversation, converted into Markdown files in one folder. Searchable, readable, and owned by me.

The third layer was the one missing.

Building The Archive

The claude.ai side was easy. You can export your whole account, and a small script turned the export into 846 Markdown files, one per chat, going back to March 2024.

Coding sessions needed more thought. Raw transcripts are huge because they record every file an agent read and every command it ran. Most of that is noise, and some of it is dangerous: API keys have a habit of turning up in command output. So a second script keeps only what was actually said, my messages and the AI’s replies. It drops the tool output, leaves a one-line marker for each action, and redacts anything that looks like a secret.

It runs by itself. A hook fires whenever I start or end a Claude Code session, converts anything new, and finishes in under a second when there is nothing to do. The raw transcripts can expire on whatever schedule they like now, because the Markdown is the archive. (I bumped the timer to a year anyway.)

The whole archive is about a thousand files and 36MB. That is smaller than a few minutes of phone video.

One Home For Several Machines

My laptop is not on all the time. The Mac mini is, and it is where my agents live, so it became the hub: a private git repository that only machines on my home network can reach. When a session ends, the laptop commits its new files and pushes them there. Each machine writes only to its own folder, so they never trip over each other.

Nothing goes to GitHub or a cloud drive. A hook on the laptop refuses to push anywhere except the Mac mini. Anything from my day job lives in a separate folder that never leaves the laptop at all.

The Part That Broke

For two days after I built it, nothing synced. Conversion ran fine and new files kept appearing, so everything looked healthy. But the hook on the laptop had been installed without the one flag that tells it to push. The Mac mini’s setup was correct the whole time, which made the gap harder to spot.

The second failure was quieter still. If the folder had any unrelated file with uncommitted changes, git refused to pull, the sync failed, and nothing said so. One extra option fixed it, and I tested the fix by deliberately leaving a mess in the folder.

The lesson I keep relearning: check what is actually installed, not what you meant to install. Automation that fails silently is worse than no automation, because you stop checking.

What It Is Like To Use

Now when I ask an agent “what did I decide about Postiz?” or “why did we drop that model?”, it searches the folder and quotes my own words back to me, with a date. A small search script ranks the files and pulls up the right session without calling any AI model at all. It works the same from Claude, Codex or one of my agents, because underneath it is just text files and a script.

Switching tools stopped being scary, too. If a better model comes out next month, my history comes with me.

Why This Matters Beyond My Setup

Most businesses I talk to are building up this kind of history without noticing. Staff think through problems in ChatGPT, Copilot or Claude. The reasoning behind a quote, a policy or a fix ends up inside a vendor’s chat log, in a format you cannot search across, on a timer you did not set.

You do not need my setup to deal with that. Three questions get you most of the way:

  • Where does our AI conversation history actually live, and when does it expire?
  • Can we export it in a format that does not depend on the vendor?
  • Which of it is worth keeping, and which should never be kept at all?

The tools will keep changing. Your history should not have to change with them.