GitHub Copilot
Copilot’s terminal, editor, and cloud coding agent histories are stored in different places. Import the CLI and editor sources together, and import coding agent sessions from GitHub when you want them.
Copilot Desktop, SDK runtimes, Remote Control, and GitHub-hosted Claude or Codex agents are separate surfaces. The routes below do not establish support for those histories; see the coverage reference.
Source IDs
Section titled “Source IDs”| Source | Use it for |
|---|---|
copilot-cli |
GitHub Copilot CLI session events and workspace details in ~/.copilot/session-state. |
copilot-ide |
Copilot Chat sessions from VS Code and other VS Code-family editors. |
copilot-agent-cloud |
Copilot coding agent sessions, read from GitHub. Runs when you ask for it or turn it on in Settings → Imports → Cloud agents. |
How the import works
Section titled “How the import works”For the Copilot CLI, Hansard reads each session’s event stream and its saved workspace state. For editor chat, it reads the Copilot chat records that VS Code-family editors keep in their workspace storage, in both the JSON format used through VS Code 1.108 and the log format used since 1.109. Each source rebuilds messages and any tool calls, edits, model, and usage in the order the tool wrote them, and adds only details that belong to the same session or workspace.
Current VS Code request token counts and response timestamps are supported. The importer rejects incomplete mutation logs and retries after the file is complete. Chat documents have a 128 MiB read limit. The previous archive remains available when a source cannot be read.
The editor route does not discover Copilot extension transcripts files,
VS Code agentSessionData databases, or JetBrains chat databases. JetBrains
CLI-backed sessions can use the CLI store, but this does not establish full
JetBrains coverage. AI credits, cache details, and per-model aggregate totals
remain raw evidence when the chat document records them.
The coding agent import reads your sessions from GitHub and joins each session’s prompt, transcript, premium request charge, repository, and pull request by session ID. Cost appears as premium requests rather than tokens, because that is how GitHub bills the coding agent. Each retry on the same pull request stays its own session. Tool arguments or usage that GitHub does not return stay empty. Importing again updates the same sessions.
Import and keep current
Section titled “Import and keep current”hansard import --sources copilot-cli,copilot-ide --since allhansard import copilot-agent-cloud --since allhansard index rebuildThe coding agent import uses a GitHub token from GH_TOKEN, GITHUB_TOKEN,
copilot.token in Hansard’s config, or the GitHub CLI’s saved sign-in. It
only reads from GitHub, and Hansard never stores the token. Without a token,
it prints setup instructions instead of failing.
With Automatic source selection, the watcher already includes
copilot-cli and copilot-ide. With a Custom list, enable them.
The watcher picks them up within 30 seconds:
hansard config sources enable copilot-cli,copilot-ideTo keep coding agent sessions current, turn on GitHub Copilot coding agent in Settings → Imports → Cloud agents. The watcher then refreshes it every six hours. Otherwise, run the command again when you want newer sessions.
Review the import in the app
Section titled “Review the import in the app”- When the import finishes, open Sessions and selectFilter & sort.
- Set Source to GitHub Copilot CLI, GitHub Copilot in VS Code, or GitHub Copilot coding agent and setTime to the window you imported. UseFolder to narrow the list when you use this harness in several projects.
- Select a conversation to check its messages, tool calls, files, commits, model, and token usage.
To keep archiving new sessions from a local harness, openSettings → Imports. Automaticfollows every supported harness installed on this computer.Custom lets you turn individual harnesses on or off. Cloud sources turn on separately under Cloud agents, and ChatGPT, Claude.ai, Gemini, and Gemini Notebook / NotebookLM exports import withImport export…. Each also has its own import command. If a conversation you expect is missing after you reset the filters, run the import command on this page again with --explain-skips where the source supports it.
What Hansard preserves
Section titled “What Hansard preserves”- CLI messages, tool calls, session events, model routing details, workspace data, related session files, tokens, premium request multipliers, and AI credits.
- CLI event IDs, native message IDs, originating-message relationships, and explicit zero counters. A nonzero shell exit is an error even when Copilot reports successful tool dispatch; both values remain available.
- Editor chat messages, thinking, tool activity, terminal commands, file edits, titles, timing, and diff statistics when the editor recorded them.
- Coding agent prompts, transcripts when available, the model, the premium request charge, and the pull request.
Known limitations
Section titled “Known limitations”- CLI and editor model attribution uses recorded response or request models. CLI model selections and the editor’s current composer selection remain separate from historical models. CLI effort comes from the reply or a chronological selection matching its recorded model; resume clears earlier effort.
- CLI usage from
session-store.dbreplaces overlapping shutdown totals. Missing and null counters remain unknown. The local synthetic CLI trial verifies the recorded counters, not hosted billing. - VS Code releases before 1.109 do not record token usage for each request.
- VS Code-family editors drop most tool arguments when they save chat. Terminal commands, confirmations, todo lists, and subagent calls keep more detail.
- The coding agent reports premium requests or AI credits instead of tokens, so its sessions have no token usage or spend.
- GitHub does not document the coding agent’s transcript endpoint. When a
transcript is unavailable, the session imports without it and shows a note.
To skip transcripts, set
imports.copilotAgentCloud.includeTranscriptstofalse. - Editor chats answered by a chat participant other than Copilot are not imported as Copilot sessions.
Refresh an existing archive
Section titled “Refresh an existing archive”Reimport to refresh CLI model attribution, message relationships, zero counters, shell exit status, and the preserved usage-ledger binding. Older enriched CLI archives without that binding require a reimport before rebuilding from raw.
hansard import --sources copilot-cli,copilot-ide --since allhansard import copilot-agent-cloud --since allhansard index rebuild