A useful pre-commit security pass answers three different questions: did I add a credential, did I introduce a source-code issue, and does this diff deserve a closer review? Hushavyr is an open-source extension that runs these checks locally in VS Code. This walkthrough focuses on changed code and the evidence to look for before committing.

Start with checks that don't need a model

Open the Command Palette and run Hushavyr: Find Hardcoded Secrets. Look at the path and line number for each result without copying credential values into your notes. If a credential was committed, rotate or revoke it. Removing it from the current file still leaves earlier commits to investigate. The optional Gitleaks integration can scan Git history when you need that wider scope.

Next run Hushavyr: Security Scan (No AI). Compare each relevant result with the code around it, then separate findings introduced by your diff from existing work. For a finding you plan to fix, record the path, the reason it matters, and the test you expect to pass after the change.

Use Ollama on the diff you are about to commit

Run Hushavyr: Setup and review the proposed setup commands. With a local Ollama model available, run Hushavyr: Review Uncommitted Changes (Local AI). The Command Palette workflow works without a Copilot subscription. For each suggestion, check that the cited line exists and that the behavior described is plausible in your application. For example, if the model flags an exception path, trace how the caller handles it and add a focused test if the failure would matter.

The local AI code review guide for VS Code walks through the file and diff review commands.

Know what can run offline

The built-in checks don't require Ollama. For local AI review offline, install Ollama and download the model before disconnecting. If you also use optional dependency scanners, prepare their vulnerability databases while connected and check their age before relying on CVE results. See the offline scanner setup guide for the commands.

Finish by running the project's normal tests and inspecting the staged diff. Carry forward suggestions you can reproduce or substantiate from the code. Hushavyr is maintained by Matthaios Stavrou, the author account for this post.