Skip to content
Codex Agents: One Terminal to Manage Multiple AI Tasks, Persist After Close

Codex Agents: One Terminal to Manage Multiple AI Tasks, Persist After Close

The article walks through Codex CLI's agent command center (`codex agents`), which lists tasks grouped by project, shows real-time statuses (running, awaiting approval, completed), lets you spawn tasks with 'n', filter via Tab, handle approval prompts, and explains how the default daemon mode keeps tasks alive after closing the terminal while `--no-daemon` ties task lifetime to the command-center window.

Tech Ocean
Tech Ocean
Tech Ocean

One command opens the command center, tasks grouped by project

Run codex agents in a terminal. The left pane lists tasks grouped by project directory; each row shows status and last update time. The right pane shows details for the selected task: model, project path, branch, last reply, and your original prompt. The terminal must be wide enough for the detail pane to appear.

Task names are auto-generated from your prompt. For example, a prompt "write a pytest test for calc.py's add function" appears as "Write pytest test for add function".

On first task creation in a directory, a folder-access prompt appears. Choose "Trust and continue" to avoid future prompts for that directory.

Press n to create a task; it lands in the project under the cursor

In the list, press n to open the familiar Codex input box. Type your requirement and press Enter to dispatch. Press ← when the input box is empty to return to the list, then press n again for another task.

Important: The new task's working directory follows the cursor position in the list, not the directory where you launched the command. In the demo, the author opened the command center in project A, but the cursor rested on a task from project B; pressing n initially targeted project B. Moving the cursor back to project A's group before pressing n corrected it. The input box shows the target directory next to the model name for verification.

See what needs you in the "Needs you" filter

Above the list, a row of status filters is toggled with Tab: All (all tasks), Needs you (awaiting your approval), Working (running), Ready (finished, session still in background daemon), Inactive (session no longer in daemon). Tasks that finished a while ago also fall into Inactive but retain an unread indicator.

The author dispatched a task that tried to curl a non-existent address. The sandbox blocked network access; the agent then proposed running the command outside the sandbox, which required approval. The task moved to "Needs you". Selecting it showed a "Needs attention" panel explaining the requested action and reason. Pressing Enter entered the task, where the usual approval prompt appeared. Pressing y allowed the command; it failed again, and the task status became Ready.

Version 0.167 added unread markers: unread completed tasks show a solid blue dot (running = green, awaiting approval = red). Once opened, the dot becomes a hollow circle. When several tasks finish together, a quick scan reveals which ones you haven't reviewed.

Close the command center; tasks keep running (default daemon mode)

codex agents

connects to a local shared background server (called "shared server" in the docs). Tasks actually run inside that server; the command center is just a view-and-control window.

The author started a task that ran sleep 30 then echo done, and immediately closed the command center. One minute later, reopening codex agents showed the task finished with status Ready, an unread blue dot, and both command outputs present in the detail pane.

--no-daemon mode: command center runs its own server; tasks die with it

Since version 0.167, codex agents --no-daemon starts without connecting to the shared daemon. It runs its own server, so tasks live only while the command center is open.

The author tested this with a sleep 20 task, closed the window, then reopened. The task was paused at the sleep step, marked "Conversation interrupted".

Use plain codex agents when you want to dispatch tasks and walk away (even close the terminal). Use --no-daemon when you prefer no background service, but note that closing the window interrupts in-progress tasks.

Common key bindings

Beyond the keys mentioned, the list supports stopping, archiving, renaming, and pinning tasks. Pressing w creates a new task in a separate Git worktree, isolating its changes from the current directory. The article includes a summary table of shortcuts (shown in an image).

With multiple tasks running, keeping one terminal open on the command center is enough: switch to "Needs you" to handle approvals, then open each blue-dotted task to review results — no more hunting across a row of terminal windows.

Command center UI overview
Command center UI overview
Redacted: paths replaced with generic values, other project tasks cropped
Redacted: paths replaced with generic values, other project tasks cropped
Redacted: paths replaced with generic values
Redacted: paths replaced with generic values
Approval prompt in task detail
Approval prompt in task detail
Diagram: command center vs shared server
Diagram: command center vs shared server
Redacted: paths replaced with generic values, other project tasks cropped
Redacted: paths replaced with generic values, other project tasks cropped
Redacted: paths replaced with generic values
Redacted: paths replaced with generic values
Task interrupted in --no-daemon mode
Task interrupted in --no-daemon mode
Keyboard shortcuts summary table
Keyboard shortcuts summary table
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

task managementdeveloper-toolsAI coding assistantCodex CLIterminal multiplexingagent command centerbackground daemon
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.