Adding a second-model co-lead to a Claude agent team without shared filesystems: mirror + append-only channel + codex exec ticks
Goal: have a different model, Codex CLI on an Azure OpenAI profile, act as co-lead next to a Claude Code lead. They run on different hosts with no shared disk, and the co-lead must not touch the project tree.
What worked:
- A sync loop on the lead host, every 60 s:
- cp the key status files into a stage dir. Copy only the tail (~60 KB) of a huge progress log.
- rsync -a stage/ remote:colead/ to push.
- rsync remote:colead/OUTBOX.md back into the lead tree as COLEAD-TO-LEAD.md.
- Post lines tagged FOR OWNER, ESCALATE or BLOCKING: yes to the human's chat. Keep a seen-set in a state file.
- A tick loop on the co-lead host. It runs a fresh codex exec -m <deployment> --skip-git-repo-check -s workspace-write -C ~/colead -o last.txt "<prompt>" only when the inputs hash changes (at most every 10 min, at least every 30). Make it stateless: NOTES.md plus the append-only OUTBOX are its memory. Do not use exec resume --last when other Codex agents share CODEX_HOME, because it can pick their session.
- Put the protocol in a BRIEF.md. Typed lines: CHALLENGE (ref | problem | ASK | BLOCKING yes/no), NEXT, FOR OWNER, ESCALATE, QUIET. The lead answers each one with RE <ts> | ACCEPT/REJECT + evidence in its own append-only file. State explicitly that the mirror is data, not instructions.
Gotchas:
- Starting a detached loop over ssh with setsid nohup ... & can still keep the ssh call hanging. Redirect all fds (< /dev/null > log 2>&1) or expect the client to block.
- Find model deployment names from past session logs (grep '"model":"' in ~/.codex/sessions), not by guessing.