Repository navigation
Conversation
The diff knows what changed, never why, and the viewer has had a place for a note per hunk that nothing here ever filled. --explain sends the whole change to Claude in one request, hunks in story order with the commit messages of the range, and each hunk comes back with a group label and a sentence or two on what it does and how it leans on the others. The notes are pinned to the changed lines, not to hunk numbers, so they follow along when a wider context merges hunks or a narrower one splits them. It is off unless asked for, since it sends source code away, and a failed call still serves the scene with the reason in the header. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The diff says what changed but never why. The viewer already has a panel and a voice line for a note on each hunk, but until now only an outside host filled them in. This adds
--explain, which asks Claude for them.What it does
-- path. Each hunk comes back with a group label of two to five words and one or two plain sentences on what it does, why, and how it relates to the other hunks. The viewer shows these in the existing panel andvreads them aloud, so the viewer needed no changes.cwidens the context and merges hunks, the merged hunk reads the notes in order. When a narrower context splits a hunk, both halves keep its note.--jsonoutput stays clean.claude-opus-5with adaptive thinking, JSON-schema structured output, and the server-side fallback (fallbacks: "default"). If the model declines partway through, the answer is taken from the text after thefallbackblock.Dependency
@anthropic-ai/sdkbecomes the project's first dependency. It is loaded withrequireonly when--explainis given, so the rest of gitdiff3d still runs from a checkout that never rannpm install. Includespackage-lock.json.Testing
make checkpasses. The 7 new checks run offline against a fake client and cover these cases:--explainwithout credentials still prints valid JSON, and the error is inmeta.narrationError.gitdiff3d main...explain-hunks --explain.Not in this PR
--pr <n>flag that fetches a GitHub PR, diffs it the way GitHub does, and adds its title and description to the prompt.