llms.txt: machine-readable documentation index. Markdown version of this page is also available.

JetBrains Air Help

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.

    Main toolbar with the agent widget icon and dropdown arrow highlighted for starting a new agent session.

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

    Agent widget menu in the main toolbar listing the agents and presets available for a new session, and the Manage Agents item.
  1. Open the Agent Sessions tool window. If it is not visible, select View | Tool Windows | Agent Sessions.

  2. Click New Session to start a new session with the currently selected agent or preset.

    Agent Sessions tool window showing the New Session control at the top and a list of existing sessions below it.

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

    Agent Sessions tool window with the list next to New Session expanded, showing the available presets with the current one selected.
  1. Press Ctrl twice to open the global prompt. You can invoke it from anywhere in the IDE.

    Global prompt with the preset list, quick action suggestions, attached code context, and a text field for the request.
  2. To use another agent or preset, click the currently selected one and select the required one from the list.

    Global prompt with the preset list open, listing the available presets and the Add Agents and Manage Presets actions.
  3. Type your request in the text field and press Enter.

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.

  1. Press Ctrl twice to open the global prompt. You can invoke it from anywhere in the IDE.

    Global prompt with the preset list, quick action suggestions, attached code context, and a text field for the request.
  2. Click the New Session button, select Existing Session, and choose the required session from the list.

    New Session menu with Existing Session expanded, showing a Search sessions list of recent sessions grouped under Last 7 days for selection.
  3. 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.

  1. Start a new session.

  2. In the toolbar above the text field, click the run mode list and select New Local Worktree.

    Run mode list open above the text field of a new session, with Local selected and the pointer over New Local Worktree, whose tooltip says that it runs the agent on this machine in a new Git worktree.
  3. 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.

    Custom Worktree Settings dialog with the Create a branch for this worktree checkbox selected and a generated name in the Branch Name field.
  4. 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.

Session header of a worktree session with the source project and its base branch, the worktree branch, the Review Code button with line counts, and the Commit button.

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.

  1. In the session header, click Commit.

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

    Commit tool window opened for the worktree branch, with the changed files of the worktree selected under Changes, an empty commit message field, and the Commit button.

    The commit is added to the worktree branch, and the button in the session header changes to Cherry-pick.

  3. Click Cherry-pick.

  4. In the chat, confirm the cherry-pick: select Yes.

    Worktree session with Cherry-pick in the session header and a question at the bottom of the chat asking to cherry-pick one commit to master, with the Yes and No, do not cherry-pick options.

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.

Cherry-pick card in the chat with an arrow from the worktree branch to master, above the three changed files and their line counts.
  1. In the session header, click Commit.

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

    Commit tool window opened for the worktree branch, with the changed files of the worktree selected under Changes, an empty commit message field, and the Commit button.
  3. Click next to Cherry-pick and select Push to remote.

    Menu next to Cherry-pick in the session header, with Commit unavailable and Push to remote selected under Save worktree changes, and Cherry-pick under Apply to the base branch.
  4. In the Push Worktree Branch dialog, check the repository, the local branch, and the destination, and click Push.

    Push Worktree Branch dialog showing the repository path of the worktree, the local worktree branch, and the remote destination branch, with a note that other branches stay unchanged.
  5. 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.

Session header with the pointer over the worktree branch and the tooltip Open Worktree followed by the branch name.

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 AI | Air | Worktrees. For more information, refer to Worktrees.

AI | Air | Worktrees settings with the Worktree root folder field, the limit and cleanup options, and three worktrees of the selected project, one of them marked as cherry-picked.

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:

  1. Start a new session.

  2. In the toolbar above the text field, click the run mode list and select Cloud.

    Run mode list open above the text field, offering the Local, New Local Worktree, and Cloud modes, with the pointer over Cloud and its tooltip shown.
  3. Select the agent, model, reasoning effort, and operation mode the same way as for a local session.

  4. 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.

    Selector in cloud mode with an environment chosen under Environments, listing the projects and Refresh below it and Manage Environments at the bottom.
  5. 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.

24 November 2026