| title | Working with agent sessions in the GitHub Copilot app | ||
|---|---|---|---|
| shortTitle | Agent sessions | ||
| intro | Run multiple isolated agent sessions simultaneously, each with its own branch, and steer them using different session modes, models, and tools. | ||
| allowTitleToDifferFromFilename | true | ||
| product | {% data reusables.gated-features.github-app %}<br><a href="https://github.com/features/ai/github-app" target="_blank" class="btn btn-primary mt-3 mr-3 no-underline"><span>Download {% data variables.copilot.github_copilot_app %}</span> {% octicon "link-external" height:16 %}</a> | ||
| versions |
|
||
| contentType | how-tos | ||
| redirect_from |
|
||
| category |
|
Each session in the {% data variables.copilot.github_copilot_app %} runs in its own isolated workspace, so you can run multiple sessions in parallel and make progress on several tasks without conflicts.
- In the sidebar, next to Projects, click {% octicon "plus" aria-label="Start a new session" %}.
- Choose a project—you can use a folder already on your machine, choose from {% data variables.product.github %}, or clone from a Git URL for repositories hosted outside {% data variables.product.github %} (for example, on Azure DevOps) or for private repositories without app access.
- From the dropdown under the prompt box, choose where the session should run: in a new working tree, in your local repository, or in a cloud sandbox. Cloud sandboxes are fully isolated environments hosted by {% data variables.product.github %}.
- Select a session mode, model, and reasoning effort from the dropdowns below the prompt field. If you choose Auto for the model, the app selects the optimal model for your task based on task complexity.
- Describe the task in the prompt field. You can reference issues with
#, add files with@, or use/for commands.
The agent starts working. Your active sessions appear in the sidebar grouped by repository—click any session to switch to it.
For a list of commands you can use in the prompt box, see AUTOTITLE.
The session mode controls how much autonomy the agent has. You can set the mode from the dropdown below the prompt field and change it at any time.
- Interactive: You and the agent work together. The agent suggests changes and waits for your input before proceeding.
- Plan: The agent creates a plan first. You review and approve the plan before the agent executes it.
- Autopilot: The agent works fully autonomously—writing code, running tests, and iterating without waiting for input.
You can select a model and reasoning effort from the dropdowns below the prompt field. Higher reasoning effort gives the agent more time to think through complex problems but may take longer. You can change both settings at any time during a session.
If you choose Auto in the model picker, the app automatically selects the optimal model for your task based on task complexity. After the session starts, the picker next to Auto shows which model handled each response. For more information, see AUTOTITLE.
If you configured your own model provider in the app, those models also appear in the picker. For setup steps, see AUTOTITLE.
Hover over the {% octicon "info" aria-label="the info icon" %} icon in the model picker to see model details.
The Chats section in the sidebar opens a conversation mode without creating a dedicated branch or worktree. Use it for brainstorming, asking questions, or exploring ideas before starting a session. Your chat history is saved and listed by conversation name.
To archive a chat without losing its history, right-click the chat in the sidebar to open its menu, then click Archive chat.
Use Manage sessions to view, search, and filter sessions and chats, including archived chats. You can select multiple items to archive or delete, and restore chats that you previously archived. The view also shows separate, sortable columns for the disk space used by working files and chat history.
- Open the app settings, then select Sessions.
- Click Manage sessions.
- Search or filter to find the sessions or chats you want to manage.
- Select one or more sessions or chats, then archive or delete them. To restore an archived chat, find the chat, then restore it.
Note
{% data reusables.cli.public-preview-sandbox %}
Cloud and local sandboxes protect sessions in different ways:
- Cloud sandbox: Runs the entire session in an isolated environment hosted by {% data variables.product.github %}. Use a cloud sandbox when you want to keep the session off your machine or run several resource-intensive tasks in parallel. Choose the cloud sandbox execution location when starting a session.
- Local sandbox: Runs the session on your machine, but restricts the filesystem, network, and credential access available to agent-run tools. Use local sandboxing when the agent needs your local tools or development services, but you want to limit its access to the rest of your machine. Configure the default for new local repository and working tree sessions in the project settings, or use
/sandbox onor/sandbox offto change an active local session.
Local sandboxing does not apply to cloud sandbox sessions or sessions that run on a remote host. For more information about how both types of sandbox work, see AUTOTITLE. To enable and configure local sandboxing, see AUTOTITLE.
Note
The /security-review slash command is currently in {% data variables.release-phases.public_preview %} and subject to change.
You can run the /security-review slash command in an active agent session to review your current workstream changes for high-confidence vulnerabilities. The command returns prioritized findings with severity and confidence scores, plus suggested fixes you can apply and verify in the same session.
- Open an active session that has in-progress code changes.
- In the prompt box, type
/security-reviewand press Enter. - Review the findings, then update your code changes as needed.
This lightweight, on-demand review complements {% data variables.product.github %} {% data variables.product.prodname_code_scanning %}, {% data variables.product.prodname_dependabot %}, and {% data variables.product.prodname_secret_scanning %} by giving you an initial check on your local changes before opening a pull request.
The rubber duck agent is a built-in agent that acts as a constructive critic, reviewing your current plan, implementation, or tests and returning concrete feedback. The agent runs on a different model from the one driving your current session.
When rubber duck is enabled, {% data variables.product.prodname_copilot_short %} can consult it automatically at key points while it works. The main session agent passes work to the rubber duck agent, receives the critique, then decides how to apply that feedback before continuing.
You can also manually ask {% data variables.product.prodname_copilot_short %} to get a review from the rubber duck agent.
- Open an active session.
- In the prompt box, type
/rubber-duckand ask for a critique of your current plan, implementation, or tests.
For more information on the rubber duck agent, see AUTOTITLE.
Because the {% data variables.copilot.github_copilot_app %} is built on {% data variables.copilot.copilot_cli %}, you can use {% data variables.copilot.copilot_cli_short %} session history features such as /chronicle to get insights from work you did in the app and in other {% data variables.copilot.copilot_cli_short %} sessions.
For example, you can use /chronicle standup to summarize recent work. For more information, see AUTOTITLE.
You can use voice dictation to speak prompts in a session instead of typing them.
Before you can use voice dictation, you need to configure it in the app settings.
- Open the app settings, then select the Voice dictation tab.
- Choose a keyboard shortcut.
- Allow microphone access in your operating system settings.
- Download a local transcription model.
After setup, use your shortcut to start and stop voice transcription. The app inserts transcribed text into the prompt box so you can review or edit it before sending.
The {% data variables.copilot.github_copilot_app %} supports keyboard shortcuts to help you navigate sessions, switch between workspaces, and perform common actions. To see available shortcuts, open the app, go to Help, then Keyboard Shortcuts.
You can also start a session directly in the app using deep links from markdown files, third-party tools, or scripts. For more information, see AUTOTITLE.