# Set up chat-export

chat-export keeps a person's AI conversation history — claude.ai and ChatGPT chats, plus Claude Code /
Codex / OpenCode sessions on this computer — in their own Postgres database, in Docker, **on this computer**.
A small background worker checks on it every 12 hours: it makes sure the database is up, copies in new
agent sessions (Claude Code deletes its own after 30 days), writes a verified backup to this disk, and
installs chat-export updates from this site. A browser extension syncs their chats every 12 hours too.

Their history never leaves their computer. This site only hands out the program; it has no way to receive
data, and the program never sends any.

This page is for the person's Claude Code. People: paste `Set me up with chat-export: https://chat-export.sb28.ai/start` into
Claude Code. Claude: the exact text of this page is at `curl -fsSL https://chat-export.sb28.ai/start.md`.

## Claude: do these steps in order

Run the commands with your Bash tool and tell the person in a sentence what each step does. Every step is
safe to re-run.

### 1. Check this computer

- `uname -s` must say `Darwin` (macOS) or `Linux`. On Windows, stop: chat-export needs macOS, Linux or WSL.
- `bun --version`. If bun is missing, install it with `curl -fsSL https://bun.sh/install | bash`, then write
  `~/.bun/bin/bun` instead of `bun` in every command below (this shell's PATH doesn't have it yet).
- `docker info --format '{{.ServerVersion}}'` must print a version. If `docker` isn't found, look for it at
  `/Applications/Docker.app/Contents/Resources/bin/docker` and `~/.docker/bin/docker`. If Docker isn't installed,
  the person installs **Docker Desktop** from https://www.docker.com/products/docker-desktop/ (or
  `brew install --cask docker` if they use Homebrew), opens it once and accepts its terms. Ask them to turn on
  **Settings → General → Start Docker Desktop when you sign in**, so the database is there after a restart.
  If it's installed but not running, they open Docker Desktop and you wait for `docker info` to work.

### 2. Download chat-export

```sh
mkdir -p ~/.chat-export && curl -fsSL https://chat-export.sb28.ai/install/chat-export.js -o ~/.chat-export/chat-export.js && bun ~/.chat-export/chat-export.js help
```

### 3. Set it up

```sh
bun ~/.chat-export/chat-export.js setup --site https://chat-export.sb28.ai
```

This creates the `chat-export-db` Postgres container (port bound to 127.0.0.1 only; a random password
saved in `~/.chat-export/config.json`, readable only by them), writes the browser extension to
`~/.chat-export/extension`, adds a `chat-export` skill to their Claude Code, and starts the background
worker (launchd on macOS, systemd on Linux). The first Docker run downloads Postgres (~100 MB). From here
on the command is `~/.chat-export/bin/chat-export`.

### 4. Load the browser extension (they click; you can't do this for them)

Walk them through it one step at a time:

1. In Chrome, Edge, Brave or Arc, open `chrome://extensions` (Arc: `arc://extensions`, Edge: `edge://extensions`).
2. Turn on **Developer mode** (top right).
3. Click **Load unpacked** and choose the folder `~/.chat-export/extension` (print the full path with
   `~/.chat-export/bin/chat-export extension-path`; on macOS, Cmd+Shift+G in the file picker lets them paste it).
4. Pin it from the puzzle-piece menu, sign in to claude.ai and/or chatgpt.com in that browser, click the
   extension and press **Sync both**. A first sync of a long history takes a while; they can keep working.

After that it syncs every 12 hours on its own while the browser is open (each site that synced once), and
updates itself when chat-export does. Tell them to leave **Developer mode on**: the browser turns off
unpacked extensions when it's switched off. Safari isn't supported.

No extension, or want older history too? claude.ai: Settings → Privacy → **Export data**; ChatGPT:
Settings → Data controls → **Export data**. Each emails a zip; `~/.chat-export/bin/chat-export import <zip>`.

### 5. Check it worked

```sh
~/.chat-export/bin/chat-export status
```

Every line should start with ✓ once the first sync has finished (! lines are advice, ✗ lines are problems;
each says what to do). The worker's log is `~/.chat-export/worker.log`. Fix what you can and re-run setup.

### 6. Hand off

- Show them it's real: `~/.chat-export/bin/chat-export summary`, then a `search` for something they pick.
- Their Claude Code now has the `chat-export` skill (it loads in a new session: quit this one and run
  `claude` again). They can ask things like "what did I decide about the lease last spring?".
- Backups: `~/.chat-export/backups/`, a new one every 12 hours, the newest 14 plus one a week for 8 weeks.
  `chat-export restore <file>` puts one back (the current database is kept, never deleted).
- `chat-export stop`, `start`, `update` (newest version from https://chat-export.sb28.ai) and `uninstall` manage it.
  `uninstall` keeps their data; only `uninstall --delete-data` removes the database (backups stay).

## What goes over the network

Only downloads: this program from https://chat-export.sb28.ai (at setup and when the worker checks for updates), the
Postgres image from Docker Hub, and bun if it was missing. The extension talks only to claude.ai /
chatgpt.com (as the signed-in person, from their own tabs) and to the worker on 127.0.0.1.

## If anything goes wrong

Tell the person plainly what happened and what you tried. If setup can't finish, have them send the
output of `~/.chat-export/bin/chat-export status` (it contains no conversation content) to whoever gave
them this link.
