Skip to content

Git Diff Token Counter

Tokens
0
Files
0
Added
+0
Removed
-0

Paste a git diff to see per-file token breakdown, cost estimates, and chunking suggestions.

What This Tool Does

Paste a git diff into the Git Diff Token Counter to see token counts per file and the estimated cost of an AI code review across GPT, Claude, and other models. When a diff is larger than a model's context window, it suggests where to chunk it so large reviews still fit. It runs privately in your browser.

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. 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. 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. 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. 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.

Frequently Asked Questions

What is Git Diff Token Counter?
Git Diff Token Counter parses unified diff format, shows token counts per file, calculates the cost of sending the diff to various AI models for code review, and suggests chunking strategies when diffs exceed context limits.
How accurate are the token estimates?
Token counts use a chars/4 heuristic that closely approximates most tokenizers. For exact counts, use a model-specific tokenizer, but this estimate is reliable for cost planning.
Does it send my code diffs to a server?
No. All parsing happens entirely in your browser. Your code changes never leave your device.
What is chunking and when do I need it?
When a diff exceeds a model's context window, the tool suggests splitting files into groups that each fit within the limit. This lets you send the diff for AI review in multiple passes.