Start or continue a session
To begin working on a task, you need to start an agent session and give the agent your prompt and the required context. You can start a session with an agent directly, and it uses the model, effort, and operation mode from your last session with that agent. To start with the same settings every time, use a preset – a saved configuration that determines which agent to start, and what model, effort, and operation mode to use.
If you already have a session you want to continue, Air in IDEs also allows you to resume such a session, keeping its previous messages and attached context. You can then send a new request in the same session.
To keep the changes of the agent apart from the files that you work with, you can start a session in a new Git worktree and transfer its commits to your branch when they are ready.
A session runs on your machine by default. If your organization provides cloud runs, you can also run the agent in the cloud, in a temporary environment based on a clone of your remote repository.
Start a new session
Air in IDEs provides multiple ways to start a new session, but the most convenient are:
The agent widget in the main toolbar.
The Agent Sessions tool window.
The global prompt that can be called from anywhere in the IDE.
All entry points create the same type of session. However, the context of their use differs. You may want to choose an entry point based on whether you want to start an empty session immediately or provide your initial request and add context beforehand:
Use the agent widget in the main toolbar to start an empty session immediately. You can then enter your prompt, add context, and send it to the agent.
Use the Agent Sessions tool window to start an empty session while reviewing or managing sessions.
Use the global prompt to provide the agent with context before starting the session. Invoking it from the file open in the editor with the relevant code selected, or clicking Ask AI next to the selection, attaches the file and selection as context, so you can add the remaining details and send the prepared initial request to the agent.
To start a session:
Click the agent widget in the main toolbar to start an empty session with the currently selected agent or preset.

To use another agent or preset, click
next to the widget and select it from the list.

Open the Agent Sessions tool window. If it is not visible, select .
Click New Session to start a new session with the currently selected agent or preset.

To use another agent or preset, click
next to the button and select it from the list.

As a result, a new session opens in a separate tab in the editor called Agent Session View, where you can interact with the agent and work on your task.
Continue an existing session
If you want to continue working in an existing session, you can do so using the global prompt. The new request is added to the selected session, which retains its previous messages and attached context.
Press Ctrl twice to open the global prompt. You can invoke it from anywhere in the IDE.

Click the New Session button, select Existing Session, and choose the required session from the list.

Type your request in the text field and press Enter.
This adds your prompt and attached context to the existing session, allowing you to continue your work.
Start a session in a new worktree
A Git worktree is a separate working copy of a repository. It has its own files and checkout, while all worktrees of the repository share the same Git history. When a session runs in a new worktree, the agent works in this separate copy and does not modify the files of the checkout that you are using.
Start a session in a new worktree when you want to:
Let the agent make changes without modifying the files in your current checkout.
Work on several tasks in parallel, each in its own copy of the repository.
Review the changes of the agent before you bring its commits into your branch.
In the toolbar above the text field, click the run mode list and select New Local Worktree.

If you want to provide a specific name for the worktree branch, click
Custom Worktree Settings next to New Local Worktree, enter the name in the Branch Name field, and click Save.

Write your request and send it.
As a result, Air in IDEs creates the worktree and starts the session in it. The worktree is based on the branch that is checked out in the project when you start the session, and this is also the branch that you later cherry-pick the commits of the worktree into. The session header shows the source project with its base branch, and the branch of the worktree.

Review and transfer the changes
The changes that the agent makes stay in the worktree until you transfer them to your project. To review them, click Review Code in the session header, and follow the instructions provided in Review changes with code notes.
How you transfer the changes to your base branch depends on your workflow:
If you want to apply the changes to your branch right away, commit the changes to the worktree branch, and then cherry-pick them to the base branch.
If you want to keep the changes on a separate branch, for example, to open a pull request or share them with your team, commit the changes to the worktree branch, and then push it to the remote repository.
In the session header, click
Commit.In the Commit tool window, which lists the changes of the worktree, specify the commit message and click Commit.

The commit is added to the worktree branch, and the button in the session header changes to Cherry-pick.
Click
Cherry-pick.
In the chat, confirm the cherry-pick: select Yes.

When the cherry-pick is complete, the chat shows the worktree branch, the base branch that the commits were applied to, and the changed files.

In the session header, click
Commit.In the Commit tool window, which lists the changes of the worktree, specify the commit message and click Commit.

Click
next to Cherry-pick and select Push to remote.

In the Push Worktree Branch dialog, check the repository, the local branch, and the destination, and click Push.

If you want the changes reviewed, open a pull request or a merge request from the worktree branch to the base branch in your Git hosting service, for example, GitHub or GitLab.
Pushing publishes the worktree branch and sets it as the upstream. Your base branch does not change until you merge the worktree branch into it.
Open the worktree as a project
To work with the files of the worktree yourself, open the worktree as a separate project: in the session header, click the name of the worktree branch. The IDE opens the worktree as a project, where you can inspect, run, and edit its files.

Manage worktrees
Air in IDEs creates worktrees in a common root folder and can delete the ones that you no longer use. To change the root folder, limit the number of worktrees, and review or delete the worktrees of a project, press Ctrl+Alt+S and select . For more information, refer to Worktrees.

Run an agent in the cloud
Instead of running an agent on your machine, you can run it on JetBrains infrastructure. In a cloud run, the agent works on a cloud clone of your repository, and the run continues after you close the IDE.
Use a cloud run to offload a long-running or resource-intensive task. The agent works remotely while you continue using the IDE for other work.
Availability
Cloud runs are available only to users in organizations that are eligible for cloud runs in JetBrains Console, with cloud tasks enabled by the organization administrator. Users with personal licenses cannot use cloud runs.
Before you start a cloud run, make sure that the following requirements are met:
You are logged in to your JetBrains Account and have selected an eligible organization workspace.
The project is under Git and has a remote repository hosted on GitHub or GitLab that Air Teams can access.
The project is trusted. In an untrusted project, the IDE does not run Git commands, so Air in IDEs cannot read the remote repository and the branch.
You have access to the remote repository, and the JetBrains Air connection app has access to it. If the connection app has no access to the repository, Air in IDEs shows a warning with a link to configure the access when you select the Cloud run mode.
The checked-out branch is pushed to the remote, together with all commits that the task depends on. The cloud environment is created from the remote repository, so uncommitted changes and local-only commits are not available to the agent.
Start a cloud run
To run an agent in the cloud:
In the toolbar above the text field, click the run mode list and select Cloud.

Select the agent, model, reasoning effort, and operation mode the same way as for a local session.
If you want to run the agent in a specific environment, click the selector next to the run mode and choose the required one under Environments.

Write your request and send it. Air in IDEs resolves the repository, the branch, and the commit to start from, creates the run, and passes your request to the agent.
The cloud session opens in the Agent Session View and reads like a local one: it shows the same conversation, tool calls, and permission requests, so you follow the agent and answer its questions in the same way.
Because the run is hosted in the cloud, closing the IDE does not stop it. When you open the project again, Air in IDEs reconnects to the run and shows what the agent did while the IDE was closed.
Cloud runs that you start outside the IDE – for example, in Air Teams or on another machine – also appear in the Agent Sessions tool window. They are grouped under the project associated with the Git remote used by the run. For more information, refer to Manage agent sessions.
