Skip to content
Back to search

claude-brain-sync

MarketplaceWorks with Claude CodeGitHub

Sync your Claude Code brain across machines — memory, skills, agents, rules, and settings with intelligent semantic merge. Git-based, auto-sync hooks.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today
Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/toroleapinc-claude-brain/badge.svg)](/listings/toroleapinc-claude-brain)

HTML

<a href="/listings/toroleapinc-claude-brain"><img src="/api/listings/toroleapinc-claude-brain/badge.svg" alt="findsafeskills safety rating" /></a>

Install

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Install

# Add the marketplace and install
/plugin marketplace add toroleapinc/claude-brain
/plugin install claude-brain-sync

Initialize (first machine)

/brain-init git@github.com:you/my-brain.git

Join (other machines)

/brain-join git@github.com:you/my-brain.git

With encryption

/brain-init git@github.com:you/my-brain.git --encrypt

Done. Auto-sync handles everything from here.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 27 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. {
  2. "name": "claude-brain-sync",
  3. "owner": {
  4. "name": "edvatar"
  5. },
  6. "metadata": {
  7. "description": "Sync your Claude Code brain across machines — memory, skills, agents, rules, and settings with intelligent semantic merge.",
  8. "version": "0.2.0"
  9. },
  10. "plugins": [
  11. {
  12. "name": "claude-brain-sync",
  13. "source": "./",
  14. "description": "Sync and evolve your Claude Code brain across machines. Automatically exports, merges, and applies your accumulated knowledge across all your development machines via Git.",
  15. "version": "0.2.0",
  16. "author": {
  17. "name": "edvatar"
  18. },
  19. "homepage": "https://github.com/toroleapinc/claude-brain",
  20. "repository": "https://github.com/toroleapinc/claude-brain",
  21. "license": "MIT",
  22. "keywords": ["sync", "memory", "brain", "multi-machine", "merge", "dotfiles", "productivity"],
  23. "category": "productivity",
  24. "tags": ["sync", "memory", "cross-machine", "semantic-merge"]
  25. }
  26. ]
  27. }
README.md · README · 296 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

  1. <p align="center">
  2. <h1 align="center">claude-brain</h1>
  3. <p align="center">
  4. <strong>Sync your Claude Code brain across machines — portable, automatic, intelligent.</strong>
  5. </p>
  6. <p align="center">
  7. <a href="docs/i18n/README.zh.md">🇨🇳 中文</a>
  8. </p>
  9. <p align="center">
  10. <b>claude-brain</b> is a Claude Code plugin for <b>brain sync</b> — sync Claude Code memory, skills, agents, rules, and settings across all your machines with semantic merge. Cross-machine, portable, zero daily effort.
  11. </p>
  12. <p align="center">
  13. <a href="https://github.com/toroleapinc/claude-brain/stargazers"><img src="https://img.shields.io/github/stars/toroleapinc/claude-brain?style=social" alt="Stars"></a>
  14. <a href="https://github.com/toroleapinc/claude-brain/blob/main/LICENSE"><img src="https://img.shields.io/github/license/toroleapinc/claude-brain" alt="License"></a>
  15. <a href="https://github.com/toroleapinc/claude-brain/issues"><img src="https://img.shields.io/github/issues/toroleapinc/claude-brain" alt="Issues"></a>
  16. <img src="https://img.shields.io/badge/platform-Linux%20%7C%20macOS%20%7C%20WSL-blue" alt="Platform">
  17. <img src="https://img.shields.io/badge/Claude%20Code-Plugin-blueviolet" alt="Claude Code Plugin">
  18. <a href="https://github.com/toroleapinc/claude-brain/commits/main"><img src="https://img.shields.io/github/last-commit/toroleapinc/claude-brain" alt="Last Commit"></a>
  19. <a href="https://github.com/toroleapinc/claude-brain/network/members"><img src="https://img.shields.io/github/forks/toroleapinc/claude-brain?style=social" alt="Forks"></a>
  20. </p>
  21. </p>
  22. ---
  23. ```
  24. # Machine A (work laptop) — first time setup
  25. > /brain-init git@github.com:you/my-brain.git
  26. ✓ Brain exported: 42 memory entries, 3 skills, 5 rules
  27. ✓ Pushed to remote
  28. # Machine B (home desktop) — join existing brain
  29. > /brain-join git@github.com:you/my-brain.git
  30. ✓ Pulled brain: 42 memory entries, 3 skills, 5 rules
  31. ✓ Merged with local state
  32. ✓ Auto-sync enabled
  33. # Later... check sync status from any machine
  34. > /brain-status
  35. === Claude Brain Status ===
  36. Machine: home-desktop (b7f2...)
  37. Remote: git@github.com:you/my-brain.git
  38. Last push: 2 minutes ago
  39. Last pull: 2 minutes ago
  40. Status: Clean
  41. ```
  42. <p align="center">
  43. <em>Two commands. Zero daily effort. Works forever.</em>
  44. </p>
  45. ---
  46. ## The Problem
  47. You use Claude Code on multiple machines. Your laptop has learned your coding patterns. Your desktop has custom skills. Your cloud VM has different rules. **None of them talk to each other.**
  48. Every time you switch machines, you lose context. You re-teach Claude the same things. Your carefully crafted CLAUDE.md stays behind.
  49. ## The Solution
  50. ```
  51. # Machine A (work laptop)
  52. > /brain-init git@github.com:you/my-brain.git
  53. ✓ Brain exported: 42 memory entries, 3 skills, 5 rules
  54. ✓ Pushed to remote
  55. # Machine B (home desktop)
  56. > /brain-join git@github.com:you/my-brain.git
  57. ✓ Pulled brain: 42 memory entries, 3 skills, 5 rules
  58. ✓ Merged with local state
  59. ✓ Auto-sync enabled
  60. # That's it. Every session start/end syncs automatically.
  61. # Your brain follows you.
  62. ```
  63. Two commands. Zero daily effort. Works forever.
  64. ## Why claude-brain?
  65. | Tool | What it does | What claude-brain adds |
  66. |------|-------------|----------------------|
  67. | **claude-mem** | Enhances memory on one machine | Syncs your *entire brain* across all machines |
  68. | **chezmoi / dotfiles** | Copies config files | **Intelligently merges** knowledge — resolves contradictions, deduplicates |
  69. | **Manual CLAUDE.md copy** | Works but tedious | Auto-syncs silently on every session start/end |
  70. **No other tool does cross-machine semantic merge of Claude Code's brain state.**
  71. ## Key Features
  72. - **Auto-sync** — hooks run on every session start/end, zero effort
  73. - **Semantic merge** — LLM-powered deduplication of memory and CLAUDE.md (not just overwrite)
  74. - **N-way merge** — laptop + desktop + cloud VM all converge intelligently
  75. - **Encryption** — optional `age` encryption for brain snapshots at rest
  76. - **Team sharing** — share skills, agents, and rules with teammates
  77. - **Auto-evolve** — promotes stable patterns from memory to durable config
  78. - **Security-first** — secrets stripped, env vars excluded, private repo enforced
  79. - **Dirt cheap** — ~$0.50-2.00/month typical usage via `claude -p`
  80. ## Quick Start
  81. ### Install
  82. ```bash
  83. # Add the marketplace and install
  84. /plugin marketplace add toroleapinc/claude-brain
  85. /plugin install claude-brain-sync
  86. ```
  87. ### Initialize (first machine)
  88. ```
  89. /brain-init git@github.com:you/my-brain.git
  90. ```
  91. ### Join (other machines)
  92. ```
  93. /brain-join git@github.com:you/my-brain.git
  94. ```
  95. ### With encryption
  96. ```
  97. /brain-init git@github.com:you/my-brain.git --encrypt
  98. ```
  99. Done. Auto-sync handles everything from here.
  100. ## Commands
  101. | Command | Description |
  102. |---------|-------------|
  103. | `/brain-init <remote>` | Initialize brain network with a Git remote |
  104. | `/brain-join <remote>` | Join an existing brain network |
  105. | `/brain-status` | Show brain inventory and sync status |
  106. | `/brain-sync` | Manually trigger full sync cycle |
  107. | `/brain-evolve` | Promote stable patterns from memory to config |
  108. | `/brain-conflicts` | Review and resolve merge conflicts |
  109. | `/brain-share <type> <name>` | Share a skill, agent, or rule with the team |
  110. | `/brain-shared-list` | List all shared artifacts in the network |
  111. | `/brain-log` | Show sync history |
  112. ## What Gets Synced
  113. | Component | Synced? | Merge Strategy |
  114. |-----------|---------|----------------|
  115. | CLAUDE.md | Yes | Semantic merge |
  116. | Rules | Yes | Union by filename |
  117. | Skills | Yes | Union by name |
  118. | Agents | Yes | Union by name |
  119. | Auto memory | Yes | Semantic merge |
  120. | Agent memory | Yes | Semantic merge |
  121. | Settings (hooks, permissions) | Yes | Deep merge |
  122. | Keybindings | Yes | Union |
  123. | MCP servers | Yes | Union (env vars stripped) |
  124. | Shared team artifacts | Yes | Union via shared namespace |
  125. | **OAuth tokens** | **Never** | Security |
  126. | **Env vars** | **Never** | Machine-specific |
  127. | **API keys** | **Never** | Stripped automatically |
  128. ## Architecture
  129. ```
  130. Machine A Machine B Machine C
  131. ┌──────────┐ ┌──────────┐ ┌──────────┐
  132. │ claude- │ │ claude- │ │ claude- │
  133. │ brain │ │ brain │ │ brain │
  134. │ plugin │ │ plugin │ │ plugin │
  135. └─────┬─────┘ └─────┬─────┘ └─────┬─────┘
  136. │ │ │
  137. └──────────┬───────────┴──────────┬───────────┘
  138. │ Git Remote │
  139. │ (your private │
  140. │ repo) │
  141. └──────────────────────┘
  142. ```
  143. No central server. Git handles transport. Each machine merges on pull.
  144. **Merge strategy:**
  145. - **Structured data** (settings, keybindings, MCP) → deterministic JSON deep-merge (free)
  146. - **Unstructured data** (memory, CLAUDE.md) → LLM-powered semantic merge via `claude -p` (~$0.01-0.05)
  147. ## Security
  148. claude-brain is designed with security as a first-class concern:
  149. - **Secrets are never exported** — OAuth tokens, API keys, env vars, `.claude.json` are all excluded
  150. - **Pattern-based secret scanning** — warns if potential secrets are detected in memory
  151. - **MCP env vars stripped** — server configs sync without credentials
  152. - **Private repo enforced** — warns if public repo detected
  153. - **Automatic backups** — every import creates a backup in `~/.claude/brain-backups/`
  154. - **Machine trust model** — only add machines you fully control
  155. - **Optional encryption** — `age` encryption for snapshots at rest
  156. See the full [Security Notice](#security-notice) below.
  157. ## API Costs
  158. | Operation | Cost | When |
  159. |-----------|------|------|
  160. | Structured merge | **Free** | Every sync |
  161. | Semantic merge | ~$0.01–0.05 | Only when content differs |
  162. | Auto-evolve | ~$0.02–0.10 | At most once per 7 days |
  163. | Export / import | **Free** | Every sync |
  164. **Typical monthly cost: $0.50–2.00** for active multi-machine use. Budget cap: $0.50/call (configurable).
  165. ## Platform Support
  166. | Platform | Status |
  167. |----------|--------|
  168. | Linux | Fully supported |
  169. | macOS | Fully supported (Apple Silicon + Intel) |
  170. | WSL | Fully supported (WSL2 recommended) |
  171. | Windows native | Not supported (use WSL) |
  172. | Claude Code Cloud | Not supported |
  173. claude-brain runs as a local plugin that hooks `SessionStart`/`SessionEnd` to shell out to `git` and read/write `~/.claude/`. Cloud sessions are ephemeral, sandboxed, and don't have a persistent `~/.claude` to sync to, so the current architecture doesn't apply. See [#32](https://github.com/toroleapinc/claude-brain/issues/32) for the discussion of what a future read-only Cloud variant could look like.
  174. ## Dependencies
  175. - `git` — sync transport
  176. - `jq` — JSON processing (`apt install jq` / `brew install jq`)
  177. - `claude` CLI — semantic merge (already installed with Claude Code)
  178. - `age` — optional, for encryption
  179. ## Team Sharing
  180. Share skills, agents, and rules with teammates:
  181. ```
  182. /brain-share skill my-useful-tool.md
  183. /brain-share agent debugger.md
  184. /brain-share rule security.md
  185. ```
  186. Shared artifacts live in `shared/` in the brain repo. Memory is **never** shared — personal only. Team members receive shared artifacts on their next sync.
  187. ## Auto-Evolve
  188. The brain runs evolution analysis every 7 days (configurable). It:
  189. - Analyzes memory for stable, repeated patterns
  190. - High-confidence promotions (>0.9) are applied automatically
  191. - Lower-confidence suggestions are queued for manual review via `/brain-conflicts`
  192. Trigger manually anytime with `/brain-evolve`.
  193. ## Encryption
  194. ```
  195. /brain-init git@github.com:you/my-brain.git --encrypt
  196. ```
  197. - Generates an `age` keypair per machine
  198. - Snapshots encrypted before push, decrypted on pull
  199. - Recipients file controls access: `meta/recipients.txt`
  200. - Backward compatible with unencrypted snapshots
  201. ## Security Notice
  202. **Read this before using claude-brain.** This plugin syncs your Claude Code configuration via a Git remote. Understand what data leaves your machine:
  203. ### What IS exported
  204. - CLAUDE.md, rules, skills, agents
  205. - Auto memory and agent memory
  206. - Settings (hooks, permissions — NOT env vars)
  207. - MCP server configurations (env vars stripped)
  208. - Keybindings
  209. - Machine hostname and project directory names
  210. ### What is NEVER exported
  211. - OAuth tokens and API keys
  212. - `~/.claude.json` (credentials)
  213. - Environment variables from settings
  214. - MCP server `env` fields
  215. - `.local` config files
  216. - Session transcripts
  217. ### Important considerations
  218. 1. **Use a PRIVATE Git repository.** Plugin warns if public repo detected.
  219. 2. **Memory may contain sensitive context.** Review before initializing.
  220. 3. **Git history is permanent.** Use `git-filter-repo` to purge if needed.
  221. 4. **Auto-sync runs silently.** Backups created before each import.
  222. 5. **Semantic merge uses Claude API.** Memory content is sent to `claude -p`.
  223. 6. **Trust all machines in your network.** Imported skills execute with Claude's permissions.
  224. ## Contributing
  225. Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
  226. ## License
  227. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.