Skip to main content

Working with multiple GitHub Copilot CLI sessions

Run several Copilot CLI sessions at once and use the sidebar to quickly move between them.

Introduction

Each time you start Copilot CLI, you begin or resume a session. You can think of a session as a conversation between you and GitHub Copilot, which includes:

  • Your prompts: What you've asked Copilot to do, and any replies you made when Copilot asked you questions.
  • Copilot's responses: Answers, explanations, commands, code changes, and so on.
  • Conversation context: Information sent to the large language model to allow it to respond to your prompts appropriately.
  • Tool activity: Files Copilot has accessed, commands it has run, searches it has performed.
  • Session-specific state: For example, the current working directory, filesystem permissions, access approvals, the current mode (interactive, plan, or autopilot).

You're not limited to one session at a time. You can keep several running side by side and switch between them. This can be useful when you are:

  • Working on two pieces of work at once—for example, building a feature in one session while fixing an unrelated bug in another.
  • Waiting on a long-running task—let one session compile, run your test suite, or work autonomously in autopilot while you plan the next change in another.
  • Handing work off—delegate a task to the cloud and keep an eye on it while you carry on locally.

There are three places where you can work with your sessions:

  • The sessions sidebar: a panel docked to the left of your current conversation for quickly switching between the sessions. This is the fastest way to move between active, or recently active, local sessions.
  • The Sessions tab: a more complete list of your session history, including remote sessions. The list is searchable and is displayed in the main CLI area.
  • The session picker: a command-line interface for switching between sessions, which you can invoke from any local session by entering /resume or /continue.

The sessions sidebar is the main focus of this article.

The sessions sidebar

The sidebar is a panel that opens alongside your current chat. Because it sits beside the conversation rather than replacing it, your conversation timeline and prompt input field remain visible while you are on the Current tab of the main CLI area. You can see your other sessions without leaving the session you are working in.

Opening and closing the sidebar

From your conversation, while there is nothing in the prompt input field, press to open the sidebar and move focus into it. Press to move focus back to the conversation, and again to close the sidebar. If you prefer Vim-style keys, h and l work the same way while the sidebar has focus.

Moving between sessions

While the sidebar has focus, press and (or k and j) to move through your sessions. Press Enter to open the session you've chosen. Focus returns to the conversation, allowing you to immediately type a prompt.

Press s to change the order in which sessions are listed, cycling through Recent, Created, Name, and None (unsorted).

You can also switch to a session with the mouse. Both a single and a double click switch to a session. A single click returns the focus to the conversation (like pressing Enter), while a double click leaves the focus in the sidebar with that session selected, so you can keep moving through the session list.

Creating and closing sessions

You can manage your sessions right from the sidebar:

  • Press n to start a new session.

  • Press x twice to close the highlighted session.

    Observação

    Sessions that are running are ended, saved, and removed from the sidebar. Sessions that are not running are simply removed from the sidebar. Sessions you remove in this way are not displayed in the sidebar in future sessions unless you resume the session—for example, from the >/resume session picker.

At the top of the sidebar are two header buttons: (to close the sidebar) and + (to start a new session). Press past the top of the list to move onto this button row, then Tab to switch between the buttons and Enter to activate one. You can also click a button directly.

Reading session status at a glance

Because the sidebar stays on screen while you work, it acts as a session status board. You can tell at a glance which sessions are:

  • Currently running (a solid circle icon: ).
  • The current session displayed in the CLI's Current tab (highlighted).
  • Recently used, but not currently running (a hollow circle icon: ).
  • Busy processing a turn (a pulsing circle icon: ● ◉ ◎ ○), or idle (a static icon).
  • Awaiting your attention (! for a permission prompt, ? for a question).
  • In a particular mode (plan and autopilot modes use different colored text from the default mode).

Resizing and mouse control

Beyond clicking a session to switch to it, you can drag the divider between the sidebar and your conversation to resize the panel, and hover the list and use the scroll wheel to move through longer lists of sessions.

Getting quick help

Press ? while the sidebar is open to see a quick reference guide to the session sidebar.

For the full sidebar reference, see referência de comando da CLI GitHub Copilot.

The Sessions tab

The Sessions tab is a full-screen view of your sessions. Use the Tab key to switch to this tab. Alternatively, enter /session.

The Sessions tab offers several things you don't get in the sidebar:

  • Search: press / then start typing the name of a session you want to find.
  • Scope filter: press a to cycle the list between local, remote, and all sessions.
  • Full history: the tab scans your complete session store, not just the recent ones.
  • Cloud and remote sessions: sessions that ran in the cloud appear here so you can resume them.

Choosing between the sidebar and the Sessions tab

Both places list your sessions, but they are tuned for different jobs. The sidebar is a quick switcher for the sessions you are actively juggling. The Sessions tab is the full library and management surface.

SidebarSessions tab
LayoutDocked beside your conversationFull-screen
Your current chatStays visibleHidden while the tab is open
Sessions shownRecent and live local sessionsYour complete history
Cloud / remote sessionsNoYes
SearchNoYes
Scope (all / local / remote)No (just local)Yes
Best forFast switching in contextFinding, browsing, and managing

Use the sidebar when you want to:

  • Stay in your conversation. The sidebar keeps your conversation timeline on screen while you see your other sessions. Opening the Sessions tab hides your current conversation entirely.
  • Switch fast, in place. With the sidebar focused, you can quickly switch back and forth between sessions.
  • Keep an eye on status. Because it stays on screen, the sidebar lets you see your sessions' status and attention markers—no need to navigate away to check on them.
  • Toggle without leaving your flow. You can open, close, switch sessions with the arrow keys as part of your normal typing.

Use the Sessions tab when you want to:

  • Search for a specific past session.
  • Resume a cloud or remote session—these only appear in the tab.
  • Browse your full history—older sessions that have dropped out of the sidebar's recent list are only reachable here.

You don't give up much by staying in the sidebar for day-to-day work. You can do most session management in the sidebar without going to the Sessions tab.

Returning to a previous session

Sessions are saved, so you can come back to work you started earlier—to continue a task, check what an agent did, or reuse the context you had already built up.

  • From the sidebar: recent sessions for your current directory appear as resumable rows (marked ○). Highlight one and press Enter to open it and start working there again.
  • From the Sessions tab: search or browse your complete history, including cloud sessions, and open any of them.
  • With the session picker: within a local session, enter /resume (or /continue) to display a picker listing your saved sessions. Use the arrow keys to navigate to a session, then press Enter to open it, or d to delete it. Press s to cycle through different sort orders for the list: relevance (how well it matches your current working directory), last used, created, and name.

You can also pick a session when you start Copilot CLI from the command line:

# Resume the most recent session
copilot --continue

# Choose a session to resume
copilot --resume

# Resume a specific session by ID, ID prefix, or exact name
copilot --resume=SESSION-ID
copilot --resume="my feature"

# Name a new session so it is easy to find later
copilot --name "checkout refactor"

Active and inactive sessions

At any moment, a session is one of two things:

  • Active: running right now inside Copilot CLI, whether it's the session you're chatting with or one running in the background. When you switch away from a session it keeps running rather than stopping, so a long task carries on while you move to another. Active sessions are indicated with a filled circle ().
  • Inactive: saved to disk but not running. Inactive sessions are indicated with an empty circle ().

A local session stays active for as long as the Copilot CLI process running it stays open. There's no inactivity timeout—a background session sitting idle isn't stopped automatically. When you quit Copilot CLI, its local sessions stop and become inactive. They're still saved, so you can resume them next time. To stop your machine sleeping while a session is active, use /keep-alive on.

Sessions can also run remotely. When you delegate a task with /delegate (or by prefixing a prompt with &), Copilot hands the work off to Copilot cloud agent on GitHub, which works in the background on your behalf—independently of your CLI. These cloud sessions appear in the Sessions tab, where you can resume them and steer locally. For more on hands-off work, see Delegando tarefas para Copilot.

Stopping a session

To stop the session you are currently working in, use the /exit slash command. Alternatively, you can stop a session from the sidebar by highlighting it and pressing x. This stops the session and removes it from the sidebar until you resume it.

Stopping a session doesn't delete it. The session is saved and you can resume it later.

You don't have to stop sessions. Leaving them running lets you switch back instantly with their full context. But you might stop one to halt work you no longer want: for example, a session running in autopilot mode, or a session running a prompt that you scheduled with /every or /after. You might also choose to stop a session to free up memory, or just to reduce clutter in the sidebar.

Session slash commands

You can manage sessions with slash commands from inside any session:

CommandWhat it does
/newStart a new session.
/resume [SESSION-ID], /continueSwitch to another session, choosing from the picker (or pass an ID).
/rename [NAME]Rename the current session (a name is generated if you omit one).
/sessionOpen the Sessions tab.
/session infoShow details about the current session.
/session idShow the current session ID and copy it to the clipboard.
/session filesList the files changed in this session.
/session planShow the current plan.
/session checkpoints [N]Show the session's checkpoints.
/session cleanup, /session pruneHousekeeping for old or stale session data.
/session delete [ID], /session delete-allDelete a session, or all of them.
/exit, /quitClose the current session. If others are open, the newest remaining one comes to the foreground. The CLI quits only when you close the last session.

Customizing the sidebar

The sidebar is available by default. You can turn off the ability to open it, or change various aspects of its behavior, by using the various /settings sidebar.* slash commands in an interactive session. For example, you can enable close buttons for each session in the sidebar, and you can have the current focus (conversation or sidebar) follow the mouse pointer position.

For the full list of sidebar settings and their defaults, see referência de comando da CLI GitHub Copilot.

Further reading: