> ## Documentation Index
> Fetch the complete documentation index at: https://cortex-foundation-add13747-droid-2a5c5e50-docs-ferndesk-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Ask, Plan, Agent

> Choose how much a Code turn may change. Ask reads and explains, Plan proposes, Agent edits and runs. The choice rides on the turn.

Every Code turn runs in one of three modes. Pick it on the turn, or leave the session's default. A follow-up can pick a different mode — tighten to Ask to understand, widen to Agent to ship.

## What each mode may do

| Mode      | Edit files | Run commands | What it produces                                                         |
| --------- | ---------- | ------------ | ------------------------------------------------------------------------ |
| **Ask**   | No         | No           | Explanations, answers, code you can copy                                 |
| **Plan**  | No         | No           | A plan block — steps, and a mermaid diagram when it helps                |
| **Agent** | Yes        | Yes          | Changes in the repository, with diffs and command output on the timeline |

Ask and Plan **withhold the mutating tools**. That is enforced by the harness, not by asking the model to behave: in those modes the edit and shell tools are not offered at all. Plan writes its proposal through a dedicated plan tool. Agent receives the full workspace catalog inside the guest. See [How Code works](/code/how-it-works).

## When to use which

| Situation                                                            | Mode                                           |
| -------------------------------------------------------------------- | ---------------------------------------------- |
| Unfamiliar code, *how does this work?*                               | **Ask**                                        |
| Estimating a change, reviewing an approach before anything moves     | **Plan**                                       |
| A change you have already decided on                                 | **Agent**                                      |
| Something went sideways and you want to understand before continuing | Follow up in **Ask**, then return to **Agent** |

## How to pick

1. Choose **Ask**, **Plan**, or **Agent** on the turn. The session row's setting is the default for new turns.
2. Send the task.
3. On a follow-up, change mode if you want a tighter or looser loop.

Web Code has no model picker: the web app is Cloud-only and the runtime chooses the model. In the CLI, `/model` picks the model and the reasoning effort, `/mode` and **Shift+Tab** switch Agent / Plan / Ask, and `/plan` drafts a plan before any code is written — see [CLI modes and permissions](/cli/modes-and-permissions).

<Frame caption="The CLI's slash palette in a small terminal: /plan drafts a plan before writing, /goal keeps a long-horizon objective.">
  <img src="https://mintcdn.com/cortex-foundation-add13747-droid-2a5c5e50-docs-ferndesk-pro/MqnMpE_oEu2JSRan/images/cli/runtime/40x12/slash-palette.png?fit=max&auto=format&n=MqnMpE_oEu2JSRan&q=85&s=b91db49698fd59312b2dc7cad178006b" alt="Cortex CLI slash palette showing /plan and /goal in a 40 by 12 terminal" width="432" height="296" data-path="images/cli/runtime/40x12/slash-palette.png" />
</Frame>

## Plan in practice

A Plan turn reads the repository and returns a structured plan: the steps it would take, the files it would touch, the risks it sees. Nothing changes until you send an Agent turn. Ask for adjustments in Plan as many times as you like — the cheap moment to redirect is before any file moves. The CLI adds a **Spec** lock on top of Plan that keeps mutating tools blocked until you accept the plan; see [CLI modes](/cli/modes-and-permissions).

## Modes are a harness lock, not a promise

The three modes are worth trusting because of where the decision is made. Ask and Plan do not receive the editing and shell tools at all, so there is no instruction the model could follow, misread, or talk itself out of — the tools are simply absent from the request. That is also why a mode change takes effect on the next turn rather than mid-turn: the tool set is chosen when the turn is built.

In Agent, the mode is not a safety net. The agent runs the full workspace catalog inside the guest, which is why the guest is isolated, why approvals exist in the CLI, and why the timeline keeps the diff. Read what it did before your next turn.

## Related

* [Sessions](/code/sessions) — where the turns live.
* [Code quickstart](/code/quickstart) — a first Plan, then Agent.
* [How Code works](/code/how-it-works) — the catalog each mode receives.
* [Code troubleshooting](/code/troubleshooting) — a mode that will not edit.
