Role: Sync team context from remote rekal branches. Two modes: team sync (default) and self sync (--self).
Invocation: rekal sync or rekal sync --self.
See preconditions.md: must be in a git repository and init must have been run.
Captures local work, pushes it, fetches remote branches, and rebuilds the search index from local data plus decoded remote wire format.
- Checkpoint (non-fatal) — Capture the current session via
doCheckpoint. If it fails, print a warning and continue. - Push (non-fatal) — Push local data to remote via
doPush. If it fails, print a warning and continue. - Fetch remote refs (non-fatal) —
git fetch origin 'refs/heads/rekal/*:refs/remotes/origin/rekal/*'. If fetch fails (no remote, offline), continue with local data only. - List remote branches —
git for-each-refonrefs/remotes/origin/rekal/, excluding the current user's branch. - Rebuild index — Drop and recreate all index tables, then:
- Populate from local
data.db(sessions, turns, tool calls, files, facets, co-occurrence) - For each remote branch: decode wire format (
rekal.body+dict.bin), insert intoturns_ft,session_facets,files_index— skip tool calls for remote data - Create FTS index (BM25)
- LSA embedding pass
- Nomic deep semantic embedding pass (non-fatal, skipped on unsupported platforms)
- Write index state
- Populate from local
- Print summary —
rekal: synced — N local sessions, N remote sessions from M team member(s).
Fetches your own remote branch and imports into data.db — useful for syncing across machines.
- Fetch own remote branch —
git fetch origin rekal/<email>. Fatal if fetch fails (that's the whole point of--self). - Import to data.db — Decode wire format from
origin/rekal/<email>, import sessions + checkpoints intodata.dbwith dedup by session ID and checkpoint ID. Tool calls are included. - Full index rebuild — Same as
rekal index.
| Aspect | Team sync | Self sync |
|---|---|---|
| Checkpoint + push first | Yes (non-fatal) | No |
| Fetch scope | All rekal/* branches |
Own branch only |
| Remote data goes to | Index DB only | Data DB (permanent) |
| Tool calls from remote | Skipped | Included |
| Fetch failure | Non-fatal | Fatal |
| Flag | Description |
|---|---|
--self |
Only fetch your own rekal branch (not the whole team) |
- Checkpoint/push failures in team sync: non-fatal warnings — sync still fetches and rebuilds.
- Fetch failure in team sync: non-fatal — rebuild with local data only.
- Individual remote branch decode failures: non-fatal — skip branch, log warning, continue.
--selffetch failure: fatal.
Run rekal sync when you want to pull teammates' context. After sync, rekal recall and rekal log see both local and team sessions. Run rekal sync --self to pull your own context from another machine.