From 367141bd6d3f6800827345d77bd960c1d83df331 Mon Sep 17 00:00:00 2001 From: nikola Date: Tue, 19 May 2026 14:36:21 +0200 Subject: [PATCH] docs: add git sync policy to AGENTS.md --- AGENTS.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index 7ee9358..6267a8a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,6 +85,28 @@ THIS RULE APPLIES TO ALL MODELS (codex, deepseek, opencode). ``` 2. This automatically generates HANDOFF.md for the next session. 3. If you cannot run the script, at minimum update the HANDOFF.md manually. +4. AFTER saving the session, sync HANDOFF.md and updated files to the shared git repo. +5. If the shared repo is available, include the sync commands in the save-session flow. + +### Git Sync Policy (Every Session) + +**Central repo**: `https://git.dzonicasa.xyz/dzoni/codex-cli-shared.git` + +**On session START** (before any work): +``` +cd ~/codex-cli-shared && git pull --ff-only 2>/dev/null || git clone https://git.dzonicasa.xyz/dzoni/codex-cli-shared.git ~/codex-cli-shared +``` +Then read `AGENTS.md`, `network-topology.md`, and relevant `HANDOFF*.md` from the repo. + +**On session END** (after saving session): +``` +cd ~/codex-cli-shared +cp ~/codex-cli/projects/*/HANDOFF.md HANDOFF_*.md 2>/dev/null +cp ~/codex-cli/_shared/contexts/network-topology.md _shared_contexts_network-topology.md 2>/dev/null +git add -A && git commit -m "session: $(date +%Y-%m-%d_%H%M%S) — " && git push +``` + +**No cron, no daemons** — just two git commands per session. Zero overhead when idle. ### Handoff protocol (when switching models mid-project): - Example: codex started building an API, then crashed. User opens deepseek.