Your AI agent's memory, kept as history.
Claude Code writes what it learns about you and your projects into files, next to your instructions and skills. None of it has history. memsaga commits every change to a git repository you own, names each commit after the conversation that made it, and brings back the edits you make anywhere else.
Free and open source (MIT) · macOS and Linux · your data stays in your own repository
- Tue 14:02 Fixed login redirect · memory updated
- Wed 09:40 Tidied memory: merged duplicates
- Wed 18:15 Added notes/decisions.md
- Thu 10:03 Restored CLAUDE.md to Monday's version
memsaga: 2 files committed (a1b2c3d)
Every change, and the conversation behind it
Find the conversation behind any change
Each commit carries the session's title and ID. Go from a line in CLAUDE.md to the conversation that wrote it, or from a conversation to everything it changed, and reopen it with claude --resume.
git log -S 'run the tests first' git log --grep 'Session-Title: .*login'
Recorded on example data. The same history on GitHub
Anyone whose Claude Code knows things worth keeping
Claude Code is used for more than code. If it keeps notes for you, the notes deserve a history.
"Why is this rule in CLAUDE.md, and who added it?"
git blame names the commit, and the commit names the conversation. Undo a bad edit with memsaga restore, after reading the diff.
"It rewrote my style guide. What did it say on Monday?"
Your instructions, the facts Claude saved about your work, and any file you point memsaga at, such as ~/notes/plan.md, are kept like drafts of a manuscript. Every earlier draft is still there.
"I taught it this on my laptop. Does my desktop know?"
Memory, skills and hooks reach the other machine the next time you use Claude there. A work account and a personal account each keep their own folder in one repository.
"Merge the duplicates, drop what is stale. I will review."
The clean-up lands as ordinary commits under one conversation. Keep what helps, and roll back the rest with memsaga restore --all.
One repository, filled from three places
Nothing moves. Claude Code keeps reading and writing its files where it always has, and memsaga keeps every version of them.
Claude Code's config directory
What Claude Code reads and writes in ~/.claude, in every account you run.
Files elsewhere that you choose
A plan in your home directory, a notes file, another tool's config. Whoever edits it, you or Claude, the change is committed.
Content only in the repository
It is a normal git repository. Add your own notes, translations of other repositories' docs, anything. memsaga commits it and never deletes it.
On its own, after every reply
There is nothing to remember to run. The work happens in the background and takes well under a second.
Claude changes a file
A memory,
CLAUDE.md, a skill, or a file you listed.The reply ends
Everything that changed becomes one commit, named after the conversation.
It is pushed
To your private GitHub repository, at most every ten minutes and when the session ends.
Your other machine has it
The next time you start a session or send a prompt there.
Fix a memory from your phone
The repository syncs both ways. An edit made on GitHub, on another machine or in the local copy reaches the file Claude reads. A conversation that already read the old text is told what changed.
-
On your phone · GitHub
Staging deploys on merge to main.Production deploys from a tag.Production deploys every Friday from a tag.Commit changes
You correct a memory in GitHub's web editor.
-
On your laptop · next session or prompt
Staging deploys on merge to main.Production deploys every Friday from a tag.↓ from GitHub
memsaga writes the edit into the file Claude reads. Lines you changed on the laptop meanwhile are kept too.
-
In Claude Code
How does webapp deploy to production?Read deploys.md
Every Friday, from a git tag.Claude reads the file and answers from your correction. Had it already read the old text, it would be told what changed.
The same thing, in a real session
Just before this session, deploys.md was edited on GitHub. Asked how webapp deploys, Claude reads the file and answers from the new text.
Changed the same line in both places? Nothing is overwritten: memsaga leaves both versions as they are and tells you, so you can pick one. How two-way sync works
Notes that belong with a repository, but not in it
A translation of a project's docs, your annotated copy of a design, a draft written before the real document exists. Some notes must not be committed to the repository they are about, for example when it belongs to your employer or a client. Ask Claude for one, in any language, and it is filed in your data repository under the source's own path.
- docs/
- architecture.md
- review-process.md
- README.md
- _notes/
- pr-2107-review.md note
- docs/
- architecture.zh-tw.md translation
- new-design.zh-tw.md draft, no source yet
stable webapp/_notes/pr-2107-review.md ~ docs/review-process.md, acme/webapp#2107 stable webapp/docs/architecture.zh-tw.md <- ~/git/webapp/docs/architecture.md draft webapp/docs/new-design.zh-tw.md (no source yet)
Ask in your own words
The companion-docs skill starts when you ask for a version of a document in another language (中文版, 日本語版, en français) or for a note about a repository. Claude writes it at the path that mirrors the source.
Found again by its path
Before Claude summarises or translates a document, it checks whether a companion exists, so the next conversation builds on the last one instead of starting over.
Drafts before the source
Write a design in your own language first. It waits at the path the real document will have, marked as a draft.
One list of them all
The companions skill adds /companions to Claude Code; memsaga companions prints the same list in a terminal: status, path and source.
Both skills come with memsaga install --skills. Companions are committed, pushed and synced like everything else, so you can read them on GitHub from anywhere. These three, in the example repository
It keeps history. It does not take over.
Your files stay where they are
The repository holds copies. memsaga writes Claude's files only when you restore one, or when an edit you made elsewhere arrives.
Every version can come back
Restore one file, or all of them, from any point in history. A restore shows the diff and waits for your yes.
It stays out of Claude's way
If something fails, Claude Code carries on as usual, and memsaga status tells you what happened.
What you add stays
Files you put in the repository yourself are committed and never removed by memsaga.
Secrets stay out
Not copied: ~/.claude.json, credentials, transcripts and caches. settings.json only if you ask.
You own the repository
Plain git, on your disk and in your own private GitHub repository. No service to sign up for, no telemetry.
Eleven things it lets you do
Each one links to its steps in the README.
Claude Code's config directory
Your own files
Everywhere you work
Going further
Set it up once
- The installer puts a prebuilt memsaga in
~/.cargo/bin, for Macs (Apple silicon and Intel) and Linux (x86_64 and arm64). You need git. To build from source instead:cargo install --git https://github.com/grimmerk/memsaga memsaga --locked. - init creates the data repository and replays the edits your recent conversations recorded, so the history starts weeks back. It goes in
memoriesinside the folder where you keep code (~/git,~/code,~/src,~/Projectsor~/dev), or in~/memories;--repopicks another place, and--dry-runshows the choice first. - install connects memsaga to Claude Code. With
--skills, Claude can also answer questions about the history. - gh repo create is optional. With a private GitHub repository, pushes and two-way sync happen on their own.
Keep the data repository private. Memory holds whatever Claude learned while working with you, which often includes details of your work.
$ curl --proto '=https' --tlsv1.2 -LsSf \ https://github.com/grimmerk/memsaga/releases/latest/download/memsaga-installer.sh | sh $ memsaga init --dry-run # what would be imported $ memsaga init $ memsaga install --skills $ gh repo create memories --private --push \ --source ~/git/memories # the path init printed $ memsaga status
# to try it on example data first, run these after the install line; # your real Claude Code config is never read or written $ git clone https://github.com/grimmerk/memsaga $ memsaga/demo/setup.sh && source /tmp/memsaga-demo/env.sh
What memsaga leaves alone, and what to use instead
| What | Why it is left out | Instead |
|---|---|---|
| Conversation transcripts | Large, and mostly your work rather than configuration | Raise cleanupPeriodDays in settings.json to keep them longer |
| Marketplace plugins | Packages you can install again, not files you wrote | Install them again; a mirrored settings.json lists which |
| Credentials and login state | Secrets must never enter a repository | Your system keychain or a password manager |
Fast-changing settings (model, effortLevel) | Rewritten on every /model and /effort | Nothing: each machine keeps its own |
Status: early, in daily use by its author on macOS, tested in CI on Linux. Claude Code is the only agent today; others are on the roadmap.