# Review changes with AI

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/air/llms.txt).

Besides running tasks in a session, Air in IDEs brings agents into the work of checking the result. These features start from the code and the changes in front of you, and they let you return to an agent with what you found instead of describing it from scratch.

## Summarize the changes of a session

You can review all the changes that an agent made during the session using another agent. Instead of reading every diff yourself, hand the session over and let an agent report what was changed.

To summarize the changes of a session:

Procedure:

1. In the Agent Sessions tool window, expand the session whose changes you want summarized, as described in [Review the files an agent changed](air-in-ides-manage-sessions.html#session-changes).

2. Double-click ![](images/app-client.expui.diff.magicResolveToolbar.svg) Generate summary, or select it and press `Enter` (Windows), `⏎` (macOS), `Enter` (Linux).

![Expanded session in the Agent Sessions tool window with a Generate summary quick prompt listed above the three files that the agent changed.](images/air_generate_summary.png)

Air in IDEs opens a new session and fills its message field with a predefined prompt.

3. Add any details that you want the summary to cover, such as a specific file or a question about the approach the agent took, and then send the message.

The agent inspects the changes and reports the summary in the new session, keeping it out of the history of the session that made the changes.

## Add notes to a diff

While you review the files changed by an agent, you can leave notes on the lines of a diff and send them back to the agent in your next message. Notes let you point at the code you want reworked instead of describing it in the prompt.

> **Note:**
> A diff that you open from the list of changed files in the session chat is read-only and does not accept notes.

To add a note to a diff:

Procedure:

1. Open the diff of a file that an agent changed from one of the following places:

* The Agent Sessions tool window, as described in [Review the files an agent changed](air-in-ides-manage-sessions.html#session-changes).

* The All Changes button in the session header. ![Session header with the project name and the All Changes button, which opens the diff of all files changed in the session.](images/air_all_changes_button.png)

* The Commit tool window.

2. Point at the code you want to comment on:

![Diff with added lines highlighted in green and the chat icon in the gutter next to line 62 for adding a note to that line.](images/air_add_comments_to_diff.png)

* For a single line, click the ![](images/chatMode.svg) icon in the gutter next to that line.

* For several lines, select them in the diff and then click the ![](images/chatMode.svg) icon in the gutter. A note covers anything from a range of lines to an entire changed block.

Alternatively, place the caret on a line or select several lines and press `Alt+Shift+K` (`⌥⇧K` on macOS).

3. Type the note and click Add Note or press `Enter`. Press `Shift+Enter` to start a new line inside the note. To discard the draft, click Cancel or press `Esc`.

![Diff viewer with a note popup on line 45 of the session changes, showing the typed note text and the Cancel and Add Note buttons.](images/air_adding_a_note.png)

> **Note:**
> If you opened the diff from the Commit tool window, select the session that receives the note by clicking ![](images/app-client.expui.general.chevronDown.svg) and selecting from the list.
>
>
>
> ![Note popup on a diff line with the session chevron expanded, listing agent sessions to choose which one receives the note.](images/air_select_session_for_comment.png)

Each note appears as a card under the line or the selection it refers to. When the code moves, the note moves with it and stays attached to the same lines.

### Manage notes

Once a file has at least one note, a diff attachment appears in the message field of the session. Each file gets one attachment that shows the file name, the number of notes, and the lines that they cover. Hovering over a specific note also shows the surrounding code to help you restore the context.

![Message with attachment](images/air_diff_notes_added_to_session_review.png)

Until you send the message, you can work with the notes of a session:

* To return to the notes of a file, click its attachment. The diff opens at the first note.

* To edit or delete a note, click ![](images/app-client.actions.more.svg) on its card and select the required action. ![Note card](images/air_note_card.png)

* To delete all notes of a file at once, remove its attachment from the message field. ![Message with attachment](images/air_diff_notes_added_to_session.png)

The attachment updates as you delete notes and disappears from the message field once the last note of the file is gone.

After you send the message, the notes disappear from the diff and remain on the sent message as a read-only attachment.

> **Note:**
> A note belongs to one session: the session whose diff you opened, or the session that you selected for a diff from the Commit tool window. Notes do not move to other sessions, including new ones. Sessions that changed the same file keep separate notes for it, so each agent receives only the notes from its own session.

> **Tip:**
> While the agent works on the notes, you can add new ones for your next message. If the agent rewrites the lines that a new note covers, check that the note still applies before you send it.

## Resolve merge conflicts with an agent

When a version control operation leaves conflicts in your working copy, you can use an agent to resolve them. Click Resolve with Agent in any of the following places:

Conflicts dialog:

The dialog that reports the conflicting files after an update or a merge.

![The Conflicts dialog listing three unresolved files with a Resolve with Agent button next to Resolve All Simple Conflicts.](images/air_merge_conflicts_dialog.png)

Commit tool window:

The Merge Conflicts group in the Commit tool window.

![The Commit tool window showing a Merge Conflicts group with Resolve and Resolve with Agent links next to the conflicting files.](images/air_merge_conflicts_commit_tool_winodow.png)

Editor banner:

The banner in a conflicted file that you opened in the editor.

![An editor banner reading File has unresolved merge conflicts with Resolve conflicts and Resolve with Agent links for the open file.](images/air_merge_conflicts_editor_banner.png)

Air in IDEs starts a new session scoped to the conflicting files, so the agent focuses on the conflict instead of the rest of the project. Review the result as you review any other merge before you commit it.

