PR Token Diff for GitHub par Jamison Lahman
Shows the estimated token difference of a GitHub pull request next to GitHub's line-count diffstat.
Métadonnées de l’extension
À propos de cette extension
Line counts don't tell you how much LLM context a pull request consumes. This extension adds an estimated token diff wherever GitHub shows its line-count diffstat.
━ What you get
• A header badge on every PR: +12,345 −6,789 tokens, right beside GitHub's own +/− line counts
• Per-file token badges in the Files changed view
• Hover any badge for the exact added/removed estimate
━ How it works
The extension fetches the PR's .diff through your existing GitHub session — no API token, no OAuth, works on private repos you can already see. The unified diff is parsed locally (renames, binaries, and mode changes handled) and token counts are estimated per file, then cached with ETag revalidation so repeat visits are instant.
Counts are a fast heuristic estimate (identifier sub-word splitting blended with a chars-per-token ratio), not an exact BPE tokenization — accurate enough to judge whether a PR fits in a model's context window.
━ Privacy
• No data collection, no analytics, no external services
• Talks only to github.com / patch-diff.githubusercontent.com
• Zero runtime dependencies
Source code: https://github.com/jmelahman/github-token-diff-extension
━ What you get
• A header badge on every PR: +12,345 −6,789 tokens, right beside GitHub's own +/− line counts
• Per-file token badges in the Files changed view
• Hover any badge for the exact added/removed estimate
━ How it works
The extension fetches the PR's .diff through your existing GitHub session — no API token, no OAuth, works on private repos you can already see. The unified diff is parsed locally (renames, binaries, and mode changes handled) and token counts are estimated per file, then cached with ETag revalidation so repeat visits are instant.
Counts are a fast heuristic estimate (identifier sub-word splitting blended with a chars-per-token ratio), not an exact BPE tokenization — accurate enough to judge whether a PR fits in a model's context window.
━ Privacy
• No data collection, no analytics, no external services
• Talks only to github.com / patch-diff.githubusercontent.com
• Zero runtime dependencies
Source code: https://github.com/jmelahman/github-token-diff-extension
Noté 0 par 1 personne
Autorisations et données
Autorisations nécessaires :
- Accéder à vos données pour github.com
Autorisations facultatives :
- Accéder à vos données pour github.com
- Accéder à vos données pour patch-diff.githubusercontent.com
Collecte de données :
- Le développeur indique que cette extension n’a pas besoin de collecter de données.
Plus d’informations
- Version
- 0.1.4
- Taille
- 20,05 Ko
- Dernière mise à jour
- il y a 17 jours (15 juil. 2026)
- Catégories associées
- Historique des versions
- Ajouter à la collection