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.

AI Workflows & Technical Writing Local processing Your code stays in your browser. Nothing is uploaded.

Tool interface

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

  1. Parses file headers and hunks from the unified diff.
  2. Keeps changed lines plus N configurable context lines (merging overlaps).
  3. Flags changed function signatures.
  4. 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 diff output).
  • 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.

Related tools

Version and changelog

  • Version: 1.0.0
  • Last updated: August 12, 2026
  • Changelog: Initial production release.