> ## Documentation Index
> Fetch the complete documentation index at: https://docs.open4rena.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Todos and background tasks

> Track the model's todo list, and run shell commands and prompts in the background.

o4 keeps two kinds of lists while it works. The todo list is a checklist of
the steps in the current job, which you and the model both edit. Background
tasks are commands and agents that keep running while you and the model do
other things, such as a dev server or a test watcher.

## The todo list

For a job with several steps, the model writes a todo list and updates it as
it goes. Each item is `pending`, `in_progress`, or `completed`, and at most one
item is in progress at a time.

When there are open items, the status row above the prompt shows the count,
for example `3 todos  Alt+L`, while the model is idle.

### Open the todo list

Press `Alt+L` to open the **Todo List** pane. Press `Alt+L` again or `Esc` to
close it. The key is the `toggle_todo_list` action in
[`[keybindings]`](/reference/keyboard-shortcuts#remappable-actions).

`/todo` is meant to open the pane too, but in o4 0.2.74 it only refreshes the
pane when it's already open. Use `Alt+L`.

| Key | Action |
| - | - |
| `↑`/`↓` or `k`/`j` | Move between items. |
| `a` | Add a todo. This fills the prompt with `/todo add `. |
| `Enter` | Advance the selected item: pending to in progress to completed, then back to pending. |
| `d` | Delete the selected item. |
| `Esc` or `q` | Close the pane. |

The pane's footer also shows `/ filter`, but in o4 0.2.74 pressing `/` opens
the command list instead of filtering the todos.

### Add a todo

Add an item without opening the pane:

```text theme={null}
/todo add Update the changelog before release
```

Items you add are marked as yours. The model can change their status, but it
can't reword or remove them. An item you delete stays deleted, even if the
model sends it again. When you add, advance, or delete an item while the
model is working, o4 tells the model right away so it can adjust.

### How the model uses the list

The model edits the list with the `todo_write` tool, which runs without asking
for approval. Each call sends the whole list. o4 includes the current list in
the model's context on every turn, so the model always sees your changes.

When every item is completed, the list clears itself.

o4 keeps one todo list per running o4, shared by all of its tabs. The list
isn't saved: it's gone when you quit, and a resumed session starts with an
empty list. It can hold up to 100 items of up to 500 characters each.

## Background tasks

A background task keeps running while the conversation continues. Background
tasks include:

* shell commands the model starts in the background, such as a dev server,
* long shell commands and subagents that o4 moved to the background,
* subagents the model started in the background (see
  [subagents](/guides/subagents)),
* recurring prompts you start with `/loop`,
* campaign workers (see [campaigns](/guides/campaigns)).

### Shell commands in the background

The `bash` tool has a `run_in_background` option for long-lived commands such
as `npm run dev` or `tail -f`. The command returns a task ID right away, and
the model checks on it later.

A foreground shell command that runs too long also moves to the background
instead of being killed, so its output isn't lost. This happens when the
command reaches its timeout, or after 2 minutes by default. `sleep` commands
are never moved.

To change the 2-minute limit, set `auto_background_ms` in
`~/.o4/settings.json` or `.o4/settings.json`. The same limit applies to
foreground subagents.

```json theme={null}
{
  "auto_background_ms": 300000
}
```

When a background task finishes, o4 tells the model the next time it can.

### See and control background work

Run `/agents` to open the **Agent command center**. It takes the place of the
chat and lists the agents, background tasks, and campaigns in this o4, running
or finished. You can open it while the model is working.

The line under the title counts the rows: `N need input   N working   N done`.
Rows are grouped under the tab that started them, and work that belongs to no
tab is grouped under `Process`. A subagent is indented under the agent that
started it. Each row shows a status mark, the name, and one status word:

| Status | Meaning |
| - | - |
| `Needs input` | Waiting for you, for example for an approval or an answer. |
| `Working` | Running. |
| `Stalled` | Running, but silent for a while. |
| `Queued`, `Paused` | Not running yet, or paused. |
| `Finished` | Ended well. |
| `Failed`, `Stopped`, `Turn limit` | Failed, was stopped, or hit its turn limit. |

The **Task details** section shows the selected row's kind (such as
`sub-agent` or `background task`), status, latest activity, run time,
tokens, tool calls, and prompt. It's a column on the right when the terminal
is at least 100 columns wide, and below the list otherwise.

| Key | Action |
| - | - |
| `↑`/`↓` or `k`/`j` | Move between rows. |
| `PgUp`/`PgDn` | Scroll the list or the details. |
| `Enter` | Open the selected row: a subagent's or worker's conversation, a task's output, or a main agent's tab. |
| `x` | Stop the selected row and everything it started. |
| `m` | Send a message to the selected agent, or answer the question it's waiting on. Type it and press `Enter`. |
| `r` | Rename the selected row. |
| `f` | Bring the current tab's backgrounded main turn back to the foreground (see [`Ctrl+B`](/reference/keyboard-shortcuts)). |
| `c` | Remove finished rows you've already opened. |
| `/` | Filter the rows by name, description, current activity, or kind. Press `Enter` to keep the filter. |
| `Esc` | Cancel the message or rename box. Otherwise clear the filter, and otherwise close the dashboard. |

The footer also lists `g group` and `n new`. In o4 0.2.74, `g` only cycles
the footer label between `group: project`, `group: status`, and
`group: model`; the rows don't regroup. `n` does nothing when you open the
dashboard with `/agents`.

If you open the dashboard with `e` from the
[agent and task selector](/reference/keyboard-shortcuts#agent-and-task-selector)
instead, it lists your recent sessions, grouped by project folder, with each
session's running work under it. There, `n` starts o4 in the selected row's
folder if you trust that folder, and ends the current session first.

`Alt+B` opens the **Task Board**, a compact table of background tasks and
subagents with their kind, status, token use, last tool call, and run time. Press
`Enter` to inspect a row, `s` to steer it, or `k` to kill it; `k` acts at
once, without asking. Because `k` kills on the Task Board, use `Up` and
`Down` to move between rows there. The footer also lists `p review diff`, but
in o4 0.2.74 `p` types into the prompt instead. `/diff` shows the same diff
of the session's changes.

### How the model manages tasks

The model has these tools for background tasks:

| Tool | What it does | Asks for approval |
| - | - | - |
| `task_list` | List tasks with their ID, type, status, and run time. | No |
| `task_get` | Show one task's status and details. | No |
| `task_output` | Read the last lines of a task's output (50 by default). | No |
| `task_wait` | Wait for a task to finish, then return its status and output. | No |
| `task_stop` | Stop a running task. | Every time |
| `task_create` | Register a new task entry. | Every time |
| `task_update` | Change a task's status. | Every time |

`task_wait` waits up to 300 seconds by default and up to 1800 seconds at most.
If it times out, the task keeps running.

These approval rules apply in the default approval mode. See
[permissions](/safety/permissions) for the other modes.

## Recurring prompts with /loop

`/loop` sends a prompt or a slash command again and again on a schedule. It
runs as a background task in the current session.

```text theme={null}
/loop 30m check the deploy and tell me if anything failed
```

You can put the interval first or say it at the end:

```text theme={null}
/loop check the deploy every 20m
/loop 5m /agents
```

Intervals use `s`, `m`, `h`, or `d`, such as `90s`, `30m`, `2h`, or `1d`.
Without an interval, the loop runs every 10 minutes. Loops run on a cron-style
schedule, so o4 rounds seconds up to whole minutes, and anything over 59
minutes to the nearest whole hour (`90m` runs every 2 hours, `80m` every
hour). It tells you when it rounds.

The first run starts right away. o4 then shows a **Loop Scheduled** pane with
the task number, cadence, cron expression, and prompt. If the prompt opens a
pane of its own, such as `/cost`, that pane replaces it.

A loop is a background task, but in o4 0.2.74 it doesn't appear in `/agents`.
To stop a loop, press `Alt+B` to open the **Task Board**, select the loop's
row (`Loop: <prompt>`), and press `k`. A loop also stops when you quit o4.

## Related pages

* [Subagents](/guides/subagents): hand work to agents with their own context.
* [Campaigns](/guides/campaigns): run several workers on one objective.
* [Goals](/guides/goals): keep the model working toward one objective.
* [Keyboard shortcuts](/reference/keyboard-shortcuts): every default key.
