Copilot CLI stores the data from your CLI sessions locally on your machine, and by default syncs sessions to your GitHub account. This session data allows you to:
- Resume previous sessions and pick up right where you left off.
- Fork a session into a copy, or rewind a session to an earlier point in the conversation.
- Use the
/chronicleslash command to generate standup reports, get personalized tips, and receive suggestions for improving your.github/copilot-instructions.mdfile. - Ask Copilot questions about your past interactions.
This article explains how to use these features from Copilot CLI. For a deeper dive into how session data is stored and synced, see About GitHub Copilot session data. For querying your sessions from VS Code, see Managing agent sessions.
Resuming a previous session
You can resume a previous interactive CLI session either from the command line, or during an active session.
-
From the command line, run
copilot --continueto resume a recent session. Copilot chooses the most recent session from the same repository and branch as your current directory. If there isn't one, it looks for the most recent session from the same repository, and then from the same directory. If none of these exist, it resumes your most recent session.If you want to choose from a list of sessions, run
copilot --resumeto open the session picker. Alternatively, if you know the ID or name of the session you want to resume, you can jump straight into it. For example,copilot --resume SESSION-IDorcopilot --resume "Improve test coverage". You can use the first seven or more characters of a session ID instead of the full ID. Session names must match exactly, but they are not case-sensitive. -
During an interactive session, type
/resumeto switch to a different session. The session picker is displayed. Alternatively, you can enter/resume SESSION-IDto jump straight into a specific session.
Note
You can find the ID of the current interactive session by using the /session info slash command. When you exit an interactive session, the command for resuming it is displayed, for example copilot --resume=SESSION-ID.
When you resume a session, Copilot loads the full conversation history, so you can continue exactly where you left off.
Using the session picker
The session picker lists your sessions, showing the name of each session, its status, when it was last updated and created, and where it ran. In the picker you can:
- Use the up and down arrow keys to highlight a session, then press Enter to open it.
- Press /, then type some text to search for a session by name. Press Esc to stop searching.
- Press s to change the sort order.
- Use the left and right arrow keys to choose which sessions are listed. Local lists sessions stored on your machine. Remote lists sessions stored in your GitHub account, such as CLI sessions synced from other machines, and Copilot cloud agent sessions. All lists both.
- Press x to delete the highlighted session, if it isn't currently open. You are asked to confirm the deletion, which cannot be undone.
- Press Esc to close the picker.
Resuming a session that is in use
If you try to resume a session that appears to be in use by another CLI or application, Copilot warns you before opening it. Choose Go back, then close the other session before trying again. Alternatively, choose Resume anyway, but be aware that working in the same session in two places risks conflicting changes.
Renaming a session
When you use the --resume command line option, or the /resume slash command, your sessions are listed. The first column of the list shows the session name, which helps you to identify the session you want to resume. Copilot automatically names each session based on what you worked on. If you have a session you return to frequently you might want to give it a custom name to make it easier to find in the list.
To rename a session:
-
In an interactive session, if you want to rename a session other than the current session use the
/resumeslash command to switch to the session you want to rename. -
Type
/rename NEW_NAMEto rename the current session. You do not need to enclose the name in quotes.For example,
/rename Improve test coverage.If you type
/renamewithout a name, Copilot generates a new name for the session.
You can also name a session when you start it, by using the --name command line option. For example:
copilot --name "Improve test coverage"
copilot --name "Improve test coverage"
Viewing details of a session
To see details of the current session, type /session info. This shows the session's name and ID, its working directory, when it was created and last modified, and the changes, GitHub AI Credits, and tokens it has used so far.
You can also use these subcommands to see more about the current session:
/session checkpointslists the session's checkpoints. Checkpoints are created when the context of the conversation is compacted./session fileslists files that Copilot has saved for the session that are not part of your project, such as notes. It does not list your project's files./session planshows the session's plan, if it has one.
Starting a new session
To start a new session without leaving the CLI, use one of the following slash commands:
/newstarts a new session, and keeps the previous session running in the background. You can switch back to the previous session by using the session picker./clearcloses the current session and starts a new one. The previous session is still saved, so you can resume it later.
Forking a session
Forking creates a copy of the current session, including its conversation history, and switches you to the copy. The original session is still available in the session picker. This is useful if you want to try a different approach without changing the original session.
To fork the current session, type /fork. You can add a name for the new session, for example:
/fork Try a different approach
/fork Try a different approach
Rewinding a session
You can rewind a session to an earlier point in the conversation. You can choose to rewind the conversation only, or to also restore files that Copilot changed.
Warning
You cannot undo a rewind. The turns after the point you rewind to are removed from the session. If you want to keep a copy of the full conversation, use /fork before you rewind.
-
In an interactive session, type
/rewindor/undo. Alternatively, when the prompt is empty, press Esc twice in quick succession. -
Choose the prompt you want to rewind to, then press Enter.
-
Choose one of the following options:
- Conversation only: Removes the conversation from the prompt you chose onward. Your files are left unchanged.
- Conversation + files: Removes the conversation from the prompt you chose onward, and restores the files that Copilot changed. Any file that you have edited since Copilot last changed it is skipped, so your own edits aren't overwritten.
After the rewind, the prompt you chose is placed back in the input area, so you can edit it and send it again.
For more information, including which file changes can't be restored, see Canceling operations and rolling back changes in GitHub Copilot CLI.
Sharing a session
You can share the content of the current session as a shareable link to the session on GitHub.com, a Markdown file, an interactive HTML file, or a secret gist on GitHub.com. This allows you to share your prompts and Copilot's responses with others, or store a record of your work outside of the CLI.
Note
You can use /export as an alias for /share in any of the commands below.
Typing /share with no arguments opens a full-screen sharing menu where you can choose how to share the session. The menu also shows whether account history sync and remote control are turned on for the session, and lets you continue the session in the GitHub Copilot app or delegate it to Copilot cloud agent. Opening this menu does not itself share or export anything.
To share the session to GitHub and print a shareable link directly, type the following in an interactive session:
/share link
/share link
The session must already be synced to your GitHub account. If it isn't, an error message is displayed instead of a link. See Controlling session syncing.
To stop sharing the session, type /share off.
To share a session as a secret gist, type:
/share gist
/share gist
Anyone with the link to a secret gist can read it.
To export the session conversation as a Markdown file, type:
/share file [PATH-TO-FILE]
/share file [PATH-TO-FILE]
If you don't specify a file path, the Markdown file is saved in the current working directory with the name copilot-session-SESSIONID.md.
Note
Gists are not available to Enterprise Managed Users, or if you use GitHub Enterprise Cloud with data residency (*.ghe.com).
To export the session as an interactive HTML file, type:
/share html [PATH-TO-FILE]
/share html [PATH-TO-FILE]
As with Markdown export, if you don't specify a file path the file is saved in the current working directory, with the name copilot-session-SESSIONID.html.
If you have used the /research slash command in the current session, you can also use the /share command to share a research report. For more information, see Researching with GitHub Copilot CLI.
Sharing a session when you use programmatic mode
When you run Copilot CLI with the -p command line option, you can add the --share option to save the session as a Markdown file when Copilot finishes. By default the file is saved in the current working directory, with the name copilot-session-SESSIONID.md. To save it somewhere else, specify a path. For example:
copilot -p "Summarize the open TODOs in this repository" --share=./todo-summary.md
copilot -p "Summarize the open TODOs in this repository" --share=./todo-summary.md
To share the session as a secret gist instead, use the --share-gist option.
Controlling session syncing
Syncing uploads your session's conversation history to your GitHub account. Syncing does not share the session with other people, and it does not allow anyone to control the session remotely.
To turn syncing off for a single run of the CLI, start it with the --sync-session=off command line option. To turn it on for a single run, use --sync-session=on. To change the default, see remoteExport in GitHub Copilot CLI configuration directory.
Turning syncing off does not delete a copy of the session that has already been uploaded to your account.
Using the /chronicle slash command
The /chronicle slash command provides a set of subcommands that generate specific types of insights from your session history. While you can ask Copilot free-form questions about your sessions at any time, /chronicle subcommands provide a quick way to get specific insights.
When you type /chronicle without arguments, a picker is displayed that lets you choose from the available subcommands:
| Subcommand | Description |
|---|---|
standup | Generate a standup report from your recent work. |
tips | Get personalized tips based on your usage patterns. |
cost-tips | Get feedback on your token spend and suggestions for reducing costs. |
search | Search your session history for specific topics or keywords. |
improve | Suggest improvements to your Copilot custom instructions file. |
reindex | Rebuild the local session store from your session history, and sync session data to your account. |
You can also invoke a subcommand directly, without using the picker—for example, /chronicle standup.
/chronicle standup
This generates a short report based on your Copilot CLI sessions from the last 24 hours. Copilot looks at which branches you worked on, what you accomplished, and any GitHub pull requests or issues you referenced. It groups the output by completion status, with each item labeled by its branch, and checks the current status of any linked pull requests.
Example standup summary
Standup for March 13 2026:
✅ Done
myapp-repo repo maintenance (main branch)
- Synced local, cleaned files, audited deps, reviewed architecture
- Session: 69a027e4-9b7b-493e-922e-107acd25abab
🚧 In Progress
MyApp configuration (suppress-start-message branch, myapp-repo)
- Suppressing startup init prompt message
- Session: 3034d813-3e1f-413a-b3d9-15427ef8c19c
You can add text after /chronicle standup to give Copilot additional context for the report.
/chronicle tips
This analyzes your recent sessions to understand how you work and how you use Copilot CLI. It then provides 3–5 personalized recommendations. Copilot examines your actual prompts, the tools you use, and the features you haven't tried yet. It cross-references this with the full set of available CLI features—including any custom agents and skills you've set up in the repository—to find opportunities you might be missing.
Tips are grounded in your real usage data, giving you specific suggestions rather than generic advice.
Example tips
The following is an example of the main points from a /chronicle tips response. In an actual response, each point is explained in more detail.
1. Use @ to mention files instead of pasting content
2. Iterate within a session — don't start over
3. Try /research for your exploration work
4. Turn recurring prompts into a custom agent
5. Use plan mode for multi-step work
You can focus the tips on a specific area by appending context after /chronicle tips. For example:
/chronicle tips for better prompting
/chronicle tips for better prompting
/chronicle cost-tips
This analyzes your token usage across recent sessions to show where tokens are being spent and suggests ways to reduce costs. Copilot looks at patterns like prompt length, tool call frequency, and continuation steps to identify opportunities for more efficient usage.
/chronicle cost-tips
/chronicle cost-tips
/chronicle search
This searches all of your session content (not just summaries) for specific keywords or topics. You must include a search term after the subcommand. For example:
/chronicle search authentication
/chronicle search authentication
/chronicle improve
This does a deep dive into your session history to find places where Copilot struggled to provide the kind of response or results you were looking for, or where you had to course-correct by providing follow-up prompts. On the basis of this research, it suggests improvements to your .github/copilot-instructions.md custom instructions file.
Capturing project-specific knowledge as custom instructions is a powerful way to improve Copilot's performance when working on your project. For more information, see Adding custom instructions for GitHub Copilot CLI.
Note
Unlike other times Copilot uses your session data to answer questions or generate insights, the scope of the improve subcommand is limited to data for the current repository or working directory. This ensures the recommendations are relevant to the project you're currently working on.
Copilot looks for friction signals—repeated test failures, build errors that required multiple attempts, user messages that corrected or redirected the agent, and patterns that recur across sessions. It then presents 3–5 specific recommendations, each explaining the problem it found and the instruction that would address it.
For example, Copilot might find that it repeatedly tried to use jest for your project that uses vitest, or that it kept generating imports in a style that doesn't match your codebase conventions. The suggested instructions would prevent these mistakes in future sessions.
After presenting its recommendations, Copilot asks which ones you'd like to apply. Copilot then creates or updates the .github/copilot-instructions.md file.
Asking questions about your session history
You don't need to use a slash command to take advantage of your session history. If Copilot determines that you are asking about your use of the CLI it will automatically use the session store to provide the context for a response.
Note
By default, the answers to questions about your interactions with Copilot CLI are based on all of your recorded sessions, irrespective of the repository or branch you are currently working in.
Here are some examples of the kinds of questions you might ask:
Insights about tasks
Using what you know about my sessions, what type of tasks give me one-shot successes and which do I have to iterate on most?
Using what you know about my sessions, what type of tasks give me one-shot successes and which do I have to iterate on most?
Copilot will analyze your conversations, looking for times when an initial response was not followed by related prompts, and times when there was a series of iterative prompts and responses.
Reduce GitHub AI Credits usage
Based on my previous CLI sessions, how could I prompt you in a way that would cost less?
Based on my previous CLI sessions, how could I prompt you in a way that would cost less?
Copilot will look at your session patterns—prompt length, number of continuation steps, and tool call frequency—and suggest ways to achieve the same results with fewer interactions.
Find your most productive times
Look at data for previous sessions. What time of day am I most and least effective at getting good results from Copilot?
Look at data for previous sessions. What time of day am I most and least effective at getting good results from Copilot?
Copilot will query session timestamps and outcomes to identify when your interactions tend to be most efficient.
Recall past work
Have I worked on anything related to authentication in the last month?
Have I worked on anything related to authentication in the last month?
Copilot uses full-text search across your session history to find relevant sessions, then summarizes what you did.
Deleting sessions
The simplest way to delete sessions is to use the /session slash command in an interactive CLI session.
/session deletedeletes the current session and starts a new one in its place./session delete SESSION-IDdeletes a specific session. This shows a preview first; add--yesto confirm, for example/session delete SESSION-ID --yes./session delete-alldeletes all of your local sessions except the current one. Without--yes, this only shows a preview of what would be deleted. Add--yesto confirm:/session delete-all --yes. Sessions that are in use by another process are skipped./session prune --older-than DAYSdeletes sessions older than the specified number of days. Add--dry-runto preview what would be deleted. Sessions that you have named are skipped. To include them, add--include-named./session cleanupshows a storage summary of your other local sessions, grouped by age, and suggests commands for deleting old sessions. It does not delete local or synced sessions. Use/session prune --older-than DAYS --dry-runto preview deletions, then remove--dry-runto delete those local sessions.
You can also delete a session from the session picker. Highlight a session that isn't currently open, press x, then choose Delete. See Using the session picker.
When you delete a session that has been synced to your account, /session delete asks whether you also want to delete the synced (remote) copy. Deleting the synced copy also removes the session from your /chronicle insights and query results. The /session delete-all and /session prune subcommands only affect local sessions and do not delete synced data. To remove synced data for those sessions, manually delete it from GitHub.com.
For the full list of /session subcommands, see GitHub Copilot CLI command reference.
Deleting session data manually
- Local data: To remove data for a particular CLI session locally, delete the relevant session directory from
~/.copilot/session-state/. To clear all local session data, delete everything under~/.copilot/session-state/. Deleting session directories manually does not remove those sessions from the session store (~/.copilot/session-store.db), even if you reindex the session store afterward. This means the sessions can still appear in/chroniclereports and in answers to questions about your session history. To remove sessions from the session store as well, use the/sessionslash commands. Deleting local files does not affect session data that has been synced to your account. You cannot delete synced data locally. - Synced data: You can delete or hide synced CLI sessions from GitHub.com. Hiding a session removes it from your session index so it no longer appears in query results. Deleting a session removes it from your session list on GitHub.com. Deletion applies to sessions from Copilot CLI, VS Code, and the GitHub Copilot app.
Reindexing the session store
The session store is populated incrementally during a CLI session. Data for a session is written to disk in a session-specific subdirectory of ~/.copilot/session-state/. This also happens periodically during a session, and also when the session ends.
You can reindex the session store from the session files on disk. Reindexing also syncs your session data to your account.
Situations where you might need to reindex include:
- Indexing old sessions: If you have old session files on disk that were created before the session store existed, reindexing will populate the session store with data from those sessions.
- Session deletion: To delete a session from your history, use the
/session delete,/session delete-all, or/session pruneslash commands. For a synced session,/session deletecan also remove the synced copy, which removes the session from your/chronicleinsights. - Migrating/recovering sessions: If you moved your session files to another machine, or restored them from a backup, without also moving/restoring the session store file (
~/.copilot/session-store.db), you can use the reindex command to recreate the session store. - File corruption: If the session store file (
~/.copilot/session-store.db) becomes corrupted, or is accidentally deleted, you can recover the session store from the session files. - Unexpected termination: If a session terminates unexpectedly (for example, due to a crash or power loss) before data held in memory has been flushed to the session store you may be able to populate the session store with the missing data if it was written to disk, in the session files, prior to the termination.
To reindex the session store, use the following slash command in an interactive CLI session:
/chronicle reindex
/chronicle reindex
Reindexing runs in the background. When it finishes, a summary is displayed in the session.
Reindexing does not remove sessions whose directories you have deleted manually.