Skip to main content

chat-timeline

Export chat history from Cursor, Claude Code, and Codex and build a git-tracked, LLM-friendly project timeline.

The result is three artifacts that live inside your repo:

  • timeline/timeline.md — chronological, compact, ready for an LLM to read.
  • timeline/contents/timeline.json — referenced content keyed by entry ID.
  • timeline/sessions/session.md — full chat exports + git index context.

A built-in git pre-commit hook keeps the timeline in sync with your commits automatically.

Works on Windows, macOS, and Linux. Pure stdlib — no runtime dependencies.


Install + configure (one command)

pipx install chat-timeline && timeline init

pipx not available? The equivalent is:

python -m pip install --user chat-timeline && timeline init

timeline init is idempotent and does everything for you:

  1. Resolves the project root (git rev-parse --show-toplevel).
  2. Creates timeline/ with chats/, sessions/, contents/, and the archive folder.
  3. Writes timeline/.gitignore and a managed block in the project's .gitignore.
  4. Installs LLM_INSTRUCTIONS.md for downstream prompts.
  5. Installs the git pre-commit hook (calls timeline -p on each commit).

To reverse: timeline deinit removes the hook and the managed .gitignore block. Your exported data is left untouched.


Daily use

timeline                  # interactive selector → exports + session + timeline
timeline claude           # claude only
timeline cursor 1-5       # cursor chats #1..#5
timeline -t               # rebuild timeline only (incremental)
timeline -t -rt           # rebuild timeline from scratch
timeline -p               # pre-commit standalone (auto-detects modified chats)

Equivalent: python -m chat_timeline ….

Full flag reference: timeline --help.

Interactive selector keys

Key Action
↑ ↓ move pointer
PgUp PgDn page
Home End jump to first/last
Space toggle chat (or entry, when expanded)
expand chat to entries
collapse / jump back to parent
a toggle select-all
t cycle tracking mode (chat) or toggle exclude/force-add (entry). Hold 3s to clear tracking.
p toggle pre-commit auto mode
o toggle timeline archive rotation for this run
h cycle hot filter: off → chat (keep chats with any file-changing turn) → entry (keep only file-changing turns)
Tab switch list ↔ numeric input
Enter confirm · Esc cancel

What it reads (per source)

Source Storage location Notes
Cursor %APPDATA%/Cursor/User/workspaceStorage/ (Win), ~/Library/Application Support/Cursor/User/workspaceStorage/ (mac), ~/.config/Cursor/User/workspaceStorage/ (linux) SQLite
Claude Code ~/.claude/projects/<slug>/*.jsonl Cross-runtime: Windows reads WSL data, WSL reads Windows data
Codex ~/.codex/sessions/**/*.jsonl Same cross-runtime discovery

Nothing is transmitted anywhere. Everything runs locally on your machine.


Configuration

Env var Effect
TIMELINE_PROJECT_ROOT Override the auto-detected git toplevel.
TIMELINE_HOME Override the default <project>/timeline location.
TIMELINE_AMEND Set by the pre-commit hook on git commit --amend.

Scan cache

To keep wide-scope scans fast, parsed Codex session metadata is cached under <TIMELINE_HOME>/.cache/sessions/codex/<sha1>.json, keyed by JSONL mtime + size. The cache is regenerated on demand — safe to delete, and already covered by the managed .gitignore block.


Pre-commit hook details

The hook is a POSIX shell script that:

  1. Detects git commit --amend from the parent process's cmdline.
  2. Calls the installed timeline entry point, with fallbacks to python -m chat_timeline and wsl.exe timeline.
  3. Stages any updated timeline files into the commit.

On Windows it runs under Git Bash (which ships with Git for Windows).


Status

v0.2.0 ships the modular layout (sources/, tui/, markdown.py, git_utils.py, session.py, timeline.py, precommit.py, app.py, _state.py) with no _legacy/ block — the CLI and on-disk format are unchanged from v0.1.x.


Contributing

See CONTRIBUTING.md. Bug reports welcome — please include the output of timeline --version and your OS + Python version.

License

MIT. See LICENSE.

Download files

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

Source Distribution

chat_timeline-0.3.2.tar.gz (66.6 kB view details)

Uploaded Source

Built Distribution

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

chat_timeline-0.3.2-py3-none-any.whl (78.4 kB view details)

Uploaded Python 3

File details

Details for the file chat_timeline-0.3.2.tar.gz.

File metadata

  • Download URL: chat_timeline-0.3.2.tar.gz
  • Upload date:
  • Size: 66.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chat_timeline-0.3.2.tar.gz
Algorithm Hash digest
SHA256 b6dd61d635f1c5ed8fc822ab93053616919660c141c0f26f91c14ebc242a4923
MD5 507c6de7fc2e288498733e27b66c8190
BLAKE2b-256 99ea6e6ba5d1735f4e4807fe13065ec5453f4ac66a49c401288db6c7af0f2e8b

See more details on using hashes here.

Provenance

The following attestation bundles were made for chat_timeline-0.3.2.tar.gz:

Publisher: release.yml on fredfts/chat-timeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chat_timeline-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: chat_timeline-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 78.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for chat_timeline-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3135725cdd3d0dd17f7dda579aa25a49069f1d2b120ea504ea9f8308f1c91101
MD5 a27729b7a55cea451e8be4b0126acf19
BLAKE2b-256 7b2702e3a51f1d47a3bdf2ccf28593d1353c7812734b8a5123f80eebdfbd46b0

See more details on using hashes here.

Provenance

The following attestation bundles were made for chat_timeline-0.3.2-py3-none-any.whl:

Publisher: release.yml on fredfts/chat-timeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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