Skip to content

Commit 9172bb7

Browse files
feat: multi-device sync (push, pull, autosync); v0.3.0
Add three new CLI commands so a vault can follow Federico across machines via a private git remote: - icontext push — stage, commit, push to origin (with gh-create hint when no remote) - icontext pull — rebase --autostash, surface conflicts cleanly - icontext autosync start|stop|status — launchd on macOS, systemd --user on Linux, runs 'icontext push' every 60s The user-prompt-submit hook now also pulls from origin in the background when a remote is configured, so Claude Code sees fresh context from other devices. Updates README with a Multi-device sync section, CHANGELOG with [0.3.0] entry, and bumps version to 0.3.0 in pyproject.toml + cli.py. 89 tests pass.
1 parent 0583c9c commit 9172bb7

6 files changed

Lines changed: 642 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ All notable changes to iContext will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
## [0.3.0] - 2026-05-02
8+
9+
### Added
10+
- **Multi-device sync.** Your vault now follows you across machines via a private git remote.
11+
- `icontext push` — commit and push local changes to origin
12+
- `icontext pull` — rebase against origin with autostash (last-writer-wins, surfaces conflicts)
13+
- `icontext autosync start|stop|status` — background agent that runs `icontext push` every 60 seconds
14+
- macOS: `launchd` at `~/Library/LaunchAgents/dev.icontext.autosync.plist`
15+
- Linux: `systemd --user` timer at `~/.config/systemd/user/icontext-autosync.timer`
16+
- `user-prompt-submit` hook now pulls from origin in the background if a remote is configured, so Claude Code sees fresh context from other machines at the start of every prompt.
17+
- CLAUDE.md snippet references the multi-device sync workflow.
18+
- Tests for `push`, `pull`, and `autosync` (--help, no-origin hint, status reports not running on clean home).
19+
20+
### Changed
21+
- Bumped version to 0.3.0.
22+
723
## [0.2.1] - 2026-05-02
824

925
### Fixed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,50 @@ Optional:
226226
- `git-lfs` for binary assets (`brew install git-lfs`)
227227
- `GEMINI_API_KEY` only if you want the headless `icontext sync` fallback
228228

229+
## Multi-device sync
230+
231+
Same vault, every machine. iContext uses git on a private repo as the sync layer — no extra service, no daemon talking to a vendor.
232+
233+
### Setup (3 steps)
234+
235+
On your **primary machine**, push the vault to a private repo:
236+
237+
```bash
238+
cd ~/context
239+
gh repo create <user>/context --private --source=. --push
240+
icontext autosync start # commits + pushes every 60s
241+
```
242+
243+
On every **other machine**, clone and start autosync:
244+
245+
```bash
246+
gh repo clone <user>/context ~/context
247+
icontext autosync start
248+
```
249+
250+
That's it. Edits made on machine A appear on machine B within ~60s of the next prompt (the `user-prompt-submit` hook also pulls in the background whenever you start a Claude Code prompt).
251+
252+
### Commands
253+
254+
| Command | What it does |
255+
|---|---|
256+
| `icontext push` | Commit local changes and push to origin |
257+
| `icontext pull` | Rebase against origin (autostashes in-flight changes) |
258+
| `icontext autosync start` | Install + start the 60s background agent |
259+
| `icontext autosync stop` | Stop and remove the agent |
260+
| `icontext autosync status` | Show running state and last sync time |
261+
262+
### Conflict handling
263+
264+
`icontext pull` runs `git pull --rebase --autostash`. Last writer wins. If two machines edit the same lines of the same file in the same minute, the rebase surfaces the conflict and prints the file paths — resolve manually with normal git tooling.
265+
266+
In practice, conflicts are rare: profile files are append-mostly, and the 60s push window is shorter than typical edit cycles.
267+
268+
### Implementation
269+
270+
- macOS: `launchd` agent at `~/Library/LaunchAgents/dev.icontext.autosync.plist`. Logs at `~/Library/Logs/icontext.log`.
271+
- Linux: `systemd --user` timer at `~/.config/systemd/user/icontext-autosync.timer`. Logs via `journalctl --user -u icontext-autosync.service`.
272+
229273
## How icontext compares
230274

231275
Common question: "isn't this just like X?"

0 commit comments

Comments
 (0)