Git Diff Token Counter
Paste a git diff to see per-file token breakdown, cost estimates, and chunking suggestions.
What This Tool Does
Git Diff Token Counter is built for deterministic developer and agent workflows.
Paste a git diff and see token counts per file, cost across AI models, and chunking suggestions when diffs exceed context limits.
Use How to Use for execution steps and FAQ for constraints, policies, and edge cases.
Last updated:
This tool is provided as-is for convenience. Output should be verified before use in any production or critical context.
Agent Invocation
Best Path For Builders
Browser workflow
Runs instantly in the browser with private local processing and copy/export-ready output.
Browser Workflow
This tool is optimized for instant in-browser execution with local data handling. Run it here and copy/export the output directly.
/git-diff-token-counter/
For automation planning, fetch the canonical contract at /api/tool/git-diff-token-counter.json.
How to Use Git Diff Token Counter
- 1
Paste your git diff
Run git diff in your terminal and paste the output. The tool parses unified diff format and extracts per-file changes.
- 2
Review per-file breakdown
See each modified file with its addition and deletion counts, token count, and percentage of the total diff. Files are sorted by token count.
- 3
Check model costs
The cost table shows what it would cost to send this diff to various AI models for code review, with context-fit indicators showing which models can handle the full diff.
- 4
Apply chunking suggestions
If your diff exceeds any model's context window, the tool suggests how to split files into groups that each fit within the limit for multi-pass review.