Several Codex sessions. Keep track of each one.

Use separate worktrees, meaningful session names, terminal notifications and explicit resume commands to keep parallel Codex work reviewable.

Several Codex sessions are useful when each has a different finish line. One can investigate a failing test while another updates documentation for an already settled interface. The setup becomes fragile when every tab is called “Codex,” two agents edit the same files, and no one can tell which result is waiting for review. Give each session a location, a name and an explicit next action before increasing concurrency.

Official documentation checked October 15, 2026. Examples below are illustrative; inspect your installed CLI’s help and existing project settings before applying them.

Start with two tasks you can review separately

Write down what each task owns. “Fix authentication” and “refactor authentication” probably share too much code. “Reproduce the expired-link failure without editing” and “update the installation guide” are easier to assess independently. If both tasks need the same design decision, resolve it first and pass the answer to each session.

Your review time is part of the capacity limit. A third agent is not helpful if two finished diffs already need careful reading. Start with one editor and one investigator, then add another writer only when the file boundaries and acceptance checks are clear. Keep a small task ledger outside the repository if you do not want operational notes in the commit.

Create one worktree per editing task

From the existing repository, check the current state and create two new branches from a known remote base. Replace origin/main with your actual target branch:

git status --short
git fetch origin
git worktree add -b fix/reset-link ../app-reset-link origin/main
git worktree add -b docs/install-guide ../app-install-guide origin/main
git worktree list

Git’s worktree manual documents this shared-repository, separate-checkout model. Your uncommitted edits do not automatically appear in the new checkouts. Each worktree needs its own dependency setup where the project requires it. Avoid checking out one branch in multiple worktrees or copying an unexplained dirty directory as your starting point.

In two separate terminal tabs, launch Codex against the two folders. Run the first line in one tab and the second in another:

codex -C ../app-reset-link
codex -C ../app-install-guide

The official CLI reference documents the working-directory option. Check codex --help on the installation you use. Confirm the directory and branch inside each session before asking it to edit; a tab label is not proof of where the process is running.

Name both the conversation and its job

Inside each Codex conversation, use a short task name:

/rename reset-link-fix

OpenAI’s developer command reference documents renaming saved chats. Also name the terminal tab if your terminal supports it. Use names that describe outcomes rather than numbering agents. “Reset-link fix” is useful tomorrow; “Agent 2” requires remembering today’s seating plan.

Give the session a brief that survives interruption:

Goal: reject an expired reset link with a useful error.
Own: reset-link handler and its focused tests.
Before editing: reproduce the failure.
Return: diff, exact checks, result and remaining uncertainty.
Boundary: no push, deployment or shared-data changes.

Adjust the boundary to your actual authorization. Record the checkout path, branch, conversation name and next review step in your ledger. If the agent must wait for the investigator, mark that dependency explicitly and give it independent work only if that work still belongs to the task.

Turn on a signal you will actually notice

Codex supports terminal notifications through its TUI configuration. Merge this into your existing ~/.codex/config.toml; do not create a second [tui] table if one already exists:

[tui]
notifications = true
notification_method = "auto"

The configuration reference lists these options. Delivery depends on terminal support and operating-system settings. Test it with a harmless short task, switch away, and confirm that the signal reaches you. A completed turn is a prompt to inspect the result, not a certificate that the code works.

Choose a consistent review habit: handle a decision, inspect a completed result, then return to your own work. Do not solve a missed notification by granting broader permissions. If alerts are too noisy, reduce concurrency or narrow the events you use. Keep sensitive task details out of notification previews visible on a shared screen.

Resume the intended session

Open a shell in the task’s worktree and use the session picker. When you already know the conversation ID, select it explicitly:

codex resume
codex resume SESSION_ID

These are alternative commands; replace SESSION_ID with the actual saved ID. OpenAI’s CLI guide covers returning to saved conversations. codex resume --last is convenient for a simple workflow, but with several tasks the picker or explicit ID makes your intent easier to verify. Inspect codex resume --help for version-specific filtering.

Before continuing, compare the remembered state with Git. Another person may have changed the base branch, the dependency lockfile may have moved, or a test service may no longer be running. Ask the agent to read the current diff and verify its next assumption. A transcript preserves history; it does not restore a database, server process or external environment.

Coordinate what worktrees still share

Allocate distinct local ports when both tasks run servers. Use isolated test data and separate output paths for tools that write outside the checkout. Avoid simultaneous resource-heavy builds if they make the machine unresponsive. Provider limits and the Mac’s CPU, memory and disk are shared even when source files are separate.

Review each patch against the intended target, then run the affected checks again after integration. A passing test in one branch does not prove two branches work together. Stop the owning session before removing a worktree; inspect tracked and untracked files first, and use ordinary git worktree remove only after preserving the work you need. If Git refuses, investigate instead of adding force.

Use a workspace when the tab count becomes the problem

On a Mac, XAgents groups projects into spaces and gives each agent a tab. That helps keep the task names and waiting sessions visible in one place. Keep the same worktree discipline underneath: a space is an organizational boundary, not a substitute for separate files or services. The help center explains the navigation.

If you also use Claude Code, the side-by-side guide covers handing a task between providers. For either tool, finish with a reviewable result: current commit, changed files, checks actually run and next step. That record is what lets several conversations become completed work rather than several unfinished threads.

Common questions

Can two Codex sessions work in the same repository?

Yes, but separate conversations do not isolate edits. Give independent editing tasks separate Git worktrees and branches, and coordinate shared services and generated files.

Which Codex session does --last resume?

Use the installed CLI help to check its selection behavior. When several tasks are active, the picker or an explicit session ID is a better way to verify that you are resuming the intended conversation.

Keep reading

The XAgents team