gitmyhub

claude-autosync

Shell ★ 2 updated 7d ago

Sync Claude Code global rules (CLAUDE.md) and memory across machines via your own private git repo. Agent-installable.

A set of shell scripts that syncs Claude Code's global rules, memory, and skills across Mac, Linux, WSL, and Windows by linking them to a private Git repo you own.

ShellGitPythonsetup: moderatecomplexity 3/5

Claude-autosync is a collection of shell scripts that keeps your Claude Code setup consistent across multiple machines. Claude Code, the AI coding assistant, reads its global instructions from a file called CLAUDE.md in your home directory and stores per-project notes in a memory folder. By default, these files only exist on one machine, so working across a laptop, desktop, and server means each has a different brain. This tool fixes that by linking all those files into a single private Git repository you control.

The mechanism is simple. The installer replaces CLAUDE.md and the memory folders with symbolic links that point into a local clone of your private repo. Whenever you start a Claude Code session, the tool automatically pulls any changes from the remote. When the session ends, it commits and pushes the updates back. The result is that your instructions, memory, and notes travel with you across Mac, Linux, WSL, and Windows without any manual steps.

Setting up the tool involves creating an empty private repository on GitHub or another host, then running the installer with that repo's URL and a project path. The installer backs up any existing files before replacing them, so nothing is lost. On each additional machine, you run the same installer against the same private repo, and the content appears. Skills and slash commands can also be synced, but they are strictly opt-in: nothing under your Claude skills folder is included until you explicitly choose to promote it.

Privacy is central to the design. The public tool repository contains no personal data at all. All your actual rules, memory, and skills live in your own private repo. A special file called local.md holds machine-specific paths and other per-machine details, and it is excluded from git entirely so it never syncs anywhere. The recommendation is to keep API keys and passwords out of git completely and to use a secrets manager for those instead.

This is MIT-licensed, installs via a shell script, and works across Mac, Linux, WSL, and Windows.

Where it fits