{"slug": "diffreview-code-review-for-local-claude-diffs", "title": "Diffreview – code review for local Claude diffs", "summary": "A native macOS tool called diffreview has been released to let developers review local git diffs GitHub-PR style and print the resulting comments to stdout as markdown for Claude Code or any other markdown-reading tool. Running `diffreview` in a git repository opens a window showing uncommitted changes (`git diff HEAD` plus untracked files), while `diffreview --base main` compares committed work only over `merge-base..HEAD`; submitting a review exits with code 0, closing without submitting exits 1, and bad arguments or a non-git directory exit 2. Drafts autosave to `.git/diffreview/comments.json`, and the repo ships a `/diffreview` Claude Code command that aborts if the review is cancelled, with the README warning that Claude Code's 2-minute Bash timeout must be raised via `BASH_DEFAULT_TIMEOUT_MS` and `BASH_MAX_TIMEOUT_MS` in `~/.claude/settings.json` for longer reviews.", "body_md": "A native macOS tool for reviewing local code changes GitHub-PR style, built to\nsend that review back to [Claude Code](https://claude.com/claude-code) (or anything\nelse that reads markdown).\n\nRun `diffreview` in a git repository and a window opens with the diff. Leave inline\ncomments on lines or ranges, file-level comments and an overall summary, then click\n**Submit review**. The review is printed to stdout as markdown and the process exits.\n\n- macOS 14 or later\n- Swift 6 toolchain (Xcode or the Command Line Tools)\n- `git` on your`PATH`\n\n```\ngit clone <this repo> diffreview && cd diffreview\nswift build -c release\ninstall -m 755 .build/release/diffreview ~/.local/bin/diffreview   # or any directory on your PATH\ndiffreview                 # uncommitted changes: `git diff HEAD` plus untracked files\ndiffreview --base main     # commits on the current branch since its merge-base with main\ndiffreview --help\n```\n\n| Result | stdout | exit code | \n|---|---|---|\n| Submit review | the review as markdown | 0 | \n| Close window / quit without submitting | nothing | 1 | \n| No changes to review | nothing (message on stderr) | 1 | \n| Not a git repository, unknown ref, bad arguments | nothing (message on stderr) | 2 | \n\n`--base` compares committed work only (`merge-base..HEAD`), like a pull request.\nUncommitted changes are not included in that mode.\n\n- **Click a line** to comment on it.**Shift-click** another line in the same file to extend the comment to a range.\n- **⌘↩** adds the comment,**Esc** cancels. Existing comments can be edited or deleted.\n- **Comment on file** (in each file header) adds a file-level comment.\n- **Finish review** (⌘⇧↩) opens the summary box and the**Submit review** button.\n- Files can be collapsed. Files with more than 1,500 changed lines start collapsed.\n\nDrafts are saved automatically to `.git/diffreview/comments.json`, so closing the\nwindow doesn't lose work: the next run picks up where you left off. The file is\ndeleted when you submit. If you close the window while a comment is still being\ntyped, that text is kept as a comment.\n\n```\n# Code Review\n\nOverall summary.\n\n## path/to/file.swift\n\nA file-level comment.\n\n### Lines 42-45 (new)\n\n``` swift\nlet the = \"selected lines\"\n```\n\nThe comment.\n```\n\nLine numbers refer to the new version of the file, or to the old version (`(old)`)\nwhen only deleted lines are selected. Selections that mix added and removed lines\nare shown as a `diff` block.\n\nThe repo ships a `/diffreview` command in\n[`.claude/commands/diffreview.md`](https://github.com/chalmagean/diffreview/blob/main/.claude/commands/diffreview.md). Install it for all your\nprojects:\n\n```\nmkdir -p ~/.claude/commands\ncp .claude/commands/diffreview.md ~/.claude/commands/\n```\n\nIt contains:\n\n```\n---\ndescription: Open diffreview to review changes GitHub-style, then address the comments\nargument-hint: [--base <ref>]\nallowed-tools: Bash(diffreview) Bash(diffreview *)\n---\n!`diffreview $ARGUMENTS`\nAddress each review comment above. If something is unclear, ask before changing it.\n```\n\nThen run `/diffreview` (or `/diffreview --base main`) in any repository. Cancelling the\nreview makes the command abort, so nothing is sent to Claude.\n\n**Timeout:** Claude Code runs `!` commands under the Bash tool's default timeout of\n2 minutes, and reviews usually take longer. Raise it in `~/.claude/settings.json`:\n\n```\n{\n  \"env\": {\n    \"BASH_DEFAULT_TIMEOUT_MS\": \"3600000\",\n    \"BASH_MAX_TIMEOUT_MS\": \"3600000\"\n  }\n}\n```\n\nThis also changes the default timeout for every other Bash command Claude Code runs.\n\n```\nswift build\nscripts/test.sh\n```\n\nUse `scripts/test.sh` rather than `swift test`. With only the Command Line Tools\ninstalled (no Xcode), `swift test` builds the swift-testing tests but runs none of\nthem and still reports success. The script detects that setup and runs the tests\nthrough a small runner (`scripts/TestRunner.swift`). Under Xcode it just calls `swift test`.\n\n- `Sources/DiffReviewCore` : no UI. Runs git, parses unified diffs (renames, copies,\nbinary files, mode changes, quoted paths, \"\\ No newline at end of file\"), models\ncomments, renders the markdown review and stores drafts.\n- `Sources/diffreview` : the AppKit/SwiftUI app.\n- `Tests/DiffReviewCoreTests` : parser and renderer tests, plus integration tests that\nrun real git in temporary repositories.\n\nSyntax highlighting isn't implemented yet. `Sources/diffreview/SyntaxHighlighter.swift`\nis the place to add it: each line is passed through `SyntaxHighlighter.highlight(_:language:)`.", "url": "https://wpnews.pro/news/diffreview-code-review-for-local-claude-diffs", "canonical_source": "https://github.com/chalmagean/diffreview", "published_at": "2026-11-02 06:41:40+00:00", "updated_at": "2026-11-02 06:51:12.834403+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "developer-tools", "ai-products"], "entities": ["diffreview", "Claude Code", "Anthropic", "macOS", "Swift 6", "Xcode", "git"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/diffreview-code-review-for-local-claude-diffs", "markdown": "https://wpnews.pro/news/diffreview-code-review-for-local-claude-diffs.md", "text": "https://wpnews.pro/news/diffreview-code-review-for-local-claude-diffs.txt", "jsonld": "https://wpnews.pro/news/diffreview-code-review-for-local-claude-diffs.jsonld"}}