# Source: https://docs.warp.dev/code/reviewing-code.md

# Code Diffs in Agent Conversations

## Reviewing Code Diffs

During an Agent Conversation, Warp can generate code diffs that open directly in a built-in diff editor.

This lets you review proposed changes line by line, refine them with natural language, or make manual edits before choosing whether to apply them. It’s a fast, transparent way to stay in control of agent-generated code.

**Note**: If the `Apply Code Diffs` permission is set to `Agent decides` or `Always allow` in [Agent Profiles & Permissions](https://docs.warp.dev/agent-platform/agent/using-agents/agent-profiles-permissions), code diffs will not be surfaced for you to review. If it's set to `Always ask`, you'll always be prompted to review them.

{% hint style="info" %}
Code diffs generated by Warp are never stored on our servers. Warp's coding agent only works on local repositories. The agent can make changes on remote or docker repositories, but fallback to using terminal commands (i.e. `sed`, `grep` ) to make the changes.
{% endhint %}

<figure><img src="https://4009768362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsjNxoJ0NFCXW6rRdHH3%2Fuploads%2Fgit-blob-b46a55cb41760b643577d70244140211ccd0291a%2Fgenerated_blocklist_diff.png?alt=media" alt=""><figcaption><p>A code diff surfaced in an Agent Conversation.</p></figcaption></figure>

You can also choose whether Warp automatically opens the [Code Review](https://docs.warp.dev/code/code-review) panel the first time you accept a diff in a conversation. This behavior can be toggled in `Settings > Features > General > Auto-open Code Review Panel`.

## **Navigating and applying diffs**

When a Warp Agent generates a code diff, Warp opens it in a built-in text editor with a visual diff view. Changes are grouped into clear hunks for easy inspection.

* Use the `UP` and `DOWN` arrow keys (or mouse clicks) to move between hunks.
* For multi-file changes, use `LEFT` and `RIGHT` arrow keys to switch between files.
* Once satisfied with the changes, you can apply the diffs using `ENTER` or clicking "**Accept Changes**" to apply the modifications.

{% hint style="warning" %}
These modifications will not be applied to the files unless you explicitly accept them.
{% endhint %}

## **Refining or editing the diffs**

If the initial suggestion needs more work:

* Press `R` or select the "**Refine**" button to provide follow-up instructions in natural language. The agent will regenerate the diff based on your input.
* To manually adjust the code, press `E` or click "**Edit**" to switch into an editable view.
* To cancel a pending operation, use `CTRL-C` (on Mac, Windows, or Linux systems). Similarly, you can exit the editor at any time with `ESC` .

{% hint style="info" %}
You can open up code files in Warp in various different ways, refer to: [Opening files in Warp](https://docs.warp.dev/code-editor#opening-files-in-warp)
{% endhint %}

<figure><img src="https://4009768362-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPsjNxoJ0NFCXW6rRdHH3%2Fuploads%2Fgit-blob-3e295beac4f441f221dddee6b480b4d3ea792ffa%2Feditting_diff.png?alt=media" alt=""><figcaption><p>Editing the code diff directly in Warp's native code editor.</p></figcaption></figure>

### Demo: Editing Agent Code in Warp

Here's an example from [Warp University](https://www.warp.dev/university), where Zach demonstrates a how to review and edit Agent code diffs natively in Warp:

{% embed url="<https://www.youtube.com/watch?time_continue=111&v=dm-P63USsVg>" %}