Skip to main content

chat-memory-sync

Turn your AI coding assistants' chat history into a unified, searchable memory bank.

chat-memory-sync exports conversations from every AI coding harness you use into one project-organized Markdown repo, syncs it across all your machines via git, and gives agents a recall command to look up relevant past chats — so an assistant working on a feature can learn from what you discussed about it in a different tool weeks ago.

  • Many harnesses → one place: Cursor, Cursor Agent CLI, Claude Code, OpenCode, Pi, Codex, Gemini CLI. (Antigravity is stubbed — opaque local store.)
  • Project-organized so memory is scoped to the repo you're in (worktrees/sub-apps merged into the parent repo).
  • Multi-machine via a client dimension (mac / pc / cloud) — each machine syncs independently; no machine ever clobbers another's chats.
  • Private by design: the tooling is open source; your chats live in a separate private data repo you own.
  • Incremental & idempotent: only changed chats are rewritten; updates to old chats are picked up; deleted chats are pruned.

How it's split

Repo Visibility Contents
chat-memory-sync (this) public the scripts + installer + background job
your data repo (e.g. chat-memory) private projects/ + INDEX.md (your chats)

The tool reads ~/.config/chat-memory/config.json for your data repo's location. Machine-local state (search index, client name, logs) also lives under ~/.config/chat-memory/ — never inside the data repo.

Install

Get the chat-memory CLI (pure Python, no dependencies):

# Homebrew
brew install insideaayush/tap/chat-memory-sync

# pipx (recommended for pip users)
pipx install chat-memory-sync

# pip
pip install --user chat-memory-sync

# from source
git clone https://github.com/insideaayush/chat-memory-sync.git
pip install ./chat-memory-sync

Then set it up on this machine:

chat-memory install \
    --data-remote git@github.com:<you>/chat-memory.git \
    --client "macbook-air" \
    --time 21:00

That one command: writes config, clones (or inits) your private data repo, runs the first sync, registers a daily background job for your OS, and ensures the recall command is available.

Commands

chat-memory install    # config + data repo + daily job + recall
chat-memory sync       # pull -> export -> commit -> push (what the job runs)
chat-memory export     # export only (no git)
chat-memory recall …   # search past chats (also the standalone `recall` command)
chat-memory serve      # browse & search your chats in a local web UI (alias: ui)
chat-memory config     # show / change config (--data-dir, --client)
chat-memory doctor     # config, detected harnesses, chat counts
chat-memory uninstall  # remove the background job (keeps your data repo)
OS Background job
macOS launchd LaunchAgent com.user.chat-memory-sync
Windows Task Scheduler task ChatMemorySync
Linux systemd user timer (falls back to cron)

Only needs git + python3. Re-running chat-memory install is safe.

No private data repo yet? Create an empty private repo on your git host first, then pass its URL as --data-remote. Or omit --data-remote to keep it local-only.

Releases are automated (PyPI + Homebrew) — see RELEASING.md.

Finding relevant chats — recall

cd ~/code/my-project
recall "auth token refresh"        # ranked (BM25) hits for THIS repo, with snippets
recall "rate limiting" --all       # every project
recall "flaky integration test" --harness cursor --since 2026-09 -k 10
recall "..." --full                # just file paths (pipe-friendly)

Auto-scopes to the project you're in (via CWD), builds a local SQLite full-text index that rebuilds when chats change. The index is machine-local (~/.config/chat-memory/ index.db), never synced.

For agents: run recall "<topic>" from the repo you're working in, read the top hits, then open those .md files for full context. Add a line to your project's AGENTS.md/CLAUDE.md so assistants do this automatically.

Browse in a UI

chat-memory serve          # opens http://127.0.0.1:8787
chat-memory serve --port 9000 --no-open

A lightweight local web UI (pure stdlib, no deps, binds to localhost only):

  • Chat-style transcript — messages as bubbles; thinking & tool calls as collapsible steps with previews (Cursor-like).
  • Instant BM25 search, plus inline @ filters in the search bar (@cursor rate limiting, @project:my-api) and a Filters dialog.
  • ⌘K command palette to jump to any chat; full keyboard nav (j/k, [/], e, /).
  • Light / dark theme toggle.

Backed by the same index as recall.

chat-memory serve --port 8787

Multi-machine

Every machine runs the same job independently. Each run:

  1. git pull --rebase the data repo (other machines' chats)
  2. export this machine's chats (tagged with its client id)
  3. prune only this client's deleted chats
  4. rebuild indexes from the union, git commit, git push

Set a machine's name with --client (default: hostname), or CHAT_MEMORY_CLIENT=cloud-vm.

Harness support

Legend: ✅ supported · 🧪 partial · 🔜 stub/planned · ❓ wanted (help us!)

Harness Status Source Notes
Cursor ✅ …/Cursor/User/globalStorage/state.vscdb (OS-aware) IDE chats / composers
Cursor Agent CLI ✅ ~/.cursor/acp-sessions/<uuid>/store.db + meta.json blob store
Claude Code ✅ ~/.claude/projects/<enc>/<uuid>.jsonl
OpenCode ✅ ~/.local/share/opencode/opencode.db
Pi ✅ ~/.pi/agent/sessions/<enc>/<ts>_<id>.jsonl
Codex ✅ ~/.codex/sessions/**/rollout-*.jsonl (+ archived_sessions/)
Gemini CLI 🧪 ~/.gemini/tmp/<key>/checkpoint-*.json (+ logs.json) full via checkpoints; else prompts only
Antigravity 🔜 opaque protobuf LevelDB (shared_proto_db) needs a decoder
Windsurf, Aider, Cline, Continue, Zed, Copilot Chat, … ❓ — request or PR

Can't track every tool in the world — adapters are community-driven. Adding one is usually a single function; see CONTRIBUTING.md and the ROADMAP.

How it works

File Role
cmlib.py config + paths (data dir, state dir, client)
sync.py export every harness's native store → Markdown; rebuild indexes
run.py runner: git pull → sync → commit → push (+ warms recall index)
recall.py full-text (BM25) search, auto-scoped to the current project
install.py one-command setup + scheduler + recall command

Adding a harness

Adapters are community-driven — adding one is usually a single generator function in sync.py. See CONTRIBUTING.md for the full contract and the support table above.

Config reference

~/.config/chat-memory/config.json:

{ "data_dir": "/Users/you/chat-memory", "client": "macbook-air" }

Env overrides: CHAT_MEMORY_DATA_DIR, CHAT_MEMORY_CLIENT, CHAT_MEMORY_HOME.

Give your agents memory

Any assistant with shell access can query all your past chats via recall. Add a short snippet to your project's AGENTS.md / CLAUDE.md / GEMINI.md so assistants do it automatically — copy-paste blocks per harness are in docs/agent-integration.md.

Contributing & community

License

MIT — see LICENSE. Contributions accepted under the same license.

The tooling is open source; your chats stay in your own private data repo. This project reads local chat stores and writes Markdown — review the code before running it.

Metadata

Release files for chat-memory-sync 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chat-memory-sync 0.3.0
File Size Uploaded Provenance Actions
chat_memory_sync-0.3.0.tar.gz 40.0 kB With provenance Details for chat_memory_sync-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chat-memory-sync 0.3.0
File Interpreter ABI Platform Actions
chat_memory_sync-0.3.0-py3-none-any.whl Python 3 none any Details for chat_memory_sync-0.3.0-py3-none-any.whl

Total release size: 79.3 kB

Release files / chat_memory_sync-0.3.0.tar.gz

Download URL chat_memory_sync-0.3.0.tar.gz
Size 40.0 kB
Tags Source
SHA-256 checksum
How to use checksums
32d9ca6c60d43389155b0c5cbbb0d8ce843b0230c50f771e0813c9ee10bf286c
BLAKE2b-256 checksum
How to use checksums
73010063c0fa9cfe3bba415bd553fd4bd597013fdeecc7087255930cf4307fc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / chat_memory_sync-0.3.0-py3-none-any.whl

Download URL chat_memory_sync-0.3.0-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
851b4b7820d10af6f83fffeeb0669831409ac076064d0ed3ab787de6ffb750cb
BLAKE2b-256 checksum
How to use checksums
60fee7d4ae8301a7a815016ae088cd05b2afbaf997d234de3fbf0d7d618a71ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for chat-memory-sync 0.3.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for chat_memory_sync-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page