« All posts

Why Your AI Code Assistant Needs a Static Pre-Pass

BrassCoders feeds deterministic static-analysis output to LLMs, boosting both speed and accuracy in code review, backed by 2025 research on the pairing.

BrassCoders positions static analysis and AI code review as complementary rather than competing tools. It runs 12 static scanners across a Python codebase and writes severity-ranked findings to .brass/ai_instructions.yaml, which the in-editor AI assistant reads before a session starts — giving the model file paths, line numbers, and remediation notes so it verifies issues instead of discovering them from scratch.

Two 2025 papers back this design. Gnieciak and Szandala found LLMs achieve higher recall in broad triage but mislocate findings at the line level due to tokenization, while static tools are precise but narrower. ZeroFalse went further, feeding static-analyzer output to an LLM for adjudication and reporting F1 scores above 0.91 on OWASP and OpenVuln benchmarks with over 90% precision and recall. BrassCoders' own benchmark on 15 AI-generated Python files found real issues in 9 of 15 after triage, and its paid enrichment tier cut 1,500 raw findings from an 800-file Django app down to a 200-300 item queue.

The one class of bug the model still owns is logic that leaves no structural trace — like a division with no empty-list guard, which no scanner flagged but the model reasoned through correctly. The takeaway isn't that AI replaces static analysis, but that a deterministic pre-pass frees the model to spend its reasoning on judgment calls rather than pattern-matching. Practically, running 'brasscoders --offline scan' before opening an AI editor gives the assistant a persistent, structured starting point instead of a blank file.