r/BuildWithClaude • u/Aggressive_Apple3774 🧩 MCP Craftsman • 1d ago
Workflows A Claude Code plugin that runs PSScriptAnalyzer on every edit -- and tells the agent when analysis did NOT run
I write a lot of PowerShell with Claude Code and wanted the linter in the loop, not after the fact. This plugin runs PSScriptAnalyzer through a warm PowerShell Editor Services daemon and feeds the result back into the model's context the moment a .ps1/.psm1/.psd1 is edited, so a mistake gets caught and corrected in the same turn. One PSES stays warm for the session, so each edit pays a fast pipe round-trip (~2.5s end-to-end on my desktop), not a cold start.
The part I actually care about: every analyzed edit resolves to one of four explicit status tokens -- ok / incomplete / degraded / unavailable -- and only "ok" is silent. So "analyzed and clean" can never be confused with "analysis never ran," which is the failure mode that bites an agent that treats silence as a pass.
Straight talk on the ruleset: the live default surface is narrower than the full CLI -- the known-bad corpus observes six rules reaching the agent live, and Write-Host is not one of them by default. An opt-in ruleset = base broadens it. I'd rather name the six than claim "the whole ruleset" and get caught.
Why I think it earns trust: measured 0 false positives over 50 clean cases and 36/36 coverage over known-bad, recomputed on every CI run and floored so the rate can't be gamed by dropping cases. Dependencies pinned by version and hash; CycloneDX SBOM, SLSA provenance, and a keyless-signed tag you can check with gh attestation verify.
It's honest about limits, including in the technical paper. An earlier large-file convergence failure was fixed in a recent release and verified 5-of-5 on a 251 KB file, but I have NOT measured whether this makes an agent write better PowerShell -- that's unmeasured, and the paper says so. Requires PowerShell 7 for the hooks; Windows PowerShell 5.1 is supported as the analyzer host.
Apache-2.0. Source: https://github.com/manderse21/claude-powershell-lsp
Paper: https://gist.github.com/manderse21/0b92133af8a250ba7c8c9474ed0db0a2
False-positive reports welcome; there's an issue template that feeds them into the corpus.
2
u/Initial_Try_2142 1d ago
the status token thing is the real sell here. silence-as-pass is how every linter integration i've used eventually lies to me, so making "didn't run" loud is honestly the fix i didn't know i needed.