| name | flow-sync |
| description | Flow: Sync - Push WIP to Remote for Cross-Machine Pickup - Push the current branch to the remote so you can continue work on another machine. ... |
Codex harness adaptations
Generated from a Claude Code command. Where the procedure references these Claude-only surfaces, adapt as follows:
- Codex worktrees: use the bundled resolver and plain git. Worktrees live at
$FLOW_WORKTREE_BASE/<repo>-<branch> when configured, otherwise as a visible sibling ../<repo>-<branch>; enter with cd and clean up with git worktree remove. Never use Claude's hidden worktree directory.
Flow: Sync - Push WIP to Remote for Cross-Machine Pickup
Push the current branch to the remote so you can continue work on another machine. Optional feature - most users won't need this.
Arguments
None. Operates on the current worktree/branch.
Instructions
When the user invokes /flow-sync, perform these steps:
Step 1: Validate Context
git rev-parse --show-toplevel
BRANCH=$(git branch --show-current)
- If on
main or master: STOP. Report: "Cannot sync main branch. Use /flow-start <issue> to create a worktree first."
- If not on an
issue-* branch: Warn but allow (user may have custom branch names).
Step 2: Check for Uncommitted Changes
git status --short
Step 3: Push to Remote
git push -u origin "$BRANCH"
- If push fails (e.g., rejected): Report the error and suggest
git pull --rebase origin "$BRANCH" to resolve.
Step 4: Output
Synced branch to remote.
Branch: issue-42-fix-login-bug
Remote: origin
To continue on another machine:
/flow-start 42
→ Detects remote branch and creates worktree from it
Error Handling
- Not in a git repo: Report error clearly.
- On main branch: Block sync, suggest
/flow-start.
- Push rejected: Suggest
git pull --rebase to reconcile.
- No remote configured: Report "No remote 'origin' found."
Notes
- This command is intentionally simple - just commit WIP + push.
- Cross-machine sync operates on the
issue-<N>-<slug> branch, not on worktree paths, so the native ../<repo>-<branch>/ location (which is per-workstation and gitignored) does not affect it.
/flow-start already handles the receiving end: it detects the remote branch and, because the native EnterWorktree tool cannot check out an existing remote branch, adds a worktree tracking it with git worktree add and then switches in with EnterWorktree(path=...).
- WIP commits are harmless because
/flow-merge uses squash-merge, collapsing all commits into one clean commit.
- No configuration required - works with any git remote.