Back to Blog
Sep 03, 2026·Efe·6 min read·How-to · Migration

Import Past Conversations: Claude Code, Codex, OpenCode to Memory

You've got months of Claude Code, Codex CLI, and OpenCode history sitting on your machine — and a brand-new memory layer that's empty. @audaxic/memory-import closes that gap: one install, one dry run to preview, one real import with correct local-day timestamps. Everything lands in one searchable layer, and it's safe to re-run any time.

Why import instead of starting fresh

Switching agents already costs you context — starting with an empty memory doubles it. Your old sessions hold the decisions, preferences, and constraints you'd otherwise re-teach one by one (the exact loop described in Why Your Coding Agent Forgets Conventions). Importing turns that archive into day-one recall: your new agent answers "what did we decide about the API shape?" from real history, not from a summary you wrote by hand.

Install

The tool is open source (MIT) and needs Node 18+. Install it globally:

npm install -g @audaxic/memory-import

That gives you the audaxic-memory-import binary. Nothing else to configure yet — the first thing you'll run is a dry run, which doesn't even need an API key.

Get an API key (30 seconds)

Grab a free key at memory-dashboard.audaxic.com — Hobby is $0 (10K adds, 1K retrieve, unlimited projects). The importer finds your key in this order, so pick whichever fits your setup:

  1. --api-key ak_... flag on the command,
  2. AUDAXIC_API_KEY environment variable,
  3. ~/.config/audaxic/config.json with {"apiKey": "ak_..."} — shared with the Claude, Codex, and OpenCode plugins, so if you installed any of those, you're already set.

Dry run first — see what would import

Always preview before writing anything. This needs no key and changes nothing:

npx @audaxic/memory-import --dry-run

You'll get a per-tool summary like this:

Tool: codex — 6 source(s), 47 messages (31 user, 16 assistant)
  Day 2026-07-31: 47 messages → 2 batch(es)
DRY RUN — nothing sent

That tells you exactly what's there: how many conversations per tool, how many messages, and how they're grouped by day. If a tool shows zero, the importer simply didn't find its files on this machine — run it where you actually used that agent (see troubleshooting below).

What gets imported — and what doesn't

ToolSource on your machineImported
Codex~/.codex/sessions/**/rollout-*.jsonlUser + assistant messages
Claude~/.claude/projects/**/*.jsonl and ~/.claude/transcripts/*.jsonlUser + assistant (native files); user only (transcripts)
OpenCode~/.local/share/opencode/opencode.db (SQLite)User + assistant text

Tool calls, reasoning traces, system prompts, and non-text parts are skipped on purpose — they add noise without recall value. Timestamps are preserved as the message's local day (YYYY-MM-DD), so "what did we discuss in July?" searches work the way you'd expect.

Run the real import

Everything at once:

audaxic-memory-import

Or scope it. Import one tool, a date range, or a small sample first:

audaxic-memory-import --tool opencode --dry-run
audaxic-memory-import --tool claude --from 2026-08-01 --to 2026-08-31
audaxic-memory-import --limit 100

--tool accepts codex, claude, opencode, or all (the default) and can be repeated. Dates are inclusive, in your local timezone. --limit caps how many new messages go in — handy for a cautious first run.

Safe to re-run — with one warning

The importer remembers what it already sent in ~/.config/audaxic/import-state.json, so running it again only picks up new conversations. Weekly re-runs are the intended workflow: history stays in sync with zero bookkeeping.

Don't use --reset-state casually. It wipes that tracking, and the next run will re-import everything — creating duplicates. There is no bulk undo. One more nuance: on a failed request the tool retries once, and in rare cases that retry can land twice. If exact-once matters for a huge backfill, import in smaller date slices with --from/--to and check counts between runs.

What to do right after

Verify it worked: search your memory for something only your history knows ("what package manager do we use?"). Then install the agent plugins so new conversations keep flowing in automatically — npx @audaxic/memory-claude install, npx @audaxic/memory-codex install, or the OpenCode plugin (see MCP setup). Import handles the past; plugins handle the future. Full reference lives in the docs.

FAQ

Do I lose tool calls and reasoning?

Yes, by design — only user and assistant text is imported. Tool calls and reasoning traces are noise for recall; skipping them keeps search quality high.

OpenCode shows no messages. What's wrong?

Check that ~/.local/share/opencode/opencode.db (or ~/.opencode/opencode.db) exists. Same idea for the others: the tool reads local files, so run it on the machine where you used that agent.

Can I undo an import?

There's no bulk undo — delete unwanted memories via the API. That's why the dry run exists: preview first, import second.

Start with the dry run. npx @audaxic/memory-import --dry-run takes seconds and needs no key. When you're happy, grab a free API key and import for real. Related: Fixing Claude Code Context Compaction · Why Your Coding Agent Forgets Conventions · RAG vs Memory Layer vs Vector DB

Written by Efe — Sep 03, 2026 · More articles · X @AudaxicTech