open-context open-context
November 7, 2026 · 6 min read

Batch-Converting Multiple ChatGPT Exports With the CLI

open-context's CLI converts one ChatGPT export ZIP per convert call — there's no --input-dir flag or glob support. To convert several exports, run it more than once from a plain shell loop, giving each ZIP its own output directory. That needs no code changes to open-context itself, and it's the same approach whether you're converting two personal accounts or a stack of exports collected from a dozen teammates.

Key takeaways

  • open-context's CLI convert command takes exactly one ChatGPT export ZIP per run — there's no --input-dir or glob flag, so converting several exports means calling it more than once.
  • A plain bash for loop over exports/*.zip, with a separate -o output directory per file, does the job without any changes to open-context's source.
  • Add --skip-preferences to a batch loop to skip Ollama's AI analysis entirely — per the project's own benchmarks, a 100+ conversation export can take roughly 15 minutes with AI analysis versus about 30 seconds without it, and that gap multiplies by every export in the loop.
  • Each convert call writes its own preferences.md and memory.md; open-context has no command that merges several exports' preferences into one profile, so combining them is a manual step.
  • The same loop works against the official Docker image by overriding the container command to node dist/index.js convert, the same way the image's command is overridden to run the MCP server in stdio mode.

Why you'd ever convert more than one export

ChatGPT only lets you export the account you're currently signed into, as a single ZIP containing conversations.json. If you've used more than one ChatGPT account — a personal one and a work one, or an old account you're finally leaving behind — each account produces its own separate export. Anyone helping several people migrate their ChatGPT history to Claude hits the same shape of problem from the other direction: one ZIP per person, all needing the same conversion.

There's no batch flag — convert takes one ZIP, one run

The CLI's convert command, defined with Commander.js in src/index.ts, accepts a single positional <zip-file> argument plus five options:

OptionDescriptionDefault
-o, --output <dir>Output directory./claude-export
--model <name>Ollama model for preference analysisgpt-oss:20b
--ollama-host <url>Ollama host URLhttp://localhost:11434
--skip-preferencesSkip Ollama preference analysisfalse
--verboseDetailed loggingfalse

There's no option that takes a directory of ZIPs, and the db subcommands don't help either — db migrate copies contexts between two context-store backends, not ChatGPT exports into markdown. One CLI call maps to one ZIP and one output directory, which keeps the command simple to reason about and lets a shell loop handle the "many exports" case instead of a bespoke batch mode that would need its own flags, docs, and tests.

Looping over every export in a directory

Put every ZIP you want to convert into one folder — say, exports/ — and loop over it. This version skips AI analysis entirely, so it finishes in seconds no matter how many exports you feed it:

for zip in exports/*.zip; do
  name="$(basename "$zip" .zip)"
  npm start -- convert "$zip" -o "./claude-export/$name" --skip-preferences
done

basename "$zip" .zip turns exports/jane-personal.zip into jane-personal, so each export lands in its own ./claude-export/jane-personal/ directory instead of overwriting the last one. Nothing about this loop is open-context-specific — it's the same convert command you'd run once, just invoked once per file.

Keeping AI analysis on for an overnight batch

If you want the AI-generated preferences.md and memory.md for every export, drop --skip-preferences and pin the model and host explicitly so every run in the loop is consistent:

for zip in exports/*.zip; do
  name="$(basename "$zip" .zip)"
  npm start -- convert "$zip" \
    -o "./claude-export/$name" \
    --model llama3:8b \
    --ollama-host http://192.168.1.50:11434
done

Budget time accordingly. The project's own performance numbers put a single 100+ conversation export at roughly 15 minutes with AI analysis versus about 30 seconds without it — across ten exports of that size, that's the difference between a couple of hours and a couple of minutes. For a large batch, either run it somewhere you don't need the terminal back for a while, or use --skip-preferences and generate preferences later for just the exports that need them.

The same loop works against the Docker image

The official adityakarnam/open-context image bundles the compiled CLI at dist/index.js — it's the same entry point the README uses to override the image's default command for MCP stdio mode (node dist/mcp/index.js). The convert command is reachable the same way, so the loop becomes:

for zip in exports/*.zip; do
  name="$(basename "$zip" .zip)"
  docker run --rm \
    -v "$PWD/exports:/exports:ro" \
    -v "$PWD/claude-export:/app/claude-export" \
    adityakarnam/open-context:latest \
    node dist/index.js convert "/exports/$(basename "$zip")" \
      -o "/app/claude-export/$name" --skip-preferences
done

The exports folder is mounted read-only, since convert never needs to write to it, and the output directory is mounted so converted files land back on the host instead of staying inside a container that gets removed when the loop moves on.

What batch conversion doesn't do

Each convert call only ever sees the conversations inside the one ZIP it was given, so each one writes its own independent preferences.md and memory.md. open-context has no merge or dedupe command, so converting five exports gives you five separate preference profiles, not one combined one. If you want a single profile across accounts, the current path is manual: open each memory.md, decide what's redundant or out of date, and combine them by hand before pasting the result into Claude's Manage Memory.

Have more than one ChatGPT export waiting to be converted?

Get started with open-context →

FAQ

Does open-context have a dedicated batch-convert command?

No. The CLI's convert command takes exactly one ZIP file per invocation, with no --input-dir or glob option. Converting several ChatGPT exports means calling convert once per file, typically from a shell loop.

Can I combine two ChatGPT exports into one merged preferences.md?

Not automatically. Each convert run writes its own preferences.md and memory.md based only on the conversations in that one ZIP. There is no merge or dedupe command, so combining several exports into one profile is a manual editing step.

Does --skip-preferences work the same way inside a batch loop?

Yes. --skip-preferences is read independently on every convert call, so it skips Ollama analysis for every export in the loop, not just the first one, producing plain markdown conversions in seconds instead of minutes per file.

Does batch-converting multiple exports send any data over the network?

No. Every convert call in the loop runs entirely on your own machine. The only possible network call is to the Ollama host you configure, and only when AI analysis is enabled; with --skip-preferences, nothing in the loop touches the network at all.

Can I run the batch loop against the Docker image instead of a local install?

Yes. The same compiled CLI (dist/index.js) ships inside the official open-context Docker image, so the loop works by overriding the container command to node dist/index.js convert for each ZIP, mounting the exports and output directories as volumes.