Skip to content

Commit afebb2b

Browse files
committed
docs: add high-level architecture diagram and flow explanation
1 parent b7675d9 commit afebb2b

1 file changed

Lines changed: 57 additions & 14 deletions

File tree

README.md

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,22 +144,65 @@ claude-code-sync pull
144144
2. **Backup your age key** - Store in a password manager
145145
3. **Don't share your key** - Each team member should have their own key
146146

147-
## Architecture
147+
## How It Works
148+
149+
```mermaid
150+
flowchart LR
151+
subgraph Machine1["Machine 1 (Desktop)"]
152+
C1[~/.claude/]
153+
S1[claude-code-sync]
154+
end
155+
156+
subgraph GitHub["GitHub (Private Repo)"]
157+
P[Plain: CLAUDE.md, commands/]
158+
E[Encrypted: settings.json.age]
159+
M[.sync-manifest]
160+
end
161+
162+
subgraph Machine2["Machine 2 (Laptop/SSH)"]
163+
C2[~/.claude/]
164+
S2[claude-code-sync]
165+
end
166+
167+
C1 -->|"push (encrypt)"| S1
168+
S1 -->|git push| GitHub
169+
GitHub -->|git pull| S2
170+
S2 -->|"pull (decrypt)"| C2
171+
```
172+
173+
**Push flow:**
174+
1. Read files from `~/.claude/`
175+
2. Encrypt sensitive files (settings, tokens) with your age public key
176+
3. Copy non-sensitive files as-is (CLAUDE.md, commands)
177+
4. Generate SHA256 manifest for integrity
178+
5. Git commit & push to GitHub
179+
180+
**Pull flow:**
181+
1. Git pull from GitHub
182+
2. Backup current `~/.claude/` (in case of conflicts)
183+
3. Decrypt `.age` files with your age private key
184+
4. Copy plain files as-is
185+
5. Verify checksums
186+
187+
### Directory Structure
148188

149189
```
150-
~/.claude-sync/
151-
├── config # Repo URL
152-
├── identity.key # age private key (chmod 600)
153-
├── backups/ # Auto backups before pull
154-
└── repo/ # Git clone
155-
156-
GitHub repo:
157-
├── CLAUDE.md # Plain
158-
├── commands/*.md # Plain
159-
├── agents/*.md # Plain
160-
├── settings.json.age # Encrypted
161-
├── claude.json.age # Encrypted
162-
└── .sync-manifest # Checksums
190+
~/.claude-sync/ # Local sync data (created by init)
191+
├── config # Repo URL
192+
├── identity.key # age private key (chmod 600, KEEP SECRET!)
193+
├── backups/ # Auto backups before pull
194+
└── repo/ # Git clone of your config repo
195+
196+
GitHub repo: # What gets pushed
197+
├── CLAUDE.md # Plain
198+
├── commands/*.md # Plain
199+
├── agents/*.md # Plain
200+
├── skills/*/SKILL.md # Plain
201+
├── hooks/hooks.json # Plain
202+
├── settings.json.age # Encrypted
203+
├── settings.local.json.age # Encrypted
204+
├── claude.json.age # Encrypted (~/.claude.json)
205+
└── .sync-manifest # SHA256 checksums
163206
```
164207

165208
## FAQ

0 commit comments

Comments
 (0)