Skip to content

The Edge of the Cyber World See the latest

Apps

Port Chatbot Memory in 13 Steps, 60 Min [2026]

Choosing between Claude vs ChatGPT vs Gemini vs Grok is no longer a one-time decision. In the six weeks before November 3, 2026, every vendor changed something you depend on. OpenAI moved ChatGPT to GPT-6 on October 7 (GPT-6 Sol powers the paid plans and GPT-6 Luna runs Free and Go), Anthropic shipped Claude Haiku 5.5 the same day, Google opened Gemini 4 Argon worldwide on October 13, and Grok has sat on version 4.7 since September 21. Each switch resets the thing that makes a chatbot feel like yours: what it remembers about you.

The catch is that your setup lives in four separate silos. Custom instructions, saved memories, project files and years of chat history sit inside whichever service you typed them into. When I checked the vendors’ own pages on November 3, none of them documented a direct way to carry memory or history from one chatbot to another, so this guide does not pretend one exists. Instead, you build the portable layer yourself. The memory comparison of ChatGPT, Claude and Gemini covers how much each service retains, so this tutorial stays on the part you control.

By the end you will have a small Python tool called ctxpack that turns your data exports into one searchable archive and four ready-to-paste files: custom instructions, a memory seed, a project knowledge file and an API system prompt. It uses only the standard library, takes about 60 minutes across 13 steps, and ends with a four-question test that tells you which chatbot actually absorbed your context. If you want to switch from ChatGPT to Claude (or the reverse), the same files do the job in both directions.

What You Can Move Between Claude, ChatGPT, Gemini and Grok

Before writing code, sort your data into what is really portable. Plain text always moves. Anything stored in a proprietary format or tied to a vendor feature mostly does not. The table below shows the six things people usually mean when they say they want to switch chatbots without starting over, and how this tutorial handles each one.

What you want to move Where it lives today Direct vendor transfer How ctxpack handles it
Custom instructions A settings text field in each service Not confirmed on vendor pages Renders custom-instructions.txt, trimmed to a size you set
Saved memory A per-account store the vendor controls Not confirmed on vendor pages Captures a self-portrait from the old bot, then renders memory-seed.md
Chat history Your account archive Export is commonly offered, import is not confirmed Ingests exports into a redacted, searchable SQLite archive
Project files and knowledge Per-project uploads Manual re-upload Renders project-knowledge.md you can upload anywhere
Tone and format habits Scattered across old chats None Stores them as style rules in profile.toml
API system prompts Your own code Plain text, always portable Renders system-prompt.txt

People who want to switch from ChatGPT to Claude hit the same wall, and so do searchers looking for a Claude import memory shortcut. Two lessons fall out of that table. First, the real asset is a short, curated profile of you, not the raw archive. A 5 MB export is a research source, not something you paste into a memory field. Second, you should treat every vendor’s memory as a cache. If you keep the source of truth in a file you own, a wiped memory, a retired model or a plan downgrade costs you ten minutes instead of a month of re-teaching.

The retirements are real. OpenAI’s model-release update, dated October 29, 2026 and updated November 2, shows GPT-5.5 being retired from ChatGPT, ChatGPT Work and Codex, and GPT-4.5 was retired earlier in 2026 after a 30-day sunset. Models come and go on a quarterly rhythm now, and every change can shift how a bot reads your saved instructions.

Claude vs ChatGPT vs Gemini vs Grok: Where Each Stands on November 3, 2026

A portability tutorial needs a moving target to aim at, so here is where each product stood on the date of writing. I pulled these from the vendors’ own pages and release notes, then cross-checked them against recent news roundups. Model names change fast, so check each product’s model picker before you test.

Chatbot Newest models confirmed What changed recently
ChatGPT GPT-6 (Sol on paid plans, Luna on Free and Go), GPT-6.1 Terra in ChatGPT Work and Codex GPT-6 rolled out to paid tiers first and reached Free and Go on October 8. Terra began rolling out October 26.
Claude Opus 5.5 (released September 22), Sonnet 5.5, Haiku 5.5 (released October 7) Anthropic cut Opus 5.5 pricing about 40% against Opus 5 on typical workloads and added monthly API credits for top plans.
Gemini Gemini 4 Argon, available worldwide since October 13 Gemini 4 Carbon was announced October 28 for long-horizon engineering and cybersecurity work.
Grok Grok 4.7, released September 21, with a 500,000-token context window The X Subscription, introduced October 12, bundles Grok, Grok Bot, Cursor and X Premium.

Prices matter because the cheapest path to a good memory is often a plan change, not a tool. On ToolColumn‘s plan tracker, ChatGPT Plus and Claude Pro both showed $20 a month on November 2 and 3, with ChatGPT Pro tiers at $100, $200 and $500. Notebookcheck tracks the Pro $500 tier and the restored Pro $200 plan, and reports put Claude Max at $100 and Claude Ultra at $200. Grok’s tiers reportedly run from a free plan through $8, $30, $100 and $200 a month. For the full price breakdown, see the four-way subscription pricing comparison.

On the Claude side, Anthropic’s pricing page lists Opus 5.5 at $4 per million input tokens and $20 per million output tokens through the API, Sonnet 5.5 at $2 and $10, and Haiku 5.5 at $0.10 and $0.50 for prompts up to 100,000 tokens. Those numbers come back in the advanced section, because the cheapest model is the right one for summarizing your old chats. If you are still deciding which flagship deserves the move, the Carbon, Opus 5.5 and Terra head-to-head covers benchmarks and API prices.

One more date to keep in mind: Google announced Gemini 4 Carbon on October 28, but the sources I found describe access as limited to a subset of cyber defenders at first, so I do not treat it as generally available. The pack you build here is model-agnostic, so it will work with Carbon the day your account gets it. The same goes for Grok, where GrokMag’s news log tracks the 4.7 release and the bundled subscription changes month by month.

Prerequisites and Versions

The project needs no third-party packages. Everything below ships with Python or with the operating system. I built and tested the tool on Python 3.12.3 under Linux. Python 3.11 is the floor because the profile file uses tomllib, which joined the standard library in that release.

  • Python 3.11 or newer (tested on 3.12.3). Run python3 --version to check.
  • SQLite with the FTS5 extension. Official Python builds include it. Step 3 has a one-line check.
  • A text editor that saves plain UTF-8 files. Anything works, including Notepad.
  • Accounts on the chatbots you plan to use. ChatGPT lists a free plan, and Claude, Gemini and Grok reportedly do too. Whether a free plan exposes memory, projects or custom instructions varies, so check before you plan around a feature.
  • Git, any recent version (optional). It keeps your profile history and makes Step 13 safer.
  • About 60 minutes of hands-on time, plus however long each vendor takes to prepare your data export. Some arrive in minutes and others take hours.

The examples use a made-up persona named Alex Rivera, a backend engineer who works in Python and Postgres. Every file in the walkthrough is synthetic, so you can reproduce the exact outputs shown here before you touch real data. Swap in your own exports once the dry run works.

Steps 1 to 3: Decide, Export and Set Up

Step 1: Decide what moves and what stays

Start with a deliberately short list. You are building a profile, not a mirror of your account. Write down the answers to five questions in a scratch file: who you are professionally, which tools you use daily, how you like answers formatted, which standing facts a new assistant would otherwise ask about every time, and which topics you never want carried over.

  • Carry over: job role, stack, time zone, preferred answer format, naming conventions, recurring project names.
  • Carry over with care: client names, internal hostnames, anything covered by a contract.
  • Leave behind: passwords, API keys, health details, financial account numbers, other people’s personal data.

If your work chats touch regulated or client data, check your employer’s policy before you export anything. The private AI chatbot privacy models guide explains how differently the services treat retention and training, which should shape what you feed into each one.

Step 2: Request your data exports

Most services let you download an archive of your conversations from account settings, usually under a data or privacy section. Menu names and file formats move around between releases, and I could not confirm today’s exact labels from the vendors’ pages, so treat the steps below as a pattern and not a script.

  1. In ChatGPT, open your account settings, find the data controls area and request an export. A download link normally arrives by email.
  2. In Claude, look in your account settings for the data export option. The archive normally contains a conversations file in JSON.
  3. For Gemini, use Google’s account-level export tool (Takeout) and select only the Gemini activity you need. Takeout archives can be large, so deselect everything else.
  4. For Grok, check account settings or your X data download. If you find no usable export, skip it. You will paste transcripts into text files in Step 8 instead.

Unzip each archive. Drop the ChatGPT file named conversations.json into exports/chatgpt/ and the Claude conversations file into exports/claude/. If a service splits its export into numbered parts, keep the numbering, because the loader reads every file that matches conversations*.json.

Step 3: Create the project and check your tools

Create the folder tree, confirm that Python and SQLite are ready, and initialize Git with a gitignore that keeps your raw exports out of version control. The exports contain everything you ever typed, so never commit them.

mkdir -p ctxpack/exports/{chatgpt,claude,gemini,grok} ctxpack/answers ctxpack/build
cd ctxpack
python3 --version
python3 -c "import sqlite3; c = sqlite3.connect(':memory:'); c.execute('create virtual table t using fts5(x)'); print('fts5 ok')"
git init
printf 'exports/nbuild/nanswers/n' > .gitignore

Expect Python 3.11 or higher and the line fts5 ok. On Windows PowerShell, create the folders with New-Item -ItemType Directory and run py -3 in place of python3. Now start the main file. Save the block below as ctxpack.py. Every later block gets appended to the same file in the order shown.

#!/usr/bin/env python3
import argparse, json, re, sqlite3, sys, tomllib
from datetime import datetime, timezone
from pathlib import Path

ROOT = Path(__file__).parent
EXPORTS = ROOT / "exports"
BUILD = ROOT / "build"
ARCHIVE = BUILD / "archive.jsonl"
DB = BUILD / "archive.db"

Steps 4 to 6: Normalize, Redact and Ingest

Step 4: Write the loaders

Each service stores conversations differently, so the loaders translate them into one flat record: source, title, role, day and text. ChatGPT’s file stores every conversation as a tree of message nodes, because editing a prompt creates a branch. The loader starts at the conversation’s current node and walks parent links back to the root, which gives you the branch you actually saw. Claude’s export is flatter. Each conversation holds a list of messages with a sender field.

Both functions read keys defensively and skip anything that is not text, such as images or tool output. These key names follow the export layouts that were common when this guide was written, but vendors change formats without notice. If your file looks different, open it in an editor, find the field that holds the message text, and adjust the matching line. For Gemini and Grok, the third loader reads plain Markdown or text files, which is the fallback for anything you paste in by hand.

def day(ts):
    if ts is None:
        return "unknown"
    if isinstance(ts, (int, float)):
        return datetime.fromtimestamp(ts, timezone.utc).strftime("%Y-%m-%d")
    return str(ts)[:10]


def load_chatgpt(path):
    for conv in json.loads(path.read_text(encoding="utf-8")):
        mapping, node_id, chain = conv.get("mapping", {}), conv.get("current_node"), []
        while node_id:
            node = mapping.get(node_id) or {}
            chain.append(node)
            node_id = node.get("parent")
        for node in reversed(chain):
            msg = node.get("message")
            if not msg:
                continue
            role = (msg.get("author") or {}).get("role")
            if role not in ("user", "assistant"):
                continue
            parts = (msg.get("content") or {}).get("parts") or []
            text = "n".join(p for p in parts if isinstance(p, str)).strip()
            if text:
                yield {"source": "chatgpt", "title": conv.get("title") or "untitled",
                       "role": role, "day": day(msg.get("create_time")), "text": text}


def load_claude(path):
    for conv in json.loads(path.read_text(encoding="utf-8")):
        for m in conv.get("chat_messages", []):
            role = "user" if m.get("sender") == "human" else "assistant"
            text = (m.get("text") or "").strip()
            if not text:
                blocks = m.get("content") or []
                text = "n".join(b.get("text", "") for b in blocks if isinstance(b, dict)).strip()
            if text:
                yield {"source": "claude", "title": conv.get("name") or "untitled",
                       "role": role, "day": day(m.get("created_at")), "text": text}


def load_notes(folder, source):
    for p in sorted(folder.glob("*")):
        if p.suffix in (".md", ".txt"):
            yield {"source": source, "title": p.stem, "role": "note",
                   "day": day(p.stat().st_mtime), "text": p.read_text(encoding="utf-8").strip()}

Step 5: Add redaction and a test

Redaction runs before anything is written to disk. The patterns catch API keys, email addresses, card numbers, phone numbers and IPv4 addresses and replace each with a labeled placeholder. Order matters. Cards are matched before phone numbers, otherwise a 16-digit card would be half-eaten by the looser phone pattern. Regexes will never catch everything, so this is a safety net and not a guarantee.

PATTERNS = {
    "api_key": re.compile(r"b(?:sk-|xai-|AKIA)[A-Za-z0-9_-]{16,}"),
    "email": re.compile(r"[w.+-]+@[w-]+.[w.-]+"),
    "card": re.compile(r"bd(?:[ -]?d){12,15}b"),
    "phone": re.compile(r"(?<![w.])+?d[ds().-]{8,}d(?![w.])"),
    "ipv4": re.compile(r"b(?:d{1,3}.){3}d{1,3}b"),
}


def redact(text, counts):
    for name, rx in PATTERNS.items():
        text, n = rx.subn(f"[{name.upper()}]", text)
        counts[name] = counts.get(name, 0) + n
    return text

Write the test file next. It checks three behaviors, starting with the one that broke my first draft (cards read as phone numbers), then keys and emails slipping through, then ordinary text getting mangled.

from ctxpack import redact


def clean(text):
    return redact(text, {})


def test_card_is_not_read_as_phone():
    assert clean("pay with 4111 1111 1111 1111 today") == "pay with [CARD] today"


def test_key_and_email():
    out = clean("mail bob@corp.io key xai-AbCdEfGhIjKlMnOpQrSt")
    assert "[EMAIL]" in out and "[API_KEY]" in out


def test_plain_text_survives():
    assert clean("Use Postgres 16 with pgbouncer") == "Use Postgres 16 with pgbouncer"

Run it with python3 -m pytest -q test_redact.py if you have pytest installed. Without pytest, this one-liner runs the same functions and prints all passed on success:

python3 -c "import test_redact as t; [getattr(t,n)() for n in dir(t) if n.startswith('test_')]; print('all passed')"

Step 6: Run the ingest command

The ingest command reads every export, redacts each message and writes the result as one JSON object per line. It also prints how many messages each source produced and how many redactions fired. Read that summary closely. A source with zero messages means the loader missed your file, and a redaction count of zero on years of chats usually means something is wrong.

def cmd_ingest(args):
    BUILD.mkdir(exist_ok=True)
    rows = []
    for path in EXPORTS.glob("chatgpt/conversations*.json"):
        rows += list(load_chatgpt(path))
    for path in EXPORTS.glob("claude/conversations*.json"):
        rows += list(load_claude(path))
    for source in ("chatgpt", "claude", "gemini", "grok"):
        rows += list(load_notes(EXPORTS / source, source))
    counts = {}
    with ARCHIVE.open("w", encoding="utf-8") as f:
        for r in rows:
            r["text"] = redact(r["text"], counts)
            f.write(json.dumps(r, ensure_ascii=False) + "n")
    by_source = {}
    for r in rows:
        by_source[r["source"]] = by_source.get(r["source"], 0) + 1
    print(f"ingested {len(rows)} messages -> {ARCHIVE.relative_to(ROOT)}")
    for s, n in sorted(by_source.items()):
        print(f"  {s:8} {n}")
    summary = ", ".join(f"{k}={v}" for k, v in counts.items() if v)
    print("redactions: " + (summary or "none"))

Add the main function at the end of the file in Step 12 so the commands become callable. For now, test the pieces by running the finished file once everything is appended. With the sample data, the output looks like this:

$ python3 ctxpack.py ingest
ingested 6 messages -> build/archive.jsonl
  chatgpt  2
  claude   2
  gemini   1
  grok     1
redactions: api_key=1, email=1, phone=1

Open build/archive.jsonl and confirm that the placeholders replaced the real values. In the sample, the first ChatGPT message now reads My email is [EMAIL] and my key is [API_KEY]. If you still see a real address, stop and fix the pattern before going further.

Steps 7 to 9: Search, Self-Portrait and Profile

Step 7: Index the archive and make it searchable

SQLite’s FTS5 extension gives you ranked full-text search with no server and no dependencies. The index command loads the JSONL file into a virtual table. The search command returns the best matches with a short snippet and wraps the hit in square brackets. You will use it in the next steps to answer the question that comes up constantly during a move: did I ever tell the old bot about this?

def cmd_index(args):
    DB.unlink(missing_ok=True)
    db = sqlite3.connect(DB)
    db.execute("CREATE VIRTUAL TABLE msgs USING fts5(source, title, role, day, text)")
    with ARCHIVE.open(encoding="utf-8") as f:
        db.executemany("INSERT INTO msgs VALUES (?,?,?,?,?)",
                       [(r["source"], r["title"], r["role"], r["day"], r["text"])
                        for r in map(json.loads, f)])
    db.commit()
    print("indexed", db.execute("SELECT count(*) FROM msgs").fetchone()[0], "rows")


def cmd_search(args):
    db = sqlite3.connect(DB)
    q = "SELECT source, day, title, snippet(msgs, 4, '[', ']', '...', 14) FROM msgs " 
        "WHERE msgs MATCH ? ORDER BY rank LIMIT ?"
    for source, d, title, snip in db.execute(q, (args.query, args.limit)):
        print(f"{source:8} {d}  {title}n         {snip}")
$ python3 ctxpack.py index
indexed 6 rows
$ python3 ctxpack.py search postgres
chatgpt  2025-10-31  Postgres index question
         Why is my [Postgres] query slow? My email is [EMAIL] and my key is...
chatgpt  2025-10-31  Postgres index question
         Check EXPLAIN ANALYZE and add a composite index.

FTS5 has its own query syntax. Words separated by spaces mean AND, OR must be capitalized, and a hyphenated term such as orbit-staging needs double quotes inside single quotes: python3 ctxpack.py search '"orbit-staging"'. Rebuild the index every time you run ingest, since the search reads the database and not the JSONL file.

Step 8: Ask each chatbot for a self-portrait

Raw history shows what you asked. It does not show what each bot decided to remember about you. To capture that, ask the bot directly. Open a fresh chat in each service you currently use, turn memory on if it is off, and send this prompt:

List everything you have saved about me in memory, one fact per line, in plain text.
Do not add anything you are unsure of and do not guess.
Then print the custom instructions currently active on this account, word for word.
If you have no memory or no instructions, say so plainly.

Save each reply as exports/VENDOR/self-portrait.md. The ingest command already loads text files from all four folders, so the replies join the archive and become searchable. Treat the output as a draft. A bot can summarize, merge or even invent entries, and its answer is not guaranteed to be the full contents of its memory. The hallucination rate comparison for Grok, ChatGPT and Gemini shows how often each family gets facts wrong, which is a good reason to verify every line before it goes into your profile.

If a service declines to list its memory, move on. You lose nothing, because your own chat export is the better source for most facts anyway.

Step 9: Write your canonical profile

This is the step that decides whether the move works. Open the self-portraits and your search results side by side and write profile.toml by hand. TOML keeps the file readable and lets the tool validate structure. The identity, style and stack tables feed the short custom-instructions block. The facts list feeds the longer memory seed and the project file. The probe tables hold the test questions you will use in Step 12.

[identity]
name = "Alex Rivera"
role = "backend engineer who works mostly in Python and Postgres"
timezone = "Europe/Berlin"

[style]
rules = ["Lead with the answer, then explain.", "Keep paragraphs short.", "No emoji.", "Show code before prose when I ask for code."]

[stack]
tools = ["Python 3.12", "PostgreSQL", "Docker", "Terraform", "pytest"]

[facts]
items = [
  "I deploy to AWS eu-central-1 and keep infrastructure in Terraform.",
  "My team reviews every pull request with a checklist, so suggest tests with each change.",
  "I write documentation in Markdown and keep it next to the code.",
  "I prefer SQL over ORM magic for reports.",
  "Our staging database is called orbit-staging.",
]

[[probe]]
id = "P1"
question = "What database do I use most?"
expect = ["postgres"]

[[probe]]
id = "P2"
question = "Which AWS region do I deploy to?"
expect = ["eu-central-1"]

[[probe]]
id = "P3"
question = "What is my staging database called?"
expect = ["orbit-staging"]

[[probe]]
id = "P4"
question = "Give me a one-line summary of how I want answers formatted."
expect = ["answer", "short"]

Follow four rules while editing. Write one fact per line and keep each under 150 characters. Keep only facts that stay true for months, so skip this week’s sprint goal. Put the most useful facts first, since the render step cuts from the bottom when space runs out. Finally, write probes whose answers you can check by eye, such as a region name or a database name that no model would guess.

Then load the profile in code. This small function parses the file and returns a dictionary. It also fails loudly with a clear error if the TOML is malformed, which beats a silent half-render.

def load_profile():
    return tomllib.loads((ROOT / "profile.toml").read_text(encoding="utf-8"))

Steps 10 and 11: Render the Pack and Load It

Step 10: Render four files from one profile

The render command builds four outputs from the same source. The custom-instructions file packs identity, tools, answer style and as many facts as fit under the character limit. I defaulted the limit to 1,500 characters as a conservative guess, so check the real limit in each service’s settings and pass a different number with --max-chars if you have more room. The memory seed is a message you paste into a chat, which is all a Claude import memory workflow really amounts to. The project knowledge file is meant for uploads. The system prompt is for API calls.

def render_blocks(p):
    ident, style, stack = p["identity"], p["style"], p["stack"]
    lines = [f"I am {ident['name']}, {ident['role']}. Time zone: {ident['timezone']}."]
    lines.append("Languages and tools: " + ", ".join(stack["tools"]) + ".")
    lines.append("How to answer: " + " ".join(style["rules"]))
    short = "n".join(lines)
    facts = "n".join(f"- {x}" for x in p["facts"]["items"])
    return short, facts


def cmd_render(args):
    p = load_profile()
    short, facts = render_blocks(p)
    BUILD.mkdir(exist_ok=True)
    ci = short
    for fact in p["facts"]["items"]:
        if len(ci) + len(fact) + 3 > args.max_chars:
            break
        ci += f"n- {fact}"
    outputs = {
        "custom-instructions.txt": ci,
        "memory-seed.md": "Please remember the following about me and apply it in future chats. "
                          "Reply only with a bulleted list of what you saved.nn" + short + "nnFacts:n" + facts,
        "project-knowledge.md": f"# About menn{short}nn## Factsnn{facts}n",
        "system-prompt.txt": "You are assisting the person described below.nn" + short + "nnFacts:n" + facts,
    }
    for name, body in outputs.items():
        (BUILD / name).write_text(body + "n", encoding="utf-8")
        print(f"{name:26} {len(body):5} chars  ~{len(body) // 4:4} tokens")
    if len(ci) > args.max_chars:
        sys.exit("custom-instructions.txt is over the limit")
$ python3 ctxpack.py render
custom-instructions.txt      618 chars  ~ 154 tokens
memory-seed.md               747 chars  ~ 186 tokens
project-knowledge.md         642 chars  ~ 160 tokens
system-prompt.txt            673 chars  ~ 168 tokens

The token figures use the four-characters-per-token rule of thumb, which is close enough for English text. A real profile will run 3 to 10 times larger than the sample. That is fine for projects and system prompts, but if the custom-instructions file hits the limit, the loop in cmd_render drops the lowest-ranked facts first. This is why Step 9 tells you to order your facts by importance.

Step 11: Load the pack into each chatbot

Load things in the same order everywhere: instructions first, memory seed second, project file third. Search each service’s settings for terms like personalization, custom instructions, memory, saved info or projects, because labels change often. The pattern is the same on all four.

  1. ChatGPT: paste custom-instructions.txt into the personalization settings, then start a new chat and send memory-seed.md. Check the memory list afterward to confirm the facts saved. For recurring work, create a project and upload project-knowledge.md.
  2. Claude: paste the same text into the profile or preferences field, send the seed in a new chat, and attach project-knowledge.md to a project. If you plan to switch from ChatGPT to Claude, this is your Claude import memory step done by hand, because the seed message carries the facts across.
  3. Gemini: use the saved-info or personalization area for the short block, and create a custom assistant if the product offers one for your plan, pasting system-prompt.txt as its instructions.
  4. Grok: paste the short block into custom instructions if your plan shows that setting, then send the seed. If you use the X Subscription bundle, check which of the bundled tools actually read the setting.

Two details trip people up here. First, a memory seed only saves facts if the memory feature is switched on for that chat, so check the toggle before you send it. Second, send the seed in a normal chat, not in a temporary or incognito one, since those modes usually skip memory entirely. If you route different jobs to different models, the reasoning comparison of the four chatbots can help you decide which account deserves the heaviest instructions.

Steps 12 and 13: Verify and Keep It Fresh

Step 12: Run the four-question probe test

Loading is not proof. The probe test is. Open a brand-new chat in each service, ask the four questions from profile.toml one at a time, and paste each answer into answers/VENDOR.md under a heading that matches the probe id. The scoring function reads those files and checks that every expected phrase appears in the answer, ignoring case. That way the Claude vs ChatGPT vs Gemini vs Grok comparison runs on your data, not on generic benchmarks.

def cmd_score(args):
    probes = load_profile()["probe"]
    print(f"{'vendor':8} " + " ".join(f"{x['id']:>3}" for x in probes) + "  total")
    for f in sorted((ROOT / "answers").glob("*.md")):
        sections = dict(re.findall(r"^## (w+)n(.*?)(?=^## |Z)", f.read_text(encoding="utf-8"),
                                   flags=re.S | re.M))
        marks = []
        for x in probes:
            ans = sections.get(x["id"], "").lower()
            marks.append(all(e.lower() in ans for e in x["expect"]))
        print(f"{f.stem:8} " + " ".join(f"{'ok' if m else '--':>3}" for m in marks)
              + f"  {sum(marks)}/{len(probes)}")


def main():
    ap = argparse.ArgumentParser(description="Build a portable chatbot context pack")
    sub = ap.add_subparsers(dest="cmd", required=True)
    sub.add_parser("ingest").set_defaults(fn=cmd_ingest)
    sub.add_parser("index").set_defaults(fn=cmd_index)
    s = sub.add_parser("search"); s.add_argument("query"); s.add_argument("--limit", type=int, default=5)
    s.set_defaults(fn=cmd_search)
    r = sub.add_parser("render"); r.add_argument("--max-chars", type=int, default=1500)
    r.set_defaults(fn=cmd_render)
    sub.add_parser("score").set_defaults(fn=cmd_score)
    args = ap.parse_args()
    args.fn(args)


if __name__ == "__main__":
    main()

An answers file looks like this. Keep the headings exactly as ## P1, ## P2 and so on:

## P1
You use PostgreSQL most.
## P2
eu-central-1
## P3
orbit-staging
## P4
Lead with the answer, keep paragraphs short.

In the sample run, I created two answer files, one clean and one with a wrong region. The scorer flags the miss immediately:

$ python3 ctxpack.py score
vendor    P1  P2  P3  P4  total
claude    ok  ok  ok  ok  4/4
grok      ok  --  ok  ok  3/4

A 4/4 row means the context stuck. A miss on a single probe usually points to a stale or conflicting memory entry, and a miss across the board means the memory toggle was off or the seed went into a temporary chat. Fix the cause, start another new chat and rerun the question. Once all four vendors score 4/4, the move is done.

Step 13: Schedule the monthly refresh

Context rots. You change jobs, rename a database or adopt a new tool, and the vendors keep shipping model updates that change behavior. OpenAI’s October 29 update to GPT-6 in ChatGPT, for example, made responses more concise and cut overly flattering language, and it applied differently by plan. A style rule that read well last month can read differently after a change like that. A short refresh script rebuilds the pack in seconds, and a monthly reminder keeps the profile honest.

#!/bin/sh
set -e
cd "$(dirname "$0")"
python3 ctxpack.py ingest
python3 ctxpack.py index
python3 ctxpack.py render
git add profile.toml
git commit -m "profile refresh $(date +%F)" || true
chmod +x refresh.sh
crontab -e
# add this line to run at 09:00 on the first day of each month:
0 9 1 * * /home/you/ctxpack/refresh.sh

The script cannot fetch new exports for you, so drop fresh files into the exports folders first. Each month, skim the diff of profile.toml, delete facts that stopped being true and re-run the probe test on whichever chatbot you use most.

What a Complete Run Looks Like

Here is the whole pipeline from a clean checkout, using the sample data. If your own run produces the same shapes with different numbers, you are on track. The folder tree comes first, followed by the command sequence.

ctxpack/
  ctxpack.py
  profile.toml
  refresh.sh
  test_redact.py
  exports/{chatgpt,claude,gemini,grok}/
  answers/
  build/
    archive.jsonl
    archive.db
    custom-instructions.txt
    memory-seed.md
    project-knowledge.md
    system-prompt.txt
$ python3 ctxpack.py ingest && python3 ctxpack.py index && python3 ctxpack.py render
ingested 6 messages -> build/archive.jsonl
  chatgpt  2
  claude   2
  gemini   1
  grok     1
redactions: api_key=1, email=1, phone=1
indexed 6 rows
custom-instructions.txt      618 chars  ~ 154 tokens
memory-seed.md               747 chars  ~ 186 tokens
project-knowledge.md         642 chars  ~ 160 tokens
system-prompt.txt            673 chars  ~ 168 tokens

The generated custom-instructions.txt for the sample persona reads as one compact block, which is the version you paste into a settings field:

I am Alex Rivera, backend engineer who works mostly in Python and Postgres. Time zone: Europe/Berlin.
Languages and tools: Python 3.12, PostgreSQL, Docker, Terraform, pytest.
How to answer: Lead with the answer, then explain. Keep paragraphs short. No emoji. Show code before prose when I ask for code.
- I deploy to AWS eu-central-1 and keep infrastructure in Terraform.
- My team reviews every pull request with a checklist, so suggest tests with each change.
- I write documentation in Markdown and keep it next to the code.
- I prefer SQL over ORM magic for reports.
- Our staging database is called orbit-staging.

Notice how little of the original archive survives. That is intentional. The archive stays on your disk as a searchable reference, while the pack carries only what is stable and useful.

Step Task Minutes
1 Decide what moves 4
2 Request exports 5
3 Create project, check tools 3
4 Write loaders 7
5 Redaction and tests 4
6 Ingest and read the counts 3
7 Index and search 4
8 Collect self-portraits 5
9 Write profile.toml 7
10 Render the pack 3
11 Load into four chatbots 8
12 Probe test and scoring 5
13 Schedule the refresh 2

Those minutes total 60, not counting export wait time. Steps 9 and 11 are where real accounts eat the clock, because real profiles need more editing than the sample and each service buries its settings in a different place. Budget extra time there.

Common Pitfalls When You Switch Chatbots

These are the mistakes most likely to bite when you carry context from one assistant to another. Most come from treating memory as storage instead of as a cache.

  • Pasting the raw archive. A bloated memory field makes answers worse, not better, because the bot has to weigh hundreds of low-value facts. Curate down to 10 to 25 lines that stay true.
  • Skipping redaction. Old chats contain pasted logs, keys and customer emails you forgot about. Run ingest, read the redaction counts, then spot-check the JSONL file.
  • Trusting the self-portrait. A bot’s list of what it remembers is a summary. Verify each line against your own history before it enters the profile.
  • Testing in the same chat you loaded in. The seed message sits in that conversation, so the bot can answer from it without any saved memory. Always probe in a fresh chat.
  • Mixing work and personal context. One profile for everything leaks your side projects into client work. Keep a separate profile file per context and render them to different folders.
  • Ignoring stale entries. A bot that still believes you use last year’s stack will quietly contradict your new profile. Delete old memory entries in each service before you load the seed.
  • Forgetting plan differences. Features such as projects and memory vary by plan and region. A setting that exists on your Plus or Pro account may be missing on a free one.

A broader reading list for the topic lives in the AI and machine learning section, which tracks model releases and comparisons as they land.

Troubleshooting: 10 Problems and Fixes

Symptom Likely cause Fix
ModuleNotFoundError: No module named ‘tomllib’ Python older than 3.11 Upgrade Python, or install the tomli package and import it as tomllib
sqlite3.OperationalError: no such module: fts5 SQLite built without FTS5 Use the official python.org build or a distro Python with FTS5 enabled
ingest reports 0 messages from a source File is in the wrong folder or named differently Match the pattern conversations*.json and keep the file directly inside exports/chatgpt or exports/claude
json.decoder.JSONDecodeError You picked an HTML or CSV file, or the zip was only half extracted Open the file in an editor. It should start with [ or {
ChatGPT loader returns far fewer messages than expected Message parts are dicts (images, files) or the export schema changed Print one conversation’s keys and adjust the parts handling in load_chatgpt
Claude messages come back empty Text moved into content blocks The loader already falls back to blocks. If yours differs, inspect one message and update the key
Order numbers or dates turn into [PHONE] The phone pattern is deliberately loose Tighten the regex, or add a negative lookbehind for the formats you use
search raises an FTS5 syntax error Hyphens or punctuation in the query Wrap the term in double quotes inside single quotes
render exits with a limit error Short block alone exceeds –max-chars Shorten identity and style rules, or raise the limit if the service allows
Probe fails on one fact only An old memory entry contradicts the new one Delete the stale entry in that service, resend the seed and retest in a new chat

If nothing above matches, add a print statement inside the loader that shows the keys of the first conversation. Most of the time, the fix is a renamed field. For anything else, rerun ingest on a single tiny file you wrote by hand, since that isolates the loader from your real data.

Advanced Tips for Power Users

Once the basic move works, a few upgrades pay off quickly. The first is summarizing your archive with a cheap model. A long archive is too big to read yourself, but a small model can pull candidate facts from it for a few cents. Split the archive into chunks first. This function turns the JSONL rows into chunks of about 50,000 tokens each, using the same four-characters-per-token estimate as the render step:

def chunks(rows, limit=200_000):
    buf, size = [], 0
    for r in rows:
        line = f"[{r['day']}] {r['role']}: {r['text']}n"
        if size + len(line) > limit and buf:
            yield "".join(buf)
            buf, size = [], 0
        buf.append(line)
        size += len(line)
    if buf:
        yield "".join(buf)

Keeping each chunk under 100,000 tokens matters for pricing. Anthropic lists Claude Haiku 5.5 at $0.10 per million input tokens and $0.50 per million output tokens for prompts up to 100,000 tokens, with higher rates beyond that. A 20 MB text archive is roughly 5 million tokens, which works out to about $0.50 of input at that rate plus a little output. Ask the model to return candidate facts only, then curate them by hand. Grok 4.7’s 500,000-token context window allows one-pass summaries, though the listed price per token rises for long prompts, so chunking still wins on cost.

The second upgrade is the API path. Your system-prompt.txt works anywhere a system prompt does. The snippet below sends it to Anthropic’s Messages API with nothing but the standard library. Set the model name in an environment variable and copy the exact identifier from Anthropic’s model list. I did not run this snippet against a live key while writing, so test it with a throwaway prompt first.

import json, os, urllib.request

body = {
    "model": os.environ["CLAUDE_MODEL"],
    "max_tokens": 300,
    "system": open("build/system-prompt.txt").read(),
    "messages": [{"role": "user", "content": "What database do I use most?"}],
}
req = urllib.request.Request(
    "https://api.anthropic.com/v1/messages",
    json.dumps(body).encode(),
    {"x-api-key": os.environ["ANTHROPIC_API_KEY"],
     "anthropic-version": "2023-06-01",
     "content-type": "application/json"},
)
print(json.load(urllib.request.urlopen(req))["content"][0]["text"])

To compare all four providers on the same prompt set, the Python harness for the ChatGPT, Claude and Gemini APIs shows one way to structure the calls. Cache pricing also changes the math for a long system prompt, since a profile you send on every request is exactly what prompt caching is for. The API cache pricing comparison lays out what each vendor charges for cached input.

Three smaller habits round out the setup. Split your profile into a core file and per-project packs, so a coding project gets stack details and a writing project gets voice notes. Tag each profile commit in Git before a vendor’s major release, which gives you a known-good version to roll back to. Finally, keep the probe questions secret and unusual. A probe like what region do I deploy to tells you far more than one a model could answer from public knowledge.

Your Finished Project at a Glance

In any Claude vs ChatGPT vs Gemini vs Grok decision, the profile is the part that stays constant. You now own a portable context layer that sits above any one vendor. It has a loader for each export format, a redaction step that runs before anything touches disk, a searchable archive, a hand-curated profile, four rendered outputs and a test that proves the move worked. The code is plain standard-library Python.

The practical payoff shows up the next time something changes. When a vendor retires a model, renames a plan or rewrites its defaults, you edit one file, render, paste and probe. That takes minutes, compared with the weeks it takes to re-teach a new assistant your habits from scratch. And because the profile is plain text, the same file serves ChatGPT today, Claude next month and whichever Gemini or Grok model ships after that.

The method also keeps you honest about what these tools do. Memory features are conveniences, not archives. Your durable record is the file in your Git repository, and the chatbots are just readers of it.

FAQ: Claude vs ChatGPT vs Gemini vs Grok Context Moves

Can I import my ChatGPT history directly into Claude?

As of November 3, 2026, I could not confirm a documented one-click import between any of the four services. Searches for Claude import memory and for how to switch from ChatGPT to Claude are common, so a vendor may add or already offer an import helper. If one exists on your account, feed it the files ctxpack renders, because a curated profile imports better than a raw dump.

Is it safe to export and process my chats locally?

It is safer than pasting them into a third-party converter, because everything stays on your machine. Redact before you write anything to disk, keep exports out of Git and delete the raw files once the profile is final. Regex redaction misses things, so read the output before you share any of it.

How long should my custom instructions be?

As short as you can make them while still passing the probe test. The tool defaults to 1,500 characters, which is a cautious guess. Check the character limit shown in each service’s settings, and note that limits can differ between products and plans.

Which chatbot remembers best after the move?

The probe test answers that for your data. Results depend on plan, memory settings and the model you pick, and they shift after updates. Run the four questions on each service and compare the scores, then rerun after any major model change.

Do I need a paid plan on all four services?

Not necessarily. ChatGPT lists a free plan, and Claude, Gemini and Grok reportedly offer limited free tiers. What differs is which memory and project features each tier includes, which I could not map from the vendors’ pages. Start on free accounts, run the probes and upgrade only the service that fails because of a plan limit.

Will this work with Gemini 4 Carbon or newer models?

Yes, because the pack is plain text. Gemini 4 Carbon was announced on October 28, 2026, and its availability appeared limited at first, so you may not see it in your account yet. When it arrives, load the same files and rerun the probes.

How often should I refresh the profile?

Monthly is a good default, and again after any major model release or plan change. In the six weeks before this article, all four vendors shipped something that could alter behavior, so a quarterly refresh would already be too slow.

Can I run ctxpack on Windows or macOS?

Yes. The script uses only portable standard-library modules. On Windows, use py -3 instead of python3 and create folders with PowerShell. Replace the cron job with Task Scheduler running refresh steps through a batch file, or just set a calendar reminder and run the three commands by hand.

Related Coverage

Source: Tech Insider