Skip to content
divyangchauhanPublic

About

AI code-review for Git diffs and pull requests, with actionable findings, inline GitHub comments, and a 5-point rating.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DiffVouch

DiffVouch is a local-first Go CLI and portable Agent Skill for reviewing Git diffs and GitHub pull requests. It reports blocking and non-blocking findings, explains recommended fixes, and gives each change a transparent rating out of 5.

The CLI is distributed as a standalone native executable. Users do not need Go, Python, Node.js, or a DiffVouch-hosted service to run it. Git is required. Codex or Claude Code is required for CLI transport. API transport talks directly to OpenAI or Anthropic; native subscription transport connects to ChatGPT.

Install the CLI

Download the archive for your operating system and architecture from GitHub Releases, verify it against checksums.txt, and place diffvouch (or diffvouch.exe) on your PATH.

Developers with Go installed can install from source:

go install github.com/divyangchauhan/DiffVouch/cmd/diffvouch@latest

Confirm the installation:

diffvouch --version
diffvouch --help

Tagged releases are built for macOS, Linux, and Windows on AMD64 and ARM64.

Configure an AI provider

Use your ChatGPT subscription with DiffVouch's native Go review loop:

diffvouch auth login openai --transport subscription
diffvouch auth status openai --transport subscription
diffvouch review --provider codex --transport subscription --model YOUR_SUBSCRIPTION_MODEL

Login prints a device verification URL and code. Complete the sign-in in your browser; device-code login must be enabled in your ChatGPT security settings or workspace permissions. DiffVouch stores its own session in the OS credential manager, with a mode-0600 file fallback, and refreshes it when needed. Use --storage file on login to explicitly select file storage. To remove this session, run diffvouch auth logout openai --transport subscription.

The codex provider name selects OpenAI models. With --transport subscription, DiffVouch makes model requests directly and executes its own tools; Codex CLI, Claude Code, and the standalone review skill are not involved. Select a model available to your subscription. This transport never falls back to billable API calls, including when subscription limits are reached.

Subscription transport is an experimental compatibility integration based on the open-source Codex protocol. OpenAI does not document this protocol as a stable third-party subscription API; service changes can require updates. See subscription transport for protocol references and validation status.

Use an installed Codex CLI with your ChatGPT subscription:

diffvouch auth login openai
diffvouch auth status openai

Use an existing Claude subscription:

diffvouch auth login claude
diffvouch auth status claude

To use usage-based APIs instead, securely store a key:

diffvouch auth set-key openai
diffvouch auth set-key anthropic

DiffVouch prefers the operating-system credential manager and falls back to a mode-0600 user secret file when no keyring backend is available. API transport is never selected unless the user passes --transport api.

Review changes

Review tracked and untracked working-tree changes:

diffvouch review --provider codex

Reviews run from the repository root with file-reading tools and shell/Bash access enabled, without permission prompts. The reviewer can inspect related files and run commands and tests. These commands have the access of your user account, including writes and network access. The review instructions prohibit source edits, commits, and publishing, but this is not a filesystem sandbox. API transport provides these tools directly through DiffVouch; neither Codex CLI nor Claude Code is required. It needs an API key and a model that supports tool calling and structured output. Install Bash on PATH for command execution, such as Git Bash on Windows. File reads work without Bash.

Subscription transport uses the same Go tool loop and execution permissions, with ChatGPT authentication instead of an API key.

Native API and subscription reviews return command output, exit status, and errors to the model for follow-up checks. Each command can run for up to 120 seconds and returns up to 64 KiB of output, with truncation reported explicitly. File reads support paging. Each patch chunk allows up to 32 tool rounds or 128 tool calls, followed by a final review that records unfinished checks. A 20-minute deadline covers the entire chunk; exceeding it fails the review.

Other common scopes:

diffvouch review --provider claude --staged-only
diffvouch review --provider codex --base main
diffvouch review --provider codex --base main --committed-only
diffvouch review --provider codex --model gpt-5.6-sol --effort xhigh
diffvouch review --provider codex --transport api --model gpt-5.6-sol
diffvouch review --provider claude --format json --output review.json

Review without either provider CLI installed:

diffvouch auth set-key openai
diffvouch review --provider codex --transport api --model YOUR_OPENAI_MODEL

diffvouch auth set-key anthropic
diffvouch review --provider claude --transport api --model YOUR_ANTHROPIC_MODEL

Use the result as a local quality gate:

diffvouch review --provider codex --fail-below 3.5
diffvouch review --provider codex --fail-on-severity high

Repository-specific rules can be committed in .diffvouch.yml. DiffVouch reads that policy from the trusted base commit so a change cannot suppress its own review. A repository cannot select billable API transport or enable publishing.

Token limits and usage

Diff chunks default to 50,000 tokens, counted locally before any model call. Configure the limit in the trusted .diffvouch.yml:

version: 1
review:
  chunk_tokens: 50000

Or override it for a review:

diffvouch review --provider codex --transport subscription --model gpt-5.6-sol --chunk-tokens 50000

This replaces the previous 180,000-byte default, not an exact conversion of it. Existing configurations with chunk_bytes keep their byte-based behavior. Choose one configuration field; --chunk-tokens overrides either. The separate max_diff_bytes collection safety limit remains in bytes.

The tokenizer runs offline with bundled vocabularies. Recognized models use the encoding mapped by the tokenizer library. Unknown models, including newer model names and Claude, use o200k_base with an explicit estimate label. Counts are exact for that local encoding, not a guarantee of the selected model's accounting.

Terminal output and the JSON tokens field report each chunk's diff and initial prompt text counts. Native OpenAI API and ChatGPT subscription reviews also record input, cached input, output, and reasoning tokens for each model request, when the provider returns usage. Progress goes to stderr, preserving JSON stdout. External CLI and Anthropic usage is currently unavailable. Missing usage is reported as unavailable, not zero.

For context planning, use the largest input count for a single request, then leave room for reasoning and the answer. The cumulative input count across tool rounds measures usage and includes repeated history; it is not the context size. Cached tokens are already part of input, and reasoning tokens are already part of output. Do not add those subtotals twice.

A chunk limit covers only the diff. Instructions, tool definitions, the output schema, and context gathered during review need additional room. For example, a chosen 128,000-token working budget might allocate 50,000 to the diff, 46,000 to instructions and retrieved context, and 32,000 to reasoning and output. This is a planning example, not a measured model quality threshold. DiffVouch reports usage after requests; it does not yet enforce a total context budget or compact history. Establish the useful working budget through review-quality evals rather than assuming the model's maximum context is its best operating range.

OpenAI documents the distinction between local text counts and full request counts in its token-counting guide, and explains context allocation in its reasoning guide.

Secret redaction is temporarily disabled because altering source lines produced false findings. Review the diff for credentials before running DiffVouch: the complete reviewable patch is sent unchanged to the selected AI provider.

Publish reviews as your GitHub bot

DiffVouch does not operate a shared bot. Create a private GitHub App owned by you or by the organization that owns the repositories it will review:

diffvouch github app create
# For an organization-owned app:
diffvouch github app create --owner your-organization

The command starts a temporary localhost callback and uses GitHub's App Manifest flow. It opens a preconfigured GitHub confirmation page with only:

  • Pull requests: Read and write
  • Contents: No access
  • Webhooks: Disabled
  • Subscribed events: None

After you confirm the generated name, DiffVouch exchanges the one-time manifest code, validates the generated credentials, stores the private key securely, and opens the repository installation page. You do not download a PEM or enter an App ID. Then verify access:

diffvouch github app status --repo owner/repository

On a headless machine, pass --no-browser and open the printed localhost URL through a forwarded port. If the browser cannot reach the localhost callback, copy the code query parameter from the failed redirect and finish with diffvouch github app create --code CODE. The manual github app configure command remains available for an existing app.

Review and publish a checked-out pull request:

diffvouch review --provider codex --pr 123 --publish

Or discover the current branch's pull request from a base comparison:

diffvouch review --provider claude --base main --publish

Reviews appear as <app-slug>[bot]. DiffVouch creates a repository-restricted installation token on demand, keeps it only in memory, revalidates the live PR base and head, and posts exactly one COMMENT review with eligible inline comments. It never approves or requests changes.

GitHub Enterprise Server is supported through --host, --api-base-url, --web-base-url, and --github-host where its version supports App manifests.

Install the Agent Skill

The standalone Agent Skill remains available for Codex, Claude Code, Cursor, and other Agent Skills-compatible harnesses:

npx skills add divyangchauhan/DiffVouch \
  --skill diffvouch-review \
  --global

Then ask your agent:

Use $diffvouch-review to review my uncommitted changes.

Build and test

go test ./...
go vet ./...
go build -trimpath ./cmd/diffvouch

GoReleaser packages versioned standalone binaries when a v* tag is pushed.

Review evaluations

Use diffvouch eval prepare, diffvouch eval run, and diffvouch eval report for frozen, resumable evaluations of the native Go reviewer through the ChatGPT subscription transport. The corpus includes Martian's archived competitor reviews, all SWE-PRBench cases, and public PRs from a GitHub owner. Comparisons report coverage and uncertainty without enforcing a regression gate. See running evaluations for models, budget controls, held-out cases, and reporting limits.

About

AI code-review for Git diffs and pull requests, with actionable findings, inline GitHub comments, and a 5-point rating.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages