Skip to main content

Local UI and tooling for browsing ChatGPT and Claude history exports

Project description

Chat History

Browse and export your ChatGPT and Claude conversations locally.

Screenshot

Getting Started

Requires Python 3.11+ and uv.

  1. Export your chats from ChatGPT or Claude (Settings → Export data). Both services send a ZIP file by email.

  2. 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.

  3. Run the setup wizard:

    uvx chat-history
    

    The 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 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

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]
  • --clean removes old export files before writing (scoped to --provider if 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 --clean is used.
  • Token stats for Claude are approximate (fallback tokenizer), not exact Claude-native counts.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chat_history-0.3.1.tar.gz (414.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chat_history-0.3.1-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

File details

Details for the file chat_history-0.3.1.tar.gz.

File metadata

  • Download URL: chat_history-0.3.1.tar.gz
  • Upload date:
  • Size: 414.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.24

File hashes

Hashes for chat_history-0.3.1.tar.gz
Algorithm Hash digest
SHA256 e292dfe584dc3c40e715bb783b21864a15df193e5b8900406d6cac6f1a376317
MD5 01ab32c7b92311ca971f14d7eedf30ec
BLAKE2b-256 1713769d422ab70d094729d23aa8e98741f4d6b95481006e39bbc1d5f13ee5ed

See more details on using hashes here.

File details

Details for the file chat_history-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for chat_history-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3427c56faf94bd9d511cf96939fc88c43cbfc774006d7444952dc1866ee3e1fa
MD5 43b8160aaeaef0380452fc865f4e354c
BLAKE2b-256 5144f63b7936411ed8b83d1f61c588695555dd77e5422bb02439d51cf41536a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page