← Docgrity for VS Code home

How Docgrity for VS Code works

Last updated: 5 September 2026

The pipeline

  1. Collect. Docgrity gathers your repo's markdown files (**/*.md by default, capped at 200 files). node_modules, build output, and vendor directories are always excluded, and anything in your .gitignore is skipped too. Trivial files are dropped.
  2. Pair locally. Candidate document pairs are selected with local TF-IDF cosine similarity — deterministic, instant, and free. No AI is used at this stage; code blocks are ignored so shared snippets don't cause false pairing.
  3. Assess with your model. Only the top pairs (25 by default) are sent to the language model — via VS Code's built-in vscode.lm API, meaning your own Copilot subscription or a local model. When both pairwise checks are enabled, duplication and contradiction are assessed in a single combined call per pair; open-question checks run only on documents that show open-question signals (TODO/TBD, placeholders, unanswered questions). Assessments run four at a time.
  4. Validate everything. Model responses must be valid JSON matching a strict schema — anything else is rejected, never partially trusted. Every evidence excerpt is verified verbatim against your files; findings with unverifiable evidence are dropped (hallucination guard).
  5. Show findings. Findings appear in the Docgrity activity-bar view and as diagnostics (squiggles) on the exact evidence text — the scan notification's View findings button takes you straight there. Docgrity: Open findings report generates a shareable markdown report of the whole scan. Each finding records the model and prompt version that produced it.
  6. Act — with approval. Right-click a finding → Raise GitHub issue. Docgrity drafts a title and body (evidence, suggested next step, potential owner from git log) and shows it to you in a modal. Only after you click Create issue does it post, using VS Code's built-in GitHub sign-in, labelled docgrity / docgrity:<type>.

Modes: report-only vs report + issues

The docgrity.mode setting controls what the extension is allowed to do:

Because it's a normal VS Code setting, you can set report-only globally in user settings and override to report-and-issue per-workspace (in .vscode/settings.json) only in repos where you want to act.

Choosing which checks run

Each check is an independent toggle — run any combination, with any model, in either mode:

Disabling checks also speeds up scans: pair selection is skipped entirely when both pairwise checks are off, and only enabled checks cost model calls.

Viewing results

Potential owners

Docgrity suggests who might fix a finding by looking at the last git author of each involved file. This is always labelled potential — inferred, never asserted. It never assigns issues automatically.

Choosing your model — Copilot, Claude, GPT, or local llama

Docgrity talks to whatever model VS Code's language-model API (vscode.lm) exposes. The easiest way to switch: run Docgrity: Select AI model from the command palette — it lists every available model and saves your choice. Manual settings: docgrity.model.vendor (default copilot) and docgrity.model.family (e.g. gpt-4o, claude-sonnet-4.5, llama3.1; empty = first available).

Options, in order of simplicity:

  1. GitHub Copilot (default). Sign in to Copilot — nothing to configure. Uses whichever Copilot model you have access to.
  2. Claude / GPT / Gemini via Copilot. Any model enabled in Copilot's model picker is available to Docgrity — pick it with Select AI model or set docgrity.model.family.
  3. Local Ollama — fully private. Install Ollama, pull a model (ollama pull llama3.1), then in Copilot Chat → Manage models → add the Ollama model. It registers under the copilot vendor; select it with Select AI model. With a local model, no document content leaves your machine at all.
  4. Remote Ollama over a Cloudflare Tunnel. If your model runs on another machine (home server, GPU rig), expose it with:
    cloudflared tunnel --url http://localhost:11434
    and point Copilot's Manage models → Ollama endpoint at the generated https://….trycloudflare.com URL.
    Caveats: quick tunnels get a new URL on every restart — you must update the endpoint each time. For a stable URL, create a named tunnel on your own domain (cloudflared tunnel create docgrity-llm + a DNS route), and protect it with Cloudflare Access or an auth proxy — an unauthenticated LLM endpoint on the public internet can be abused by anyone who finds it.
  5. Other provider extensions. Any VS Code extension that registers language models works: set docgrity.model.vendor to that provider's vendor id, or empty for "any available model".

Models outside the editor — CLI and GitHub Action

Copilot models are only available inside VS Code (there is no Copilot API key for terminals or CI). The CLI and Action use direct providers instead:

Summary: Copilot (keyless) in the editor · Ollama (keyless) everywhere · BYO key for hosted models in CI and the CLI.

No-agent mode — no AI at all

Every surface can also scan with pure algorithms — no model, no Copilot, no keys, fully offline. Extension: set docgrity.engine to no-agent. CLI: docgrity scan --provider none. Action: provider: none.

Evidence stays verbatim (extracted directly from the docs), owners still come from git history, and findings are marked method: heuristic so you always know how they were produced.

Model quality note: Docgrity's prompts demand strict JSON with verbatim evidence. Hosted frontier models handle this reliably; small local models (<8B) fail validation more often. Failed responses are rejected safely — you get fewer findings, never corrupted ones. Recommended local minimum: an 8B+ instruct model (e.g. llama3.1:8b); 70B-class or hosted models give noticeably better contradiction detection.

Cost & performance

Security posture

Troubleshooting

← Back to home