Chat History
Browse and export your ChatGPT and Claude conversations locally.
Getting Started
Requires Python 3.11+ and uv.
-
Export your chats from ChatGPT or Claude (Settings → Export data). Both services send a ZIP file by email.
-
Create a folder for your chat history, save the ZIP there, and open a terminal in that folder. The wizard will store all data inside it.
-
Run the setup wizard:
uvx chat-historyThe wizard finds your export files, configures everything, and opens the browser.
Next time, run uvx chat-history in the same folder to start browsing.
To update to the latest version, run uvx chat-history install.
To export all conversations as markdown (useful for feeding to other AI tools):
uvx chat-history export
Features
- Unified conversation browser for ChatGPT and Claude exports
- Provider-aware favorites and external links
- Full-text search with optional semantic search (OpenAI embeddings + FAISS)
- Activity and token statistics
- Export conversations to markdown for downstream AI workflows
CLI Reference
All commands work as uvx chat-history <command> or, if installed locally, chat-history <command>.
| Command | Description |
|---|---|
| (none) | Start server if configured, otherwise run setup wizard |
init |
Run the interactive setup wizard |
serve |
Start the web server |
export |
Export conversations to markdown |
inspect |
Print conversation and message counts |
install |
Reinstall chat-history via uvx --reinstall chat-history |
serve
uvx chat-history serve [--host 127.0.0.1] [--port 8080] [--no-browser]
export
uvx chat-history export [--provider chatgpt|claude|all] [--out DIR] [--clean]
[--exclude-system] [--exclude-tool]
[--exclude-thinking] [--exclude-attachments]
--cleanremoves old export files before writing (scoped to--providerif set)- Default output:
./data/export/{chatgpt|claude}/
init
uvx chat-history init [--path DIR]
Scans the current folder and ~/Downloads for export ZIPs, validates them,
extracts to ./data/, writes ./data/.env, and offers to start the server.
Supports adding a second provider to an existing setup.
Configuration
All config lives in ./data/.env (created by the wizard or manually):
| Variable | Default | Description |
|---|---|---|
CHAT_HISTORY_DATA_DIR |
data |
Root directory for derived data |
CHAT_HISTORY_CHATGPT_PATH |
— | Path to ChatGPT export folder or conversations.json |
CHAT_HISTORY_CLAUDE_PATH |
— | Path to Claude export folder or conversations.json |
CHAT_HISTORY_OPENAI_ENABLED |
false |
Enable semantic search |
OPENAI_API_KEY |
— | Required if semantic search is enabled |
OPENAI_ORGANIZATION |
— | Optional OpenAI org |
OPENAI_EMBEDDING_MODEL |
text-embedding-3-small |
Embedding model for semantic search |
CHAT_HISTORY_SETTINGS_DB_PATH |
— | Override path for settings SQLite DB |
Developer Setup
make install # uv sync
make dev # uvicorn with hot-reload on :8080
make test # run tests
Install as a global command from the local repo (editable, changes reflected immediately):
make tool-install # uv tool install -e .
chat-history # works from any directory
make tool-uninstall # uv tool uninstall chat-history
Notes
- Export is non-destructive by default. Existing files remain unless
--cleanis used. - Token stats for Claude are approximate (fallback tokenizer), not exact Claude-native counts.
Metadata
Release files for chat-history 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chat_history-0.3.3.tar.gz | 437.1 kB | Without provenance | Details for chat_history-0.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chat_history-0.3.3-py3-none-any.whl | Python 3 | none | any | Details for chat_history-0.3.3-py3-none-any.whl |
Total release size: 513.1 kB
Release files / chat_history-0.3.3.tar.gz
| Download URL | chat_history-0.3.3.tar.gz |
|---|---|
| Size | 437.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
15d893291344c1e545549ab091f76afb197a05be5e041bd36bf31ef0dfdfea82
|
|
BLAKE2b-256 checksum How to use checksums |
9dde45999e2a40f6c8c50eefc6ba4e4b2dcbf00cf70829c11110aa170ef3c469
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.24
|
Release files / chat_history-0.3.3-py3-none-any.whl
| Download URL | chat_history-0.3.3-py3-none-any.whl |
|---|---|
| Size | 75.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
716add8c6d17ac5355b34a17112692bf4e9801aa859fa386d67101a6b4355079
|
|
BLAKE2b-256 checksum How to use checksums |
7cfa42f773a7680566f41dba0dae3387a23833256d0a02b6359b5167cb98bb2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.24
|
Security for chat-history 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.