Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
akunzai avatar

Mem Sync

  • 25 installs
  • Updated August 4, 2026
  • akunzai/agent-skills

mem-sync is a Claude Code skill that synchronizes a project's .memories/ daily logs across devices over Git using an isolated per-user branch and worktree.

About

mem-sync synchronizes a project's .memories/ daily logs across machines over Git using a dedicated per-user branch and a background worktree, so the active development branch is never disturbed. It pulls other devices' logs at session start and pushes local logs at session end. A developer uses it to keep agent memory consistent across devices. The sync branch is derived from git user.email so developers on the same repo never collide.

  • Synchronizes project .memories/ across machines over Git using an isolated per-user branch and worktree
  • Never pollutes the active development branch with memory logs
  • Derives a per-user branch memories/<email-localpart> so two developers never collide on same-date log filenames

Mem Sync by the numbers

  • 25 all-time installs (skills.sh)
  • Ranked #370 of 733 Git & Pull Requests skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

mem-sync capabilities & compatibility

Capabilities
memory recall · memory promote · memory setup
Works with
github · gitlab
Use cases
memory · devops
Platforms
macOS · Linux · Windows
Pricing
Free
From the docs

What mem-sync says it does

The sync branch is derived from `git config user.email`: the part before `@`, lowercased and slugified
SKILL.md
Never commit `.memories/` to an ordinary development branch.
SKILL.md
npx skills add https://github.com/akunzai/agent-skills --skill mem-sync

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs25
Last updatedAugust 4, 2026
Repositoryakunzai/agent-skills

What it does

Sync a project's .memories/ daily logs across devices over Git on an isolated per-user branch.

Who is it for?

Syncing agent memory logs across machines without touching the dev branch

Skip if: Committing .memories/ to an ordinary development branch

When should I use this skill?

Pulling other devices' logs at session start or pushing local logs at session end

What you get

Memory logs sync across devices on an isolated per-user branch, leaving the dev branch untouched.

  • Synced .memories/ snapshot across devices
  • A dedicated memories/<user> branch

By the numbers

  • 6 commands (pull, push, status, diff, print-branch, print-remote)

Files

SKILL.mdMarkdownGitHub ↗

mem-sync — Cross-Device Memory Sync

Synchronizes <repo>/.memories/ across machines through a dedicated, isolated per-user branch memories/<email-localpart> using a background git worktree, so the active development branch and your editor workspace are never disturbed.

Per-User Branch

The sync branch is derived from git config user.email: the part before @, lowercased and slugified (non-alphanumeric runs become -). User@Example.commemories/user. Each user pushes/pulls only their own branch, so two developers on the same repo never collide on same-date log filenames.

Windows

On Windows, run this skill's script through Git Bash (Git for Windows). A PATH guard at the top of the script prepends the MSYS usr/bin so find/tar are not shadowed by the native same-name tools; if a required POSIX tool is still missing, the script aborts with an explicit error naming the missing tool.

Commands

Discover the script path dynamically (do NOT hardcode): 1. Global scope: ~/.agents/skills/mem-sync/scripts/mem-sync-git.sh 2. Project scope: <repo>/skills/mem-sync/scripts/mem-sync-git.sh 3. Fallback: search for mem-sync-git.sh.

  • mem-sync-git.sh pull — record local WIP, fetch+rebase remote, copy back. Run at session start.
  • mem-sync-git.sh push — same merge, then push. Run at session end or after promoting candidates.
  • mem-sync-git.sh (no argument) — defaults to status.
  • mem-sync-git.sh status — read-only: print the resolved remote/branch header, then summarize how local .memories/ differs (in sync, or local-only / remote-only / modified files).
  • mem-sync-git.sh diff — read-only: like status but prints the full unified diff (local vs remote).
  • mem-sync-git.sh print-branch — print the derived per-user branch and exit (machine-readable, used by tooling/tests).
  • mem-sync-git.sh print-remote — resolve and print just the sync remote (env → auto-detect) and exit (machine-readable). status already shows this; use print-remote when a script needs the bare value. Exits non-zero with guidance if the remote is ambiguous.

See references/git-sync-workflow.md for mechanics, anti-pollution rules, and conflict handling.

Read-After-Sync Ordering

Run pull, push, and compact as exclusive operations against .memories/. Do not read .memories/ in parallel with those commands.

pull briefly removes and recreates the local .memories/ directory while copying the synchronized snapshot back from the isolated worktree. A parallel grep, Select-String, Get-Content, cat, or similar read can observe that transient missing-directory state and report a false error. Wait for the sync command to finish successfully before scanning handoffs, candidates, or daily logs.

Remote resolution

The sync remote is resolved in this order:

1. `MEM_SYNC_REMOTE` env var — explicit one-off override; highest priority, never persisted. 2. Auto-detect from the repo's own push configuration (not by remote name):

  • the current branch's push target resolved by Git itself

(git for-each-ref --format='%(push:remotename)': branch.<name>.pushRemoteremote.pushDefault → tracking remote) → use that remote, so memory follows wherever the repo actually pushes (e.g. a fork's writable remote), regardless of the name origin;

  • no push target configured but exactly one remote exists → use it;
  • no push target and multiple remotes → ambiguous: the command lists the remotes and

exits non-zero. Give the current branch a push target (git push -u <remote> <branch>) or rerun with MEM_SYNC_REMOTE=<name>, then retry.

The remote is recomputed from live Git config on every run, so retargeting your push remote is picked up automatically — there is no stored memory-sync remote to go stale. The per-user branch name (memories/<email-localpart>) is unaffected by the remote choice.

If a command reports an ambiguous remote set, relay the printed remote list to the user and ask which remote to use, then set a push target (or MEM_SYNC_REMOTE=<name>) before retrying.

Anti-Pollution

Never commit .memories/ to an ordinary development branch. If the user asks to "commit memory" or "sync daily notes to Git", intercept and route through this syncer.

Related skills

FAQ

How does mem-sync avoid collisions between developers?

It derives a per-user branch memories/<email-localpart> from git user.email, so each user pushes and pulls only their own branch.

Which commands does it provide?

pull, push, status, diff, print-branch, and print-remote, run as exclusive operations against .memories/.

Git & Pull Requestsnotesworkflow

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.