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 doctor    # config, detected harnesses, chat counts
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 "payout bug" --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.

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

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.1.3
File Size Uploaded Provenance Actions
chat_memory_sync-0.1.3.tar.gz 27.4 kB With provenance Details for chat_memory_sync-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 53.6 kB

Release files / chat_memory_sync-0.1.3.tar.gz

Download URL chat_memory_sync-0.1.3.tar.gz
Size 27.4 kB
Tags Source
SHA-256 checksum
How to use checksums
fd179c775126dc1261d23afb2892c0e1a3970170e59bafd9b1caf785e643abaa
BLAKE2b-256 checksum
How to use checksums
9dde15d86de184e1a8f63c8c2f5db6cafaa5c4fff83fcf1f832bee2c13bf842e
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 10, 2026.

Transparency log

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

Download URL chat_memory_sync-0.1.3-py3-none-any.whl
Size 26.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7ca30b860fb84f6e99035565466a621c25fbcc185c9dfa09cc80747042647a0a
BLAKE2b-256 checksum
How to use checksums
501442c5469b65da7f85ab2f58565766fb48e4022bae2d6f7064b53b76c6362f
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 10, 2026.

Transparency log

Security for chat-memory-sync 0.1.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.

Full provenance

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

Select from 2 files

Attestation for chat_memory_sync-0.1.3.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 10, 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