Diff-to-Prompt Context Builder
Pasting a whole git diff into an LLM wastes tokens and buries the signal.
This tool parses the diff, keeps only changed hunks plus the context you choose, and
builds a ready-to-paste code-review prompt — with a token estimate and savings metric.
Tool interface
Result
Extracted changes
Introduction
Code-review prompts work best when they contain exactly the changed code plus a little surrounding context. This tool automates that extraction from any unified diff and formats it for the model.
How it works
- Parses file headers and hunks from the unified diff.
- Keeps changed lines plus N configurable context lines (merging overlaps).
- Flags changed function signatures.
- Assembles a review prompt with your chosen focus and estimates tokens.
Privacy
All parsing is local. No upload, no account, no API key. Important for proprietary code.
Limitations
- Requires unified diff format (standard
git diffoutput). - Function detection is signature-based, not full AST.
FAQ
How are tokens estimated?
Roughly characters ÷ 4, consistent with common LLM tokenization. Use a dedicated tokenizer for exact counts.
Is my code uploaded?
No. Everything runs in your browser.