{"id":52088083,"url":"https://github.com/coryodaniel/claude-sync","last_synced_at":"2026-08-04T03:30:49.468Z","repository":{"id":369396546,"uuid":"1212045814","full_name":"coryodaniel/claude-sync","owner":"coryodaniel","description":"Yo mama is an LLM","archived":false,"fork":false,"pushed_at":"2026-04-16T02:24:29.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-07-05T06:06:21.528Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coryodaniel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-16T02:24:26.000Z","updated_at":"2026-04-16T02:27:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/coryodaniel/claude-sync","commit_stats":null,"previous_names":["coryodaniel/claude-sync"],"tags_count":null,"template":false,"template_full_name":"ChristensenJoe/claude-sync","purl":"pkg:github/coryodaniel/claude-sync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fclaude-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fclaude-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fclaude-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fclaude-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coryodaniel","download_url":"https://codeload.github.com/coryodaniel/claude-sync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coryodaniel%2Fclaude-sync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":36259953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-08-04T02:00:06.901Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-08-04T03:30:48.605Z","updated_at":"2026-08-04T03:30:49.461Z","avatar_url":"https://github.com/coryodaniel.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# claude-sync\n\nSync your [Claude Code](https://docs.anthropic.com/en/docs/claude-code) configuration across devices. Back up your memories, commands, settings, and project knowledge to a private Git repo — then pull them down on any machine.\n\n**This is a template.** Click **\"Use this template\"** to create your own private copy, then follow the setup below.\n\n---\n\n## Why\n\nClaude Code gets smarter the more you use it — but only on the machine you're using. Your corrections, preferences, project knowledge, and custom workflows live in `~/.claude/` and vanish when you switch devices.\n\n**claude-sync** fixes that. It gives you:\n\n- **Portable configuration** — memories, commands, settings, and project knowledge sync to a Git repo and pull down on any machine\n- **Session-start hooks** — every session auto-pulls the latest config and loads your branch notes\n- **Professional workflows** — 9 slash commands for auditing, pattern detection, session management, and knowledge capture\n- **Cross-platform** — works on macOS, Linux, and WSL with any Claude account\n\n---\n\n## The AI Knowledge Flywheel\n\nThe most powerful thing about claude-sync isn't the file syncing — it's what it enables.\n\nEvery time you work with Claude, knowledge is created: you correct an approach, confirm a pattern, make an architectural decision, discover a convention. Without persistence, that knowledge evaporates at the end of each session. Claude makes the same mistakes, asks the same questions, misses the same context — every time.\n\n**claude-sync turns that into a flywheel.** Three layers of persistent knowledge compound over time:\n\n### Layer 1: Global Memory — Who You Are\nYour cross-project identity. How you like to work, what patterns you prefer, what mistakes Claude should never repeat. These follow you everywhere — every project, every device, every session.\n\n*\"Skip the trailing summary — I can read the diff.\" \"Don't abstract prematurely — three similar lines are better than a premature helper.\" \"Always verify a convention exists in project docs before citing it as rationale.\"*\n\n### Layer 2: Project Memory — What You Know\nPer-project tribal knowledge that Claude can't derive from the code alone. What you're working on, what the gotchas are, where things live outside the repo. This is loaded only when you're in that specific project.\n\n*\"Billing migration is in progress — drawer is done, form validation is remaining.\" \"The `orgId` field is auto-injected by the hook wrapper, don't flag it as missing.\" \"Deploy issues are tracked in the Linear project OPS-INFRA.\"*\n\n### Layer 3: Repo Rules — What Everyone Knows\nDocumented conventions in `CLAUDE.md` and `.claude/rules/` that live in the repo itself. These aren't personal — they're shared project documentation that any developer (human or AI) should follow. They travel with Git, not with claude-sync.\n\n*\"Pages must be thin route shells — no business logic, max 15 lines.\" \"All new API calls target v2. Legacy v1 endpoints are frozen.\" \"Test files are co-located with source, never in a top-level `__tests__/` folder.\"*\n\n**The `/learn` command is the engine.** At the end of each session, it reviews your conversation and routes every finding to the right layer. Corrections become memories. Patterns become rules. Decisions become context. Nothing is lost.\n\nOver weeks and months, Claude stops being a generic assistant and becomes a collaborator that knows your codebase, your preferences, and your team's conventions. The flywheel accelerates: fewer corrections needed → more trust → more ambitious tasks delegated → more knowledge captured.\n\n---\n\n## What Gets Synced\n\n| Item | Local Path | Repo Path | Description |\n|------|-----------|-----------|-------------|\n| Global memories | `~/.claude/memory/` | `global/memory/` | Your cross-project preferences and corrections |\n| Global commands | `~/.claude/commands/` | `global/commands/` | Slash commands available in every session |\n| Global CLAUDE.md | `~/.claude/CLAUDE.md` | `global/CLAUDE.md` | Instructions that apply to every session |\n| Settings | `~/.claude/settings.json` | `global/settings.json` | Hooks, env vars, plugins (permissions stay local) |\n| Project memories | `~/.claude/projects/\u003cencoded\u003e/memory/` | `projects/\u003cname\u003e/memory/` | Per-project knowledge, synced by canonical name |\n\n**Not synced:** session data, history, auth tokens, cache, in-repo `.claude/` config (that travels with each repo's Git history).\n\n---\n\n## Prerequisites\n\n- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed\n- `git` with SSH or HTTPS access to your repo\n- `jq` — `brew install jq` (macOS) or `sudo apt install jq` (Linux/WSL)\n- `rsync` — pre-installed on macOS and most Linux distributions\n\n---\n\n## Setup\n\n### 1. Create your copy\n\nClick **\"Use this template\"** → **\"Create a new repository\"** → make it **private**.\n\n### 2. Clone it\n\n```bash\ngit clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME ~/claude-sync\n```\n\n### 3. Run setup\n\n```bash\n~/claude-sync/scripts/claude-sync setup\n```\n\nThis will:\n- Create `~/.claude/memory/` and `~/.claude/commands/` if they don't exist\n- Copy the template commands and CLAUDE.md to your local Claude config\n- Install two session-start hooks (branch notes + config sync)\n- Merge template settings into your existing `~/.claude/settings.json`\n- Install a `claude-sync` symlink at `~/.local/bin/` so you can run `claude-sync` from anywhere\n- Add `~/.local/bin` to your PATH if needed\n\n### 4. Register your projects\n\nFor each project whose Claude memories and branch notes you want to sync:\n\n```bash\n# Default — branch notes stored in sync repo\nclaude-sync add-project my-app /path/to/my-app\n\n# Notion as note source\nclaude-sync add-project my-app /path/to/my-app \\\n  --notes notion --notion-page abc123def456\n\n# Obsidian as note source\nclaude-sync add-project my-app /path/to/my-app \\\n  --notes obsidian --obsidian-vault ~/Documents/Vault --obsidian-note \"Projects/my-app/notes.md\"\n```\n\nProjects are identified by their git remote URL (auto-detected), so worktrees and multiple clones of the same repo all resolve to the same project. The local path is stored for memory directory mapping. On another machine, register the same project with its local path there — the remote URL ties them together.\n\n### 5. Push your initial config\n\n```bash\nclaude-sync push\n```\n\n### 6. Verify\n\n```bash\nclaude-sync doctor\n```\n\n---\n\n## Using claude-sync\n\n### What happens automatically\n\nEvery Claude Code session triggers two hooks — no action required:\n\n**Branch notes** — Claude detects the current project (by git remote) and branch, then reads the branch notes from your configured source (sync repo, Notion, or Obsidian). You get a summary of where you left off on this specific branch. Works seamlessly with worktrees — each worktree's branch has its own notes.\n\n**Config sync** — Pulls the latest configuration from your repo. If you pushed changes from another machine, you'll see what's new. If the pull fails (no network, merge conflict), Claude tells you what went wrong so you can fix it — but never blocks your session.\n\n### A typical coding session\n\nThe commands below are designed to bookend your work. At the start of a session, the hooks handle context automatically. At the end, a short ritual captures everything valuable before you close the terminal.\n\n**Start of session** — automatic. The hooks fire, you see your branch notes and sync status. Start working.\n\n**During the session** — just code. If you switch branches or navigate to a different worktree mid-session, run `/notes` to load the context for where you are now.\n\n**End of session** — this is where the value compounds. Run `/learn` to capture any corrections, decisions, or patterns from the session into the right memory layer. Then run `/repo-audit` to verify your branch is clean against the project's rules before you step away. Together, these two commands take a minute and pay for themselves many times over — `/learn` makes the next session smarter, and `/repo-audit` catches issues while the context is still fresh rather than surfacing them in code review the next day.\n\nFor longer sessions or when you're switching between tasks, `/recap` is a natural stopping point. It writes branch notes summarizing where things stand, which Claude reads back to you next time. The loop closes itself.\n\n### CLI commands\n\n```bash\n# Push local config to your repo\nclaude-sync push\n\n# Check what's different between local and repo\nclaude-sync status\n\n# Register a new project for memory syncing\nclaude-sync add-project my-app /path/to/my-app\n\n# Health check\nclaude-sync doctor\n```\n\n### Adding another machine\n\n```bash\ngit clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME ~/claude-sync\n~/claude-sync/scripts/claude-sync setup\n# After setup, the short form works:\nclaude-sync add-project my-app /home/you/projects/my-app\n```\n\nYour global memories, commands, settings, and project memories are all there. Sign into any Claude account — the config is account-agnostic.\n\n---\n\n## Slash Commands\n\nAll commands are installed globally and available in every Claude Code session.\n\n### Session workflow\n\nThese commands are the core of the daily workflow — capturing knowledge, managing branch context, and wrapping up sessions.\n\n#### `/learn` — Session Knowledge Capture\n\nThe engine of the knowledge flywheel. Reviews your conversation and routes every finding to the right persistence layer:\n\n- **Repo rules** — Invokes `/update-patterns` to document conventions in `CLAUDE.md` and `.claude/rules/` (creates them even in projects that have none yet)\n- **Project memory** — Saves project-specific context: active work status, codebase gotchas, corrections, external references\n- **Global memory** — Saves cross-project preferences: collaboration style, coding philosophy, behavioral corrections\n\nRun this at the end of any session where Claude learned something — whether that's a correction you gave, a decision you made, or a pattern you established. This is what makes the next session better than the last one.\n\n#### `/recap` — Session Recap \u0026 Branch Notes\n\nSummarize what was accomplished and write branch notes for the next session.\n\n- Reviews the session for completed work, in-progress items, blockers\n- Detects the current project (by git remote) and branch\n- Creates or updates `notes.md` in `projects/\u003cname\u003e/branches/\u003cbranch\u003e/` in the sync repo\n- Invokes `/learn` to persist durable knowledge alongside the ephemeral branch state\n\nThe branch notes it writes are exactly what the session-start hook reads back to you next time — forming a complete session continuity loop. Each branch gets its own notes, so worktrees never collide.\n\n#### `/notes` — Read Branch Notes\n\nManually load the branch notes for your current project and branch. This is the same logic that runs automatically on session start.\n\nRun this when you've navigated to a different worktree mid-session, switched branches, or just want to re-read where things stand. Lightweight and read-only.\n\n#### `/sync` — Manual Config Push\n\nPush your current configuration to the cloud repo. Run this after `/learn` if you want the captured knowledge available on another machine immediately, or let the next session's auto-pull handle it.\n\n### Code quality\n\nThese commands help you maintain standards — auditing your branch against documented conventions and growing those conventions over time.\n\n#### `/repo-audit` — Branch Audit\n\nAudit all changed files on your current branch against the project's documented rules.\n\n- Dynamically discovers `CLAUDE.md` and `.claude/rules/*.md`\n- Groups changed files by directory and spawns parallel audit agents\n- Produces a prioritized report: Critical → Architecture → Style → Clean Areas\n- Offers to fix violations\n\nRun this before opening a PR, after a large refactor, or at the end of a session to catch issues while the context is fresh.\n\n#### `/update-patterns` — Pattern Detection\n\nAnalyze your branch for new patterns or conventions that aren't documented yet.\n\n- Compares changed files against existing rules\n- Identifies patterns worth codifying (architecture, naming, data, testing, etc.)\n- Proposes new rules with specific text and destination files\n- Creates `CLAUDE.md` and `.claude/rules/` if they don't exist yet\n\nRun this after implementing a feature that establishes a new pattern, or during code review when you notice undocumented conventions. Note: `/learn` invokes this automatically, so you often don't need to run it directly.\n\n### Project onboarding\n\n#### `/init-rules` — Bootstrap Project Rules\n\nScan a project's codebase and generate an initial `CLAUDE.md` and `.claude/rules/` with detected patterns, conventions, and architecture.\n\n- Detects language, framework, and tooling from config files\n- Reads representative source files to identify patterns\n- Drafts a CLAUDE.md with project overview, file structure, build commands, and golden rules\n- Presents everything for approval before writing\n\nRun this when starting to use Claude in a project that has no Claude configuration, or when onboarding a team to Claude Code. You only need to run it once per project — after that, `/update-patterns` and `/learn` grow the documentation incrementally.\n\n### Maintenance\n\n#### `/doctor` — Health Check\n\nDiagnose common setup issues: missing dependencies, broken hooks, unregistered projects, stale config.\n\nRun this after initial setup, when sync seems broken, or on a new machine to verify everything is wired up.\n\n#### `/memory-audit` — Memory Hygiene\n\nAudit your Claude memory system for redundancy, staleness, and bloat.\n\n- Finds duplicate or overlapping memories across layers\n- Flags stale entries about completed work or deleted code\n- Catches memories stored in the wrong layer (global vs project vs rules)\n- Identifies verbose entries that could be trimmed\n- Detects MEMORY.md index drift (orphaned entries, missing links)\n- Offers to fix all issues with permission\n\nRun this weekly to monthly. Every memory file is loaded into Claude's context window, so redundant or stale memories waste tokens and can cause conflicting instructions. Think of it as garbage collection for your AI knowledge base.\n\n---\n\n## How It Works\n\n### Project identification\n\nProjects are identified by **git remote URL**, not directory path. When you register a project with `add-project`, the script auto-detects the remote from `git remote get-url origin`. The session-start hook and `/notes` command match against this remote, which means:\n\n- **Worktrees just work** — every worktree of the same repo shares the same remote\n- **Multiple clones work** — re-clone to a different path and it still resolves\n- **Cross-machine works** — different local paths, same remote, same project\n\n### Branch notes\n\nEach branch gets its own `notes.md` in the sync repo:\n\n```\nprojects/my-app/branches/feature-billing/notes.md\nprojects/my-app/branches/fix-auth-bug/notes.md\n```\n\nBranch names with `/` (e.g., `feature/billing`) are normalized to `-` (`feature-billing`). Notes are written by `/recap` and read by the session-start hook and `/notes`.\n\n### Note sources\n\nBy default, branch notes are stored as markdown files in the sync repo. You can configure alternative sources per project:\n\n**Notion** — Notes are fetched from a Notion page via the API. Requires:\n- `NOTION_API_KEY` environment variable (create an [integration](https://www.notion.so/my-integrations))\n- A page ID configured via `--notion-page` during `add-project`\n\n**Obsidian** — Notes are read from a markdown file in an Obsidian vault. Requires:\n- Vault path configured via `--obsidian-vault`\n- Note path within the vault via `--obsidian-note`\n\nNote: Notion and Obsidian sources are read-only from Claude's perspective — the session-start hook and `/notes` can read from them, but `/recap` always writes to the sync repo. To use Notion or Obsidian as the write target, manage those notes manually and point Claude at them for reading.\n\n### Path encoding\n\nClaude Code stores project configs at `~/.claude/projects/\u003cencoded-path\u003e/` where the path is encoded by replacing `/` with `-`:\n\n```\n/Users/alice/projects/my-app  →  -Users-alice-projects-my-app\n/home/alice/projects/my-app   →  -home-alice-projects-my-app\n```\n\nThe sync script computes this encoding automatically from the registered project path.\n\n### Settings merge\n\nOn pull, the script merges `hooks`, `env`, and `enabledPlugins` from the repo into local settings. **Permissions are never overwritten** — they're machine-specific.\n\n### Project registration\n\nEach machine has a `.local-config.json` (gitignored) mapping project names to local config:\n\n```json\n{\n  \"projects\": {\n    \"my-app\": {\n      \"path\": \"/Users/alice/projects/my-app\",\n      \"remote\": \"git@github.com:org/my-app.git\",\n      \"notes_source\": \"sync\"\n    }\n  }\n}\n```\n\nOn another machine, the same project with a different local path:\n\n```json\n{\n  \"projects\": {\n    \"my-app\": {\n      \"path\": \"/home/alice/projects/my-app\",\n      \"remote\": \"git@github.com:org/my-app.git\",\n      \"notes_source\": \"sync\"\n    }\n  }\n}\n```\n\nBoth sync to `projects/my-app/` in the repo — same memories, same branch notes.\n\n---\n\n## Repo Structure\n\n```\n├── global/\n│   ├── memory/               # Your global memories (builds up over time)\n│   ├── commands/             # Slash commands (9 included)\n│   ├── CLAUDE.md             # Global instructions\n│   └── settings.json         # Settings template with hooks\n├── projects/\n│   └── \u003cproject-name\u003e/\n│       ├── memory/           # Project-scoped memories\n│       └── branches/\n│           └── \u003cbranch\u003e/\n│               └── notes.md  # Branch-level session notes\n├── scripts/\n│   └── claude-sync           # The sync engine\n├── .gitignore\n└── README.md\n```\n\n---\n\n## Troubleshooting\n\n### Sync fails on session start\n\nThe agent hook reports the error without blocking your session. Common causes:\n\n| Issue | Fix |\n|-------|-----|\n| No network | Connect and run `claude-sync pull` manually |\n| Merge conflict | `cd ~/claude-sync \u0026\u0026 git pull --rebase`, then `claude-sync push` |\n| Repo not cloned | Re-clone and run `claude-sync setup` |\n\n### Commands not available\n\n```bash\nls ~/.claude/commands/\n```\n\nIf empty, run `claude-sync setup` to reinstall them.\n\n### Project memories not syncing\n\nVerify the project is registered:\n\n```bash\ncat ~/claude-sync/.local-config.json\n```\n\nIf missing, register it:\n\n```bash\nclaude-sync add-project my-app /path/to/my-app\n```\n\n### Full reset\n\n```bash\nrm -rf ~/claude-sync\ngit clone https://github.com/YOUR_USERNAME/YOUR_REPO_NAME ~/claude-sync\n~/claude-sync/scripts/claude-sync setup\n# Re-register your projects\n```\n\n### Run a health check\n\n```bash\nclaude-sync doctor\n```\n\n---\n\n## Contributing\n\nThis is a template — fork it, customize it, make it yours. If you find improvements that would benefit everyone, PRs are welcome.\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryodaniel%2Fclaude-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoryodaniel%2Fclaude-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoryodaniel%2Fclaude-sync/lists"}