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.
| Scope | Path | Priority |
|---|---|---|
| Global | ~/.vdiff/config.json | Base config |
| Local | .vdiff/config.json | Overrides 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
| Key | Default | Description |
|---|---|---|
llm.provider | Auto-detected | anthropic or openai (detected from API key prefix) |
llm.apiKey | Your API key | |
llm.model | claude-haiku-4-5 | Model for default mode (fast, cheap) |
llm.highModel | claude-sonnet-4-6 | Model for --thinking-level high (deep analysis) |
Analysis settings
| Key | Default | Description |
|---|---|---|
analysis.contextThreshold | 1.0 | Max fraction of context window to use (0.0–1.0) |
analysis.graphPath | graphify-out/graph.json | Path to knowledge graph |
analysis.maxGraphContextChars | 8192 | Max chars of graph context to include (0 = unlimited) |
Review settings
| Key | Default | Description |
|---|---|---|
review.historyLimit | 10 | Max 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/rulesExample .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_evidenceKnowledge 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 statusOnce 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.
| File | Purpose |
|---|---|
~/.vdiff/config.json | Global configuration |
.vdiff/config.json | Project-local configuration |
.vdiff/rules/*.md | Project-specific analysis rules |
.vdiff/rules/learned.md | Rules from review decisions |
.vdiff/reviews.json | Finding registry (review memory) |
.vdiff/reviews/results/*.json | Stored review results for vdiff reviews |