-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Add session insights and session sync documentation #9833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| ContentId: a3f7d8e2-5c4b-49a1-b6d3-7e8f9a2c1d4b | ||
| DateApproved: | ||
| MetaDescription: Use chronicle commands in VS Code to generate standup reports, get personalized tips, and query your Copilot session history with natural language. | ||
| MetaSocialImage: ../images/shared/github-copilot-social.png | ||
| --- | ||
| # Query session history with chronicle | ||
|
|
||
| Your GitHub Copilot sessions build a searchable history of everything you work on. Ask natural language questions about past sessions, generate standup reports, get personalized tips, and search your coding history. With [session sync](/docs/copilot/chat/session-sync.md) active by default, queries draw from sessions across Copilot CLI, coding agent, code review, and VS Code. | ||
|
|
||
| ## Chronicle commands | ||
|
|
||
| Use these commands in the chat input to query your session history: | ||
|
|
||
| | Command | Description | | ||
| |---------|-------------| | ||
| | `/chronicle:standup` | Summarize recent coding sessions into a standup report, grouped by branch and repository. Covers the last 24 hours by default. Includes files edited, PRs or issues referenced, and whether work is done or in progress. | | ||
| | `/chronicle:tips` | Analyze your recent session history (typically 7 days) and suggest ways to use Copilot more effectively. Tips are grounded in your actual usage patterns: tools you rarely use, prompting patterns that lead to better results, or workflow improvements. | | ||
| | `/chronicle:cost-tips` | Analyze recent sessions to identify opportunities to reduce token usage and Copilot cost. | | ||
| | `/chronicle:search <query>` | Search sessions by keyword, file path, or PR or issue reference. Uses full-text indexing across session summaries, conversation turns, file paths, and checkpoint notes. Results include session IDs and timestamps so you can resume relevant sessions. | | ||
| | `/chronicle:reindex` | Rebuild the local session index and sync session data to your account. | | ||
|
|
||
| ## Free-form questions | ||
|
|
||
| You can also ask free-form questions about your session history directly in chat. For example, type "What files did I edit yesterday?" or "Have I worked on anything related to the payments API?" and Copilot searches your synced session history to answer. Unlike `/chronicle:search` which performs a direct content search, free-form questions use semantic understanding to find relevant sessions. | ||
|
|
||
| ## What gets tracked | ||
|
|
||
| For each chat session, the local session store records: | ||
|
|
||
| * **Session metadata**: repository, branch, working directory, timestamps, and the agent or participant used. | ||
| * **Conversation turns**: user messages (up to 1,000 characters) and assistant responses (up to 5,000 characters). | ||
| * **Files touched**: file paths from tool calls such as `replace_string_in_file`, `create_file`, `read_file`, and `apply_patch`. | ||
| * **External references**: PR numbers, issue numbers, and commit SHAs extracted from GitHub MCP tool calls and terminal commands. | ||
|
|
||
| Data is stored in a local SQLite database. Secrets such as tokens, API keys, passwords, and connection strings are automatically filtered before data is synced to the cloud. | ||
|
|
||
| ## Reindex the session store | ||
|
|
||
| If sessions appear missing or the database becomes corrupted, rebuild the index. Reindexing also syncs your session data to your account. | ||
|
|
||
| ```prompt | ||
| /chronicle:reindex | ||
| ``` | ||
|
|
||
| You can also run the **Reindex Sessions** command (`github.copilot.chronicle.reindex`) from the Command Palette. | ||
|
|
||
| Situations where reindexing helps: | ||
|
|
||
| * After restoring session files from a backup | ||
| * After an unexpected crash that prevented data from flushing to the store | ||
| * After manually deleting session directories | ||
| * After opting back into session sync | ||
|
|
||
| ## Related content | ||
|
|
||
| * [Session sync](/docs/copilot/chat/session-sync.md) - Sync sessions to your GitHub account for cross-device access | ||
| * [Manage chat sessions](/docs/copilot/chat/chat-sessions.md) - Create and organize chat sessions | ||
| * [Settings reference](/docs/copilot/reference/copilot-settings.md) - All Copilot settings | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| --- | ||
| ContentId: b4e8c9f3-6d5a-4b2e-c7a4-8f9e1b3d2c5a | ||
| DateApproved: | ||
| MetaDescription: Sync your Copilot chat sessions to GitHub for cross-device access, enterprise policy controls, and sharing with teammates. | ||
| MetaSocialImage: ../images/shared/github-copilot-social.png | ||
| --- | ||
| # Sync Copilot sessions to GitHub | ||
|
|
||
| By default, VS Code syncs your GitHub Copilot chat sessions to your GitHub account, including all local agent sessions. Synced sessions are private to you and are not visible to anyone else unless you explicitly share them. They appear on GitHub.com in the **Agents** tab of your repository, enabling [session insights](/docs/copilot/chat/session-insights.md) to query across all your sessions, including those from Copilot CLI, coding agent, code review, and the GitHub Copilot Desktop app. | ||
|
|
||
| ## Opt out of session sync | ||
|
|
||
| To keep session data local only, set `setting(chat.sessionSync.enabled)` to `false`. When you opt out, session data stays on your machine and you can only query it locally. | ||
|
|
||
| ## Exclude repositories from sync | ||
|
|
||
| Use `setting(chat.sessionSync.excludeRepositories)` to prevent sessions in specific repositories from syncing to the cloud. The setting accepts exact `owner/repo` names or glob patterns: | ||
|
|
||
| ```json | ||
| "chat.sessionSync.excludeRepositories": [ | ||
| "my-org/private-repo", | ||
| "my-org/secret-*" | ||
| ] | ||
| ``` | ||
|
|
||
| Sessions from matching repositories are stored locally only. | ||
|
|
||
| ## Enterprise policy | ||
|
|
||
| For Copilot Business and Copilot Enterprise users, two policies control session sync: | ||
|
|
||
| * **GitHub.com enterprise policy** ("Store local sessions in the Cloud"): enterprise and organization owners configure this on GitHub.com to enable or disable cloud sync for their users. | ||
| * **VS Code group policy** (`CopilotSessionSync`): when disabled, the `setting(chat.sessionSync.enabled)` setting is forced to `false` and sessions stay local only. | ||
|
|
||
| > [!IMPORTANT] | ||
| > Enabling the policy does not give administrators access to your session data. Synced sessions are tied to your personal account and are accessible only to you by default. | ||
|
|
||
| When disabled by policy, the session sync status shows **Disabled by policy** and users cannot override the setting. | ||
|
|
||
| ## Share a session | ||
|
|
||
| Sessions are not shared by default. On GitHub.com, you can share a synced session for view-only access to anyone who has access to the repository: | ||
|
|
||
| 1. Open the **Agents** tab on GitHub.com. | ||
| 2. Select a session and open **Sharing settings** from the `...` menu. | ||
| 3. Enable sharing to give repository collaborators view-only access. | ||
|
|
||
| Recipients can view the session's prompts, responses, and file changes, but cannot steer or modify the session. Shared sessions are not indexed for other users' session queries. | ||
|
|
||
| ## Session sync status | ||
|
|
||
| The session sync status appears in the Copilot status bar in the Chat view. It shows the current state of cloud sync: | ||
|
|
||
| | State | Description | | ||
| |-------|-------------| | ||
| | **Not enabled** | Session sync is off. Data stays local to this device. | | ||
| | **Enabled** | Sessions are syncing to your GitHub account. | | ||
| | **N sessions synced** | Shows how many sessions have been uploaded. Select to view sessions on GitHub.com. | | ||
| | **Syncing N sessions** | Upload is in progress. | | ||
| | **Disabled by policy** | Your organization's policy prevents session sync. | | ||
| | **Sync error** | Something went wrong during the last sync. Try again later. | | ||
|
|
||
| ## Privacy and data control | ||
|
|
||
| * Sessions are private to you by default. Synced sessions are tied to your personal GitHub account and are accessible only to you unless you explicitly share them. | ||
| * Secrets such as tokens, API keys, and credentials are automatically stripped before data leaves your machine. | ||
| * You can opt out at any time by setting `setting(chat.sessionSync.enabled)` to `false`. Existing synced sessions remain on GitHub.com until you delete them. | ||
|
|
||
| ## Delete synced sessions | ||
|
|
||
| To delete synced session data, run the **Delete Session Sync Data** command (`github.copilot.sessionSync.deleteSessions`) from the Command Palette. The command shows a picker where you select which sessions to remove. After selecting sessions, you choose the deletion scope: | ||
|
|
||
| * **Delete from local and cloud**: removes session data from your machine and from GitHub.com. This action cannot be undone. | ||
| * **Delete from cloud only**: removes session data from GitHub.com but keeps local data intact. | ||
|
|
||
| You can also hide or delete individual synced sessions from the **Agents** tab on GitHub.com. Hiding a session removes it from your session index so it no longer appears in query results. | ||
|
|
||
| ## Settings reference | ||
|
|
||
| | Setting | Default | Description | | ||
| |---------|---------|-------------| | ||
| | `setting(github.copilot.chat.localIndex.enabled)` | `true` | Enable local session tracking (prerequisite for sync) | | ||
| | `setting(chat.sessionSync.enabled)` | `true` | Sync sessions to your GitHub account | | ||
| | `setting(chat.sessionSync.excludeRepositories)` | `[]` | Repository patterns to exclude from sync | | ||
|
|
||
| ## Related content | ||
|
|
||
| * [Session insights](/docs/copilot/chat/session-insights.md) - Query your session history for standup reports, tips, and search | ||
| * [Manage chat sessions](/docs/copilot/chat/chat-sessions.md) - Create and organize chat sessions | ||
| * [Security](/docs/copilot/security.md) - Copilot security and privacy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.