PR Token Diff for GitHub von Jamison Lahman
Shows the estimated token difference of a GitHub pull request next to GitHub's line-count diffstat.
Metadaten zur Erweiterung
Über diese Erweiterung
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
Bewertet mit 0 von 0 Bewertern
Berechtigungen und Daten
Benötigte Berechtigungen:
- Auf Ihre Daten für github.com zugreifen
Optionale Berechtigungen:
- Auf Ihre Daten für github.com zugreifen
- Auf Ihre Daten für patch-diff.githubusercontent.com zugreifen
Datenerfassung:
- Der Entwickler sagt, dass diese Erweiterung keine Datenerhebung benötigt.
Weitere Informationen
- Add-on-Links
- Version
- 0.1.4
- Größe
- 20,05 KB
- Zuletzt aktualisiert
- vor 8 Tagen (15. Juli 2026)
- Verwandte Kategorien
- Versionsgeschichte
- Zur Sammlung hinzufügen