Codex Workflows & Worktrees

Good Codex workflows separate planning, implementation, review, and verification.

Four Execution Surfaces

Use the Desktop App for visual local work, CLI for terminal-heavy tasks, IDE extension for editor context, and Cloud for remote background tasks.

Workflow Pattern: Plan → Implement → Review

For non-trivial work:

  1. Ask Codex to inspect and plan.
  2. Let it implement scoped changes.
  3. Run tests or checks.
  4. Review the diff.

Goal Mode

Goal mode is useful when the task is long-running and Codex should continue across steps until the objective is complete.

Parallel Threads

Use parallel threads for independent tasks, research, reviews, or alternative approaches.

What Is A Git Worktree?

A Git worktree is another working directory attached to the same repository. It lets separate branches have separate files on disk.

Manual Creation (CLI)

git worktree add ../repo-feature feature-branch

Worktrees In The Desktop App

The Desktop App can use worktrees to isolate threads and reduce conflicts between parallel tasks.

Local Project vs Worktree

Use the main local project for small, direct edits. Use a worktree for experiments, larger changes, or parallel work.

Example Parallel Workflow

Run one thread to implement a feature, another to review the current branch, and a third to investigate a failing test. Merge only the useful result.

Next Steps

Continue with Automation & CI/CD.

评论