> ## 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.

# Goals

> Give the model one objective to keep working on across turns.

A goal is a single objective that o4 keeps in front of the model. While a goal
is active, o4 reminds the model of the objective and asks it to keep going
instead of stopping at analysis or a partial fix. Use a goal for a larger job
that takes several turns, such as "get the test suite passing" or "migrate the
config loader to the new format".

## Start a goal

Type `/goal` followed by the objective:

```text theme={null}
/goal Make every test in the api crate pass without skipping any
```

o4 sets the goal and starts a turn right away with instructions to work on it.
The second row below the prompt box shows `Pursuing goal` on the right, with
the time since you set the goal, for example `Pursuing goal (12m)`.

There's one goal per session. Starting a new goal replaces the current one.

## Check, complete, or clear a goal

| Command | What it does |
| - | - |
| `/goal` or `/goal status` | Show the current goal and its status. |
| `/goal complete` | Mark the goal complete. `/goal done` does the same. |
| `/goal clear` | Remove the goal. `/goal reset` does the same. |

When a goal is complete, the same place shows `Goal achieved` and how long it
took. o4 stops sending goal reminders. A goal that ran out of
[budget](#token-budgets) shows no label there; use `/goal` to see its status.

Every `/goal` command runs right away, even while the model is working. A goal
you start during a turn is set at once, and its first prompt goes out when the
current turn finishes. If you clear or complete the goal before then, that
prompt doesn't go out.

## How a goal keeps the model working

While a goal is active, o4 adds a goal reminder, hidden from the chat, in front
of each message you send. The reminder restates the objective, shows the time
and tokens used so far, and asks the model to:

* keep working toward the full objective instead of a smaller version of it,
* check the current state of the code instead of assuming its changes worked,
* note what it finished, what's left, and whether it's blocked,
* prove the goal is done with evidence before it marks the goal complete.

When a turn ends and the goal is still active, o4 also sends the reminder on
its own as a continuation, so the model keeps going without waiting for you.
o4 sends one continuation after each of your messages. If the model stops
again after that turn, it waits for you. o4 skips the continuation if you've
started typing, queued another message, or cancelled the turn.

## How the model finishes a goal

The model has three goal tools. They run without asking for approval.

| Tool | What it does |
| - | - |
| `create_goal` | Set or replace the goal. It takes an `objective` and an optional `token_budget`. |
| `get_goal` | Read the current goal: objective, status, time used, and tokens used. |
| `update_goal` | Mark the goal complete. |

To mark a goal complete, the model has to pass evidence: a list of
requirements from the objective, each paired with what it observed, such as
tests that passed or files it changed. A call without evidence fails.
`/goal complete` doesn't need evidence.

`update_goal` also offers a `blocked` status, but in o4 0.2.74 that call
always fails, so a stuck model can't mark its goal blocked. If the model says
it's blocked, clear the goal with `/goal clear` or give it what it needs.

A goal stays active until the model or you mark it complete, you clear it, or
it reaches its token budget. The goal tools are blocked in
[plan mode](/guides/plan-mode).

## Token budgets

A goal can have a token budget, which is a limit on how many tokens the model
spends on it. `/goal` doesn't set a budget. The model sets one when it calls
`create_goal` with `token_budget`, so ask for it in your prompt if you want
one:

```text theme={null}
Create a goal to finish the parser rewrite with a token budget of 2000000.
```

After each model response, o4 adds the total token count the provider
reported for that request to the goal. That total includes the input, which
is the whole conversation, so it's counted again on every request. A budget
runs out much faster than the model's output alone would suggest.

When the total reaches the budget, the goal becomes `budget limited` and o4
stops sending continuations. From then on, with every message you send, o4
asks the model to summarize what it finished, list what remains, make sure its
work is saved, and suggest how to continue in a new session. This continues
until you run `/goal clear` or `/goal complete`, or start a new goal.

Without a budget, a goal has no token limit.

## Goals across sessions

The goal is saved with the session. When you resume the session with
`o4 resume`, the goal comes back with its status, time used, and tokens used.
For more on resuming, see [sessions](/guides/sessions).

## Related pages

* [Plan mode](/guides/plan-mode): research and plan before a larger change.
* [Todos and background tasks](/guides/tasks-and-todos): the checklist the
  model keeps while it works through a goal.
* [Context and cost](/guides/context-and-cost): track token use for the whole
  session.
