Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Staticcheck

$ staticcheck Community Low Risk
Dominik Honnef · Code & DevOps · MIT · macos / linux / windows

Deep SSA-based Go static analyzer detecting subtle bugs, deprecated APIs, style simplifications, and dead code. Purely read-only with newline-delimited JSON diagnostics (-f json), rule explanations (-explain), and precise check filtering (-checks).

FCRS-1.0 Score
90 /100
Excellent
Medium Confidence
Zero-Friction Install
brew install staticcheck
CLI vs MCP Decision CLI Only

Local Go SSA analyzer with -f json; direct CLI execution is the canonical workflow.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

Clean -f json (NDJSON) output, -checks selection, -explain <CODE> self-documentation, and zero interactive prompts.

  • -f json emits machine-readable NDJSON diagnostics
  • -explain <CODE> provides self-contained rule explanations
Trust & Safety 25 / 25

Strictly read-only static analyzer; never writes files or makes network calls.

  • Zero write side effects
Setup & Portability 14 / 15

Available via Homebrew, go install, and GitHub Releases across macOS, Linux, and Windows; requires Go SDK.

  • Static Go binary with Go SDK requirement for type-checking
Utility & Efficiency 13 / 15

High signal-to-noise ratio compared to noisier linters; catches real bugs, unused code, and deprecations.

  • Low false-positive rate across SA/S/ST/QF check families
Maintenance & Lineage 8 / 10

Well-established MIT-licensed project (dominikh/go-tools), also embedded inside golangci-lint.

  • Respected dominikh/go-tools codebase under MIT
Docs & Verifiability 8 / 10

Clear check reference at staticcheck.dev/docs/ and built-in -explain flag.

  • Official docs at staticcheck.dev/docs/

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

Purely local Go static analysis; no credentials stored or required.

Side Effects
Read-Only
Cost & Quotas

MIT open-source Go binary; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# Staticcheck Agent Rules
- Run `staticcheck -f json ./...` for structured Go bug and deprecation checks.
- Use `staticcheck -explain <CODE>` whenever you need authoritative context on a diagnostic.

Agent-Ready Command Recipes

Safe Read-Only Queries

Analyze all Go packages and emit JSON lines
staticcheck -f json ./...

Outputs one JSON object per diagnostic with code, severity, location, and message.

Explain a specific Staticcheck diagnostic code
staticcheck -explain SA1019

Prints detailed documentation and remediation guidance for rule SA1019.

Strengths for Agents

  • + -f json emits crisp NDJSON diagnostics and -explain <CODE> lets agents self-serve rule docs.
  • + Strictly read-only with very low false-positive rates.

Caveats & Pitfalls

  • ! -f json outputs newline-delimited JSON objects (one per finding) rather than a single JSON array.
  • ! Requires the Go toolchain installed to load and type-check target packages.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI