copilot-log-analysis

Parse Copilot session logs to extract token and model usage data.

100|30|Updated Sep 26, 2025
One-click install
npx skills add https://github.com/rajbos/github-copilot-token-usage --skill copilot-log-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: copilot-log-analysis
Source: https://github.com/rajbos/github-copilot-token-usage/tree/main/.github/skills/copilot-log-analysis
Command: npx skills add https://github.com/rajbos/github-copilot-token-usage --skill copilot-log-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyzing GitHub Copilot session logs to extract token usage, model information, and interaction data. Use when debugging token tracking issues or understanding extension log analysis methods.

Core Features & Use Cases

  • Parses Copilot session data from both .json (VS Code Chat sessions) and .jsonl (Copilot CLI) formats
  • Extracts tokens, models, and interactions to provide actionable usage insights
  • Supports cross-variant discovery across VS Code installations and remote/server locations

Quick Start

Run the included scripts to discover Copilot session files and analyze their structure.

Frequently Asked Questions about copilot-log-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract token usage from GitHub Copilot session logs?

To extract token usage from Copilot session logs, you parse .json and .jsonl files to estimate tokens, detect models, and aggregate daily or monthly interaction data for diagnostics.

Can I analyze Copilot CLI logs stored in .jsonl format?

Yes, Copilot CLI logs in .jsonl format are fully supported. The analysis parses these session files alongside VS Code .json chat sessions to provide a unified view of token estimation and model detection.

What is the best way to aggregate daily token usage across multiple VS Code installations?

The best way to aggregate daily token usage across VS Code variants is to discover session files in remote and local locations, parse them, and generate unified schema data for monthly and daily diagnostics.

How does Copilot log analysis detect which models were used during a session?

Copilot log analysis detects used models by parsing interaction data within session files. It inspects the internal structure of .json and .jsonl logs to identify model information and extract actionable usage insights.

Do I need to manually locate Copilot session files before running diagnostics?

No, you do not need to manually locate Copilot session files. The analysis includes scripts to automatically discover session files across VS Code installations and Copilot CLI locations before parsing their structure.

Why are my Copilot token tracking numbers not matching my actual usage?

Token tracking mismatches often occur when session logs are incomplete or uncached. Applying structured log analysis to .json and .jsonl files helps estimate tokens accurately and caches results for reliable diagnostics.