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
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-remoteto 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): a sidebar
of projects, instant BM25 search across everything, and a reader that renders each
chat. Backed by the same index as recall.
Multi-machine
Every machine runs the same job independently. Each run:
git pull --rebasethe data repo (other machines' chats)- export this machine's chats (tagged with its
clientid) - prune only this client's deleted chats
- 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
- CONTRIBUTING.md — add a harness adapter (the main ask) or fix a bug.
- ROADMAP.md — planned work; pick anything up.
- CODE_OF_CONDUCT.md.
- Not a coder? A harness request with storage paths + a redacted sample is hugely useful.
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.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| chat_memory_sync-0.2.0.tar.gz | 31.5 kB | With provenance | Details for chat_memory_sync-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| chat_memory_sync-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for chat_memory_sync-0.2.0-py3-none-any.whl |
Total release size: 62.5 kB
Release files / chat_memory_sync-0.2.0.tar.gz
| Download URL | chat_memory_sync-0.2.0.tar.gz |
|---|---|
| Size | 31.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
be0b2d900c62533d6bab3de7020aa65c6b25b2524964138677c015b997c3d5a7
|
|
BLAKE2b-256 checksum How to use checksums |
addae1fc58a2de9a01052fe8a8d94b47b846d3521f83a0a7f4e28f97ce58c9ac
|
| 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 logRelease files / chat_memory_sync-0.2.0-py3-none-any.whl
| Download URL | chat_memory_sync-0.2.0-py3-none-any.whl |
|---|---|
| Size | 31.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c31f00eedc4119aad6592f7d3188ca32eaea611aea444499b52c5cc5f7c7a954
|
|
BLAKE2b-256 checksum How to use checksums |
b84203ef9bd8602d13d71d03b7cc522fee28d7ae8be35771af39ce74a39ec716
|
| 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 logSecurity for chat-memory-sync 0.2.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.
Attestation for chat_memory_sync-0.2.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 10, 2026.
Transparency logA 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.