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. A project is a git repository (identified by its remote name), so clones, worktrees and sub-directories of the same repo all group together — works on any machine layout.
  • 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. Local by default — chats just live in a folder (~/chat-memory, override with --data-dir), no git, no remote:

chat-memory install

Go multi-machine later (seamless)

When you want your chats synced across machines, point it at a private git repo. It converts your existing local folder into a git repo in place, imports your chats, and pushes — no re-export, nothing lost:

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

From then on the daily job pulls, exports, commits, and pushes (see Multi-machine). On your other machines, clone that repo and install against it:

chat-memory install --data-dir ~/chat-memory --data-remote git@github.com:<you>/chat-memory.git --client "other-laptop"

--local forces local mode explicitly; passing --data-remote selects git mode. chat-memory doctor shows the current mode.

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 mcp        # MCP server: expose recall as a tool to any MCP harness
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.6.2

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.6.2
File Size Uploaded Provenance Actions
chat_memory_sync-0.6.2.tar.gz 45.0 kB With provenance Details for chat_memory_sync-0.6.2.tar.gz

Built distribution (wheel)

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

Total release size: 90.2 kB

Release files / chat_memory_sync-0.6.2.tar.gz

Download URL chat_memory_sync-0.6.2.tar.gz
Size 45.0 kB
Tags Source
SHA-256 checksum
How to use checksums
86599bf3e42dd88e7b9ef5b0e5fe4a58e48276acb08af2673d38b109e4e61367
BLAKE2b-256 checksum
How to use checksums
5670d7ccf5d24f22ae9d8d1aca1d3f6cd2f507dd45cc9a46718a92c678773e76
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 12, 2026.

Transparency log

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

Download URL chat_memory_sync-0.6.2-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2c90a9cb40582dc1447faaa3f0d2d9e02d25978dbf70438818714ad01e3b435
BLAKE2b-256 checksum
How to use checksums
ab37a97a08e2c01f02e432a38981a6b2f6072f6b7b1daf34fc4bac65240cc6e2
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 12, 2026.

Transparency log

Security for chat-memory-sync 0.6.2

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.6.2.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 12, 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