--- title: GitHub Copilot description: How ClawMetry observes GitHub Copilot — where its data lives, the environment variables that move it, what cost data is real, and the traps in its store. eyebrow: Runtime reference --- # GitHub Copilot Copilot CLI keeps a full event log per session plus a SQLite usage ledger. Because Copilot bills in AI credits and the ledger records them exactly, cost here is vendor-billed truth rather than a per-token estimate. With the Pro extension 0.7.28 or later, Copilot Chat conversations in VS Code and VS Code Insiders are read too, as the same runtime with the surface `vscode`. | | | |---|---| | **Runtime id** | `copilot` | | **Category** | Terminal coding agent | | **Vendor** | GitHub | | **Tier** | Paid tier (Starter and up) | | **Upstream** | [github.com/features/copilot](https://github.com/features/copilot) | ## Where the data comes from ClawMetry reads these locations, in order, and never writes to any of them. - `~/.copilot/session-state//events.jsonl -- full event log` - `~/.copilot/session-state//workspace.yaml -- session metadata` - `~/.copilot/session-store.db -- SQLite index and usage ledger` - `/workspaceStorage//chatSessions/.jsonl -- VS Code Copilot Chat, a window with a folder open (Pro 0.7.28+)` - `/globalStorage/emptyWindowChatSessions/.jsonl -- VS Code Copilot Chat, a window with nothing open (Pro 0.7.28+)` **Format.** JSONL events (`{type, data, id, timestamp, parentId}`) plus a WAL-mode SQLite index. ## Environment variables | Variable | Effect | |---|---| | `CLAWMETRY_COPILOT_HOME` | home override | | `CLAWMETRY_COPILOT_VSCODE_USER_DIRS` | replaces the VS Code user directories searched, separated by the OS path separator | See [Environment variables](/docs/config/environment/) for the variables that apply to every runtime. ## Tokens and cost **Tokens.** Real, from the `assistant_usage_events` ledger, with input, output, cache read, cache write and reasoning splits. **Cost.** Vendor-billed: `total_nano_aiu` is the CLI's displayed credits times 1e9, and one credit is one US cent. :::note Why this section exists Runtimes differ enormously in what they persist. Rather than showing a plausible number everywhere, ClawMetry reports what the store actually contains and marks the rest unknown. A cost of `$0.00` and a cost of *unknown* mean different things, and the dashboard keeps them different. ::: ## Sub-agents and delegation Custom agents run inside the parent session -- no child transcript is ever written. ClawMetry synthesises a child session per `subagent.started`, and the ledger's `initiator='sub-agent'` rows split child spend out of the parent rather than double-counting it. ## Things worth knowing - `input_tokens` in the ledger already includes cache reads and `output_tokens` already includes reasoning tokens. ClawMetry reports uncached input plus a separate cache split so the UI does not double-count. - VS Code Copilot Chat (Pro 0.7.28+). The VS Code user directory is `~/Library/Application Support/Code/User` on macOS, `$XDG_CONFIG_HOME/Code/User` (default `~/.config`) on Linux and `%APPDATA%\Code\User` on Windows; Insiders uses `Code - Insiders`. Only sessions answered by the GitHub Copilot Chat extension with at least one request are counted. Tokens come from the request's prompt and completion counts. Cost is the session's Copilot credits when VS Code records them, otherwise the sum of per-turn credits marked as a lower bound, otherwise unknown, never estimated; one credit is one US cent. VS Code stores no system prompt. JetBrains and browser Copilot Chat are not read. - VS Code Copilot Chat sessions share the editor's process, so Guard refuses Pause, Stop and Kill on them (clawmetry 0.12.877 or later). - GitHub organization Copilot usage (Pro 0.7.28+) is a separate, opt-in operator command, `python -m clawmetry_pro.copilot_org_metrics`, with a token you supply. It stores GitHub's organization and per-user metrics reports and AI-credit billing usage reports as consumption figures, never joined to local sessions and not an invoice. ## Verify it is being read ```bash # Is this runtime detected, and would this install unlock it? clawmetry runtimes --json | jq '.runtimes[] | select(.id=="copilot")' # Why is it locked, if it is? clawmetry runtimes --why copilot # Any sessions ingested yet? curl -s 'http://localhost:8900/api/local/sessions?limit=5' \ | jq '.rows[] | {session_id, agent_id, events, cost_usd}' ``` If detection succeeds but no sessions appear, work through [Troubleshooting](/docs/ops/troubleshooting/) — the usual causes are a relocated data directory (set the override above), a session limit that is hiding older runs, or a runtime that simply has not written anything yet.