These Flow tasks automate the personal Codex fork workflow described in:
~/docs/codex/codex-fork-home-branch-workflow.md
They are intentionally narrow:
- keep
~/repos/openai/codexas the upstream reference checkout - keep
~/repos/nikivdev/codexas the fork home checkout - create one stable worktree per real fork task under
~/.worktrees/codex - attach Codex sessions to that worktree instead of to one drifting checkout
Run these from ~/code/flow:
cd ~/code/flow
f codex-fork-status
f codex-fork-sync
f codex-fork-task "add workspace ref to the footer"
f codex-fork-last
f codex-fork-promote --pushIf you are outside ~/code/flow, use the explicit config form:
flow run --config ~/code/flow/flow.toml codex-fork-task "add workspace ref to the footer"Shows:
- the upstream reference checkout
- the personal fork home checkout
- the current
nikiv,upstream/main, andprivate/nikivrefs - existing fork worktrees
- the last worktree used by the helper
Use this first when the fork state is unclear.
Fast-forwards nikiv in ~/repos/nikivdev/codex to upstream/main.
Optional push:
f codex-fork-sync --pushSafety rule:
- it refuses to run if the fork home checkout is dirty
This is the main entry point.
It:
- derives a branch like
codex/<slug> - creates or reuses
~/.worktrees/codex/<branch-name-with-slashes-rewritten> - records that worktree as the "last fork worktree"
- resumes the last Codex session in that worktree if one exists
- otherwise starts a fresh Codex session there with an initial prompt that points at the fork workflow doc
Examples:
f codex-fork-task "add workspace ref to the footer"
f codex-fork-task "thread name startup" --branch codex/thread-name-startup
f codex-fork-task "statusline workspace ref" --no-launchResumes codex resume --last in the last worktree created or used by the helper.
This is the closest current Flow equivalent to binding a key that reattaches to the last active fork session.
You can also target a branch or path explicitly:
f codex-fork-last codex/workspace-awareness
f codex-fork-last ~/.worktrees/codex/codex-workspace-awarenessCreates or updates a review branch from the current task worktree tip.
Default mapping:
codex/workspace-awareness->review/workspace-awareness
Examples:
f codex-fork-promote
f codex-fork-promote codex/workspace-awareness --push
f codex-fork-promote ~/.worktrees/codex/codex-workspace-awareness --review-branch review/workspace-awarenessThe helper records the last used worktree in:
~/.flow/codex-fork/last-worktree.txt
That is what powers f codex-fork-last.
If you want the helper to point somewhere else, override these env vars:
FLOW_CODEX_UPSTREAM_CHECKOUTFLOW_CODEX_FORK_HOMEFLOW_CODEX_WORKTREE_ROOTFLOW_CODEX_WORKFLOW_DOCFLOW_CODEX_FORK_STATE_DIRFLOW_CODEX_FORK_BASE_BRANCHFLOW_CODEX_FORK_PRIVATE_REMOTEFLOW_CODEX_FORK_UPSTREAM_REMOTEFLOW_CODEX_FORK_UPSTREAM_BRANCH