The outcome

Use background agent work safely while preserving a clear handoff and integration decision.

Step by step

A workflow you can repeat.

  1. 01

    Choose an independent task, confirm it does not conflict with active work, and create a dedicated Codex worktree from the intended base branch.

  2. 02

    Give the worktree task its own acceptance criteria, scoped instructions, validation commands, time and cost boundary, and prohibition on push or deploy.

  3. 03

    Let Codex work in the background while keeping secrets, production access, shared mutable services, and unrelated repositories outside its authority.

  4. 04

    Review the worktree status, commits or diff, generated artifacts, dependency changes, tests, and any unresolved assumptions before handoff.

  5. 05

    Handoff or cherry-pick only the accepted work, resolve integration conflicts in the destination checkout, rerun the full checks, and remove the worktree when safe.

Working standard

What good use looks like.

  • Use one worktree per independent task.
  • Keep production authority out of background work.
  • Revalidate after integration.

Official references

Check the current product documentation.