docs/codex-fork-tasks.md
These Flow tasks automate the personal Codex fork workflow described in:
~/docs/codex/codex-fork-home-branch-workflow.mdThey are intentionally narrow:
~/repos/openai/codex as the upstream reference checkout~/repos/nikivdev/codex as the fork home checkout~/.worktrees/codexRun 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 --push
If 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"
f codex-fork-statusShows:
nikiv, upstream/main, and private/nikiv refsUse this first when the fork state is unclear.
f codex-fork-syncFast-forwards nikiv in ~/repos/nikivdev/codex to upstream/main.
Optional push:
f codex-fork-sync --push
Safety rule:
f codex-fork-task "<query>"This is the main entry point.
It:
codex/<slug>~/.worktrees/codex/<branch-name-with-slashes-rewritten>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-launch
f codex-fork-lastResumes 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-awareness
f codex-fork-promoteCreates or updates a review branch from the current task worktree tip.
Default mapping:
codex/workspace-awareness -> review/nikiv-workspace-awarenessExamples:
f codex-fork-promote
f codex-fork-promote codex/workspace-awareness --push
f codex-fork-promote ~/.worktrees/codex/codex-workspace-awareness --review-branch review/nikiv-codex-workspace-awareness
The 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