vdiff Configuration Guide

Configure vdiff with custom rules, knowledge graphs, spec alignment, and team-specific review policies

Config files

vdiff uses two config files. Local overrides global.

ScopePathPriority
Global~/.vdiff/config.jsonBase config
Local.vdiff/config.jsonOverrides global

Config schema

json

{
  "llm": {
    "provider": "anthropic",
    "apiKey": "sk-ant-...",
    "model": "claude-haiku-4-5",
    "highModel": "claude-sonnet-4-6"
  },
  "analysis": {
    "contextThreshold": 1.0,
    "graphPath": "graphify-out/graph.json",
    "maxGraphContextChars": 8192
  },
  "review": {
    "historyLimit": 10
  }
}

LLM settings

KeyDefaultDescription
llm.providerAuto-detectedanthropic or openai (detected from API key prefix)
llm.apiKeyYour API key
llm.modelclaude-haiku-4-5Model for default mode (fast, cheap)
llm.highModelclaude-sonnet-4-6Model for --thinking-level high (deep analysis)

Analysis settings

KeyDefaultDescription
analysis.contextThreshold1.0Max fraction of context window to use (0.0–1.0)
analysis.graphPathgraphify-out/graph.jsonPath to knowledge graph
analysis.maxGraphContextChars8192Max chars of graph context to include (0 = unlimited)

Review settings

KeyDefaultDescription
review.historyLimit10Max stored review results for vdiff reviews

Custom rules

Create project-specific rules in .vdiff/rules/ as .md or .txt files. They are loaded alphabetically and injected into the risk analysis pass.

bash

mkdir -p .vdiff/rules

Example .vdiff/rules/billing.md:

markdown

- Any change to src/billing/ must include a migration file.
- Never remove rate limiting middleware from payment endpoints.
- Flag any hardcoded price or currency value.

Skip directives

Rules files can contain skip directives to permanently suppress specific categories or output sections:

markdown

skip: test_integrity
skip: missing_evidence

Knowledge graph

The knowledge graph provides cross-file dependency context. It's built with Graphify, a separate Python tool.

bash

# Install graphify (requires Python 3.10+)
pip install graphifyy

# Build the graph
vdiff graph init

# Check status
vdiff graph status

Once built, graph context is automatically included in analyses. The graph is stored at graphify-out/graph.json by default.

Override the path with analysis.graphPath in config or --graph at runtime. Skip with --no-graph.

vdiff warns in the footer when the graph is 20+ commits behind HEAD.

Local data

All data stays on your machine. No code content, file paths, or personal information is collected. LLM API calls use your own key directly to the provider.

FilePurpose
~/.vdiff/config.jsonGlobal configuration
.vdiff/config.jsonProject-local configuration
.vdiff/rules/*.mdProject-specific analysis rules
.vdiff/rules/learned.mdRules from review decisions
.vdiff/reviews.jsonFinding registry (review memory)
.vdiff/reviews/results/*.jsonStored review results for vdiff reviews
vdiff CLI Reference