> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/warpdotdev/warp/llms.txt
> Use this file to discover all available pages before exploring further.

# Using Agent Mode to write and run code

> Learn how to activate Agent Mode, send prompts, use the @-menu for context, review diffs, and control agent execution with fast-forward and stop.

Agent Mode is Warp's interactive AI coding agent. It lives inside your terminal session and has direct access to your shell, your file system, and your codebase. You describe what you want in plain language, and the agent figures out which files to read, which commands to run, and which edits to make — showing you each step before applying changes.

## Activating Agent Mode

Press `Ctrl+I` (or `Cmd+I` on macOS) in any Warp session to open the Agent Mode input bar at the bottom of the screen. You can also click the **Agent** button in the toolbar.

<Note>
  Agent Mode requires a Warp account. If you are not signed in, Warp will prompt you to log in before activating Agent Mode.
</Note>

## Sending prompts

Type your prompt in the Agent Mode input bar and press `Enter` to send it. Prompts can be as short as "fix the type error in auth.ts" or as open-ended as "refactor the authentication module to use the new SDK". The agent reads your prompt, plans a sequence of steps, and begins executing them.

You can continue a conversation by sending follow-up prompts in the same session. The agent retains the full conversation history, so you can refer back to earlier steps, ask it to undo a change, or build on what it already did.

## What the agent can do

The agent has access to a set of built-in tools it can call automatically based on your prompt.

<AccordionGroup>
  <Accordion title="Running shell commands">
    The agent can execute arbitrary shell commands in your current session — running tests, installing dependencies, building the project, or anything else you would run yourself. Command output appears as a standard Warp block so you can inspect it.
  </Accordion>

  <Accordion title="Reading and writing files">
    The agent can read any file the current user has permission to access, and it can create or edit files as needed. Before writing, it shows you a diff of the proposed changes in the code review pane so you can approve or reject them.
  </Accordion>

  <Accordion title="Searching code with ripgrep">
    When the `GrepTool` feature is enabled, the agent uses `ripgrep` to search your codebase for symbols, patterns, and references. This complements codebase index search and is especially useful for large monorepos where a targeted grep is faster than an embedding search.
  </Accordion>

  <Accordion title="Reading images">
    With the `ReadImageFiles` feature enabled, the agent can read images from disk (screenshots, diagrams, mockups) and incorporate them into its reasoning. Attach an image via the `@`-menu or pass a file path in your prompt.
  </Accordion>
</AccordionGroup>

## Adding context with the @-menu

The `@`-menu lets you attach specific pieces of context to your prompt as **context chips**. Open it by typing `@` in the Agent Mode input bar.

| Context type   | What it attaches                                     |
| -------------- | ---------------------------------------------------- |
| **File**       | The contents of a specific file                      |
| **Repository** | The entire repo root (triggers codebase indexing)    |
| **Diff**       | The current working-tree diff or a specific diff set |
| **Block**      | The output of a recent terminal block                |
| **Image**      | An image file from disk                              |

Context chips appear as small tags next to your prompt. You can remove a chip before sending by clicking the `×` on it.

## Reviewing diffs

When the agent proposes file changes, they appear in the **code review pane** — a side panel that shows a unified diff of every modified file. You can:

* Review each change hunk before it is applied
* Accept or reject individual files or individual hunks
* Add inline comments on specific lines
* Revert a diff hunk using the revert button in the gutter

<Tip>
  Enable **Auto-open code review pane** in **Settings → AI** to have the pane open automatically the first time the agent proposes a change in a new conversation.
</Tip>

## Fast-forward (auto-execute)

By default, Agent Mode pauses and asks you to confirm before running each shell command. **Fast-forward** removes these confirmation prompts and lets the agent execute commands automatically, so it can complete tasks end-to-end without interruption.

Toggle fast-forward using the lightning bolt button in the Agent Mode toolbar, or enable it for all conversations in **Settings → AI → Fast-forward**.

<Warning>
  Fast-forward gives the agent permission to run any command without asking. Only use it in environments you trust, and review the agent's plan before enabling it for destructive operations.
</Warning>

## Stopping and cancelling

* **Stop** — Click the **Stop** button (or press `Ctrl+C`) to interrupt the agent mid-task. The agent will finish any command that is already running and then pause.
* **Resume** — If you stopped a conversation by mistake, use the **Resume** button to continue from where the agent left off.
* **Cancel** — Discard the current turn entirely and start a new prompt.

## Conversation history

Every Agent Mode conversation is saved in your Warp account. You can:

* Scroll up in the Agent Mode panel to review earlier turns
* Open the **Conversation history** panel to browse and resume past conversations
* Use `oz task list` to list recent agent runs from the command line

<Note>
  Conversation history is stored server-side. If you run Warp offline, you can still see local in-session history, but past conversations from other devices will not be available until you reconnect.
</Note>

## Keyboard shortcuts

| Action                  | Shortcut              |
| ----------------------- | --------------------- |
| Open / close Agent Mode | `Ctrl+I` / `Cmd+I`    |
| Send prompt             | `Enter`               |
| Stop agent              | `Ctrl+C`              |
| Open `@`-menu           | `@` in input bar      |
| Toggle fast-forward     | Lightning bolt button |

## Next steps

<CardGroup cols={2}>
  <Card title="MCP servers" icon="plug" href="/agent/mcp-servers">
    Give the agent new tools by connecting Model Context Protocol servers.
  </Card>

  <Card title="Skills" icon="book-open" href="/agent/skills">
    Shape agent behavior with reusable prompt instructions.
  </Card>

  <Card title="Rules" icon="shield" href="/agent/rules">
    Define project-level constraints that apply to every agent session in a repo.
  </Card>

  <Card title="Cloud agents" icon="cloud" href="/cloud/overview">
    Run agents headlessly in the cloud without keeping a terminal open.
  </Card>
</CardGroup>
