Skip to content

Configuration Guide ​

DevDiff supports flexible configuration using a .devdiff.config.js file (recommended), .devdiff.config.json, or other .devdiffrc configurations in the root directory of your repository.


Complete Configuration Template ​

Here is a full schema reference detailing all available options in .devdiff.config.js format:

javascript
// .devdiff.config.js
export default {
  version: "1.0.6",

  // ── AI CONFIGURATION ──
  ai: {
    providers: [
      {
        name: "ollama-local",
        url: "ollama://qwen2.5-coder:7b",
        priority: 1,
        timeout: 60000, // 60 seconds
        maxTokens: 4096,
      },
      {
        name: "openai-cloud",
        url: "openai://gpt-4o-mini",
        apiKey: process.env.OPENAI_API_KEY,
        priority: 2,
        timeout: 30000,
      },
    ],
    routing: {
      strategy: "priority", // priority, cost-aware, latency, capability
      complexityThreshold: 0.5,
      localOnly: false,
      maxDailyCost: 0.5, // USD limit
    },
  },

  // ── SECURITY CONTROLS ──
  security: {
    disableShellAccess: false,
    disableNetworkAccess: false,
    allowedShellCommands: ["git", "ollama", "which"],
    auditEncryption: true,
    fipsMode: false,
  },

  // ── PRIVACY CONTROLS ──
  privacy: {
    auditLogRetention: 30, // retain logs for 30 days
    autoDeleteAuditLogs: false,
    dataMinimization: "strict", // strict, moderate, relaxed
    blockExternal: ["**/.env", "**/secrets/**", "**/keys/**"],
  },

  // ── PERFORMANCE TUNING ──
  performance: {
    maxMemoryMB: 256, // limit peak heap memory to 256MB
    maxFilesPerAnalysis: 500,
    useIncrementalDiffing: true,
    cacheASTRuns: true,
  },

  // ── CONTEXT WINDOW LIMITS ──
  context: {
    maxContextTokens: 4000,
    overflowStrategy: "summarize", // truncate, summarize, split, mcp
  },

  // ── AGENTIC WORKSPACE SETTINGS ──
  agentic: {
    enabled: true,
    autoStart: true,
    autoAnalyzeOnCommit: false,
    notificationMode: "minimal", // silent, minimal, verbose
    maxAutoAnalysesPerHour: 20,
  },

  exclude: [
    "**/node_modules/**",
    "pnpm-lock.yaml",
    "package-lock.json",
    "dist/**",
    "*.log",
  ],

  cache: {
    enabled: true,
    path: ".devdiff/cache.json",
  },

  format: "markdown",
};

Detailed Option Breakdown ​

AI & Routing Parameters ​

OptionTypeDefaultDescription
ai.providersArrayRequiredList of model provider endpoints and credentials. Supports local (ollama://) and cloud (openai://, gemini://, anthropic://).
ai.routing.strategystring"priority"Strategy used by the Intelligent Router. Options: 'priority', 'cost-aware', 'latency', 'capability'.
ai.routing.complexityThresholdnumber0.5Complexity value above which changes trigger escalation to higher capacity models (0-1).
ai.routing.localOnlybooleanfalseWhen true, prevents the router from selecting any external cloud providers regardless of complexity.
ai.routing.maxDailyCostnumber0.50Maximum daily spend on cloud AI services (in USD) to prevent surprise billing.

Security Parameters ​

OptionTypeDefaultDescription
security.disableShellAccessbooleanfalseDisables execution of all shell commands, running purely in static analysis mode.
security.disableNetworkAccessbooleanfalseBlock all outbound connections, forcing local-only Ollama runs.
security.allowedShellCommandsArray<string>["git", "ollama", "which"]Whitelist of executable commands.
security.auditEncryptionbooleantrueEncrypt audit logs at rest using AES-256-GCM.
security.fipsModebooleanfalseRun with FIPS 140-2 validated cryptography libraries.

Privacy & Data Minimization ​

OptionTypeDefaultDescription
privacy.auditLogRetentionnumber30Number of days to retain system audit logs.
privacy.autoDeleteAuditLogsbooleanfalseAuto-prune logs older than auditLogRetention days.
privacy.dataMinimizationstring"strict"How aggressively to minimize payload data sent to the AI. Options: 'strict', 'moderate', 'relaxed'.
privacy.blockExternalArray<string>["**/.env", "**/secrets/**", "**/keys/**"]Glob patterns of files that must NEVER be sent to external cloud APIs.

Performance & Memory Tuning ​

OptionTypeDefaultDescription
performance.maxMemoryMBnumber256Heap memory cap (in MB) for DevDiff processes.
performance.maxFilesPerAnalysisnumber500Max count of files allowed in a single generate run.
performance.useIncrementalDiffingbooleantrueEnables indexing to check changed blocks incrementally.
performance.cacheASTRunsbooleantrueCache AST parses to optimize CPU usage.

Context Window & Agentic Mode ​

OptionTypeDefaultDescription
context.maxContextTokensnumber4000Token limit for prompts.
context.overflowStrategystring"summarize"How to handle tokens exceeding limit. Options: 'truncate', 'summarize', 'split', 'mcp'.
agentic.enabledbooleantrueEnable or disable agentic IDE workspace integration.
agentic.autoStartbooleantrueStart agentic daemon automatically when editor opens.
agentic.notificationModestring"minimal"Alert verbosity. Options: 'silent', 'minimal', 'verbose'.

Editor Autocomplete (IntelliSense) ​

DevDiff CLI can generate JSON Schema files to enable auto-complete, parameter descriptions, and validation directly in your editor:

bash
# Generate the VS Code settings schema
devdiff schema

This creates a local .vscode/devdiff-schema.json file. Follow the CLI directions to add the schema mapping in your .vscode/settings.json.