Skip to main content

polycheck

Let your LLM triage a verified report instead of hallucinating a review. polycheck runs the cheap, exhaustive static-analysis pass first (linters, type-checkers, CVE scanners, secret scanners, SonarQube) and hands the LLM a tight, located, reproducible findings list to adjudicate. The LLM verifies instead of guessing — every finding has a tool, a rule, a file, and a line.

Self-audit, enforced: every bundled adapter is guarded by a seeded-defect verifier (polycheck verify-tools) — a tool that runs clean on a repo seeded with defects it must catch reports missed-defects, never a false "clean bill of health". polycheck run . on this repo's own source returns 0 findings at MEDIUM+ severity, and CI re-checks that on every push.


Quick Start: Use /polycheck in Kilo Code, OpenCode, Claude Code, and other MCP tools

polycheck is designed for LLM coding assistants. Install it once, initialize your assistant integration, then run /polycheck in any repository.

Step 1: Install polycheck

pipx install "git+https://github.com/Phhofm/polycheck.git"
# Once published on PyPI: pipx install polycheck

Step 2: Initialize /polycheck

For one setup across all your projects, use global workflow/config files:

polycheck init --host all --scope global

Preview first:

polycheck init --host all --scope global --dry-run

For a single repository only, use project-local files:

polycheck init --host all --scope project

The initializer writes slash-command workflow files and, where safe, MCP config:

Host Project files Global files
Kilo Code .kilo/commands/polycheck.md and kilo.jsonc ~/.config/kilo/commands/polycheck.md and ~/.config/kilo/kilo.jsonc
OpenCode .opencode/commands/polycheck.md and opencode.jsonc ~/.config/opencode/commands/polycheck.md and ~/.config/opencode/opencode.jsonc
Claude Code .claude/skills/polycheck/SKILL.md and .mcp.json ~/.claude/skills/polycheck/SKILL.md and ~/.claude.json

Useful options:

polycheck init --host kilo,opencode --scope global --yes
polycheck init --host claude --scope project --force
polycheck init --host all --scope global --no-mcp
polycheck init --host all --scope global --mcp-only

Step 3: Restart your LLM coding assistant

Restart Kilo Code, OpenCode, Claude Code, or your MCP-compatible tool so it reloads MCP servers and slash-command files.

Step 4: Run the guided workflow

In any project, type:

/polycheck

or ask your assistant to:

run polycheck

What happens:

  1. The workflow calls the MCP tool polycheck.run against the current repo.
  2. polycheck checks which analyzers and system dependencies are available.
  3. If tools are missing, the LLM asks whether to install them.
  4. polycheck runs the installed applicable analyzers.
  5. Reports are written to polycheck-reports/.
  6. The LLM shows a compact summary grouped by tool and severity.
  7. If fixable findings exist, the LLM asks before applying fixes.
  8. After fixes, the LLM reruns polycheck.run to verify the result.
  9. Once you accept the current state, the LLM suggests polycheck baseline; later polycheck.run calls with diff: true surface only new findings.
  10. FALSE-POSITIVE verdicts land in .polycheck.yml suppress: so they are never re-argued.

If the MCP tool is unavailable, the generated workflow falls back to:

polycheck run . --severity MEDIUM

and then asks the LLM to triage the generated markdown and JSON reports.

Session summaries are written under .polycheck/ so future LLM sessions can reference what was checked, skipped, fixed, or deferred.

Manual MCP setup

If you prefer not to use polycheck init, configure the MCP server manually.

Claude Code — add to project .mcp.json, ~/.claude/settings.json, or your Claude user MCP config:

{
  "mcpServers": {
    "polycheck": {
      "command": "polycheck",
      "args": ["mcp"]
    }
  }
}

Kilo Code (VSCode Extension) — add to kilo.jsonc in your project root or ~/.config/kilo/kilo.jsonc:

{
  "mcp": {
    "polycheck": {
      "type": "local",
      "command": ["polycheck", "mcp"],
      "enabled": true
    }
  }
}

OpenCode — add to opencode.jsonc in your project root or ~/.config/opencode/opencode.jsonc:

{
  "mcp": {
    "polycheck": {
      "type": "local",
      "command": ["polycheck", "mcp"],
      "enabled": true
    }
  }
}

Any MCP-compatible tool (generic JSON):

{
  "mcpServers": {
    "polycheck": {
      "command": "polycheck",
      "args": ["mcp"]
    }
  }
}

Docker / SonarQube: SonarQube analysis through sonarless requires both Docker running and the sonarless binary installed. polycheck keeps sonarless enabled by default when those are available. If Docker is missing, polycheck reports it as a skipped system dependency and suggests asking your LLM coding assistant for OS-specific Docker setup help. If Docker is available but sonarless is missing, the guided MCP workflow offers to install sonarless before rerunning polycheck.run.


CLI Usage (Manual)

If you prefer running polycheck directly without an LLM:

polycheck run [PATH]                      # run all applicable tools
polycheck run . --tool ruff --tool mypy    # restrict to specific tools
polycheck run . --severity MEDIUM          # drop INFO / LOW findings
polycheck run . --fail-on HIGH             # exit 1 if any HIGH/CRITICAL (CI)
polycheck run . --install                  # install missing tools, then run
polycheck run . --parallel                 # run tools concurrently
polycheck run . --output markdown          # markdown only (no JSON / sarif)
polycheck baseline .                       # snapshot current findings
polycheck run . --diff                     # only findings NEW since the baseline
polycheck init --host all --scope global   # initialize /polycheck workflows
polycheck init --dry-run --host all        # preview initialization
polycheck doctor                           # show installed/missing tools, exit 0 by default
polycheck doctor --fail-on-missing         # exit 1 when tools are missing
polycheck install                          # install every missing tool
polycheck install ruff mypy                # install specific tools
polycheck list-tools                       # list every available analyzer
polycheck verify-tools                     # verify supported analyzers on synthetic repos
polycheck verify-tools --install --yes     # install missing auto-installable tools, then verify
polycheck verify-tools --include-heavy     # include Docker/network-heavy tools
polycheck prompt --plain                   # print the triage prompt
polycheck mcp                              # start the MCP server

polycheck run exits with code 1 if any finding is at or above --fail-on (default MEDIUM). Use --fail-on HIGH in CI.

Verifying every supported analyzer

Use polycheck verify-tools when changing analyzer wrappers or installer logic. It creates synthetic repositories and verifies every registered tool:

polycheck verify-tools

Installed tools are run. Missing tools are reported as skipped. To attempt automatic installation for installable tools first:

polycheck verify-tools --install --yes

Docker/network-heavy tools are skipped by default because they can start Docker or reach package registries. Include them explicitly when that is acceptable:

polycheck verify-tools --include-heavy

For a full install-and-run verification of every supported analyzer, use:

polycheck verify-tools --install --yes --include-heavy

The heavy set currently includes sonarless, semgrep, pip-audit, and npm-audit:

  • sonarless requires Docker and the sonarless binary. Its installer is Docker-aware and only runs when Docker is available.
  • gitleaks, actionlint, hadolint, and shellcheck are installed from GitHub releases when polycheck can infer the correct OS/architecture asset. Unsupported OS/architecture combinations are reported instead of guessed.
  • semgrep may download rules when using --config=auto.
  • pip-audit queries PyPI to audit Python dependencies.
  • npm-audit queries the npm registry to audit Node dependencies.

To verify every supported tool in the pytest suite, run the heavy marker:

pytest -m heavy

The default pytest run includes the heavy smoke test only when the tools are already installed or can be skipped safely; use polycheck verify-tools --install --yes --include-heavy when you explicitly want install-and-run coverage for every supported analyzer.

The Triage Prompt

The guided MCP workflow handles triage automatically. If you run the CLI manually, you can still print the prompt and pair it with a report:

polycheck prompt --plain    # prints just the prompt

The LLM reads the report (not the source code) and triages each finding as REAL BUG, REAL SMELL, FALSE POSITIVE, or DEFERRED.


MCP Server Reference

polycheck ships an MCP server with one primary guided workflow tool, polycheck.run, plus a compatibility alias and several advanced/low-level tools.

Primary tool

Tool Description
polycheck.run Primary guided workflow: dependency check, optional install approval, scan, reports, coverage metadata, optional baseline diff (diff: true), and next action. Do not call polycheck.doctor manually for normal runs.
polycheck Compatibility alias for polycheck.run.

Advanced tools

Tool Description
polycheck.audit_run Run the low-level scan primitive on a repo. Returns report paths, dependency context, and summary.
polycheck.list_tools List every analyzer polycheck knows about and whether it is installed.
polycheck.explain_finding Explain a category (CVE, SECURITY, LINT, etc.) and how to triage it.
polycheck.doctor Check Docker, sonarless, and all analyzers. Non-fatal by default.
polycheck.install Install missing tools (all or specific ones).

Resources

Resource Description
polycheck://session/latest Latest polycheck.run workflow summary.
polycheck://triage/prompt The interactive LLM triage prompt.
polycheck://findings/markdown Last run's markdown report.
polycheck://findings/json Last run's JSON report.

What You Get

polycheck run <repo> writes a <repo>/polycheck-reports/ directory:

  • polycheck-report.md — human-friendly, LLM-friendly triage report
  • polycheck-report.json — canonical machine-readable findings
  • polycheck-report.sarif — IDE / GitHub code-scanning integration

Each finding has a stable schema:

{
  "tool": "sonarless",
  "rule": "sonar:bug:S3776",
  "severity": "HIGH",
  "category": "security",
  "message": "Complexity of this function is too high",
  "file": "src/parser.py",
  "line": 42,
  "fixable": false
}

Configuration

Drop a .polycheck.yml (or .polycheck.toml) at the repo root:

enable:                 # only run these tools (default: all applicable)
  - ruff
  - mypy
  - gitleaks
  - sonarless
disable:                # never run these tools
  - pylint
severity_threshold: MEDIUM
timeout: 600            # per-tool seconds
output:
  formats: [markdown, json, sarif]
  report_dir: polycheck-reports
extra_args:             # per-tool extra CLI args
  ruff: ["--select", "E,F"]
  eslint: ["--max-warnings", "0"]

sonarless is enabled by default when Docker is running and the sonarless binary is installed. Disable it with:

disable:
  - sonarless

Baseline & durable suppressions

The daily loop: run once, triage, snapshot — then only new code produces findings.

polycheck baseline .        # snapshot today's accepted findings
polycheck run . --diff      # report only NEW findings (exit 1 gates on new ones)

The baseline stores fingerprints only (tool, rule, file, line, column) in polycheck-reports/polycheck-baseline.json — small, stable across message changes. Re-run polycheck baseline after fixing or triaging to move the needle forward.

When the LLM (or you) classifies a finding as FALSE POSITIVE, persist that verdict so it is never re-argued:

suppress:
  - F401                    # suppress rule everywhere
  - SC2086@scripts/legacy.sh  # suppress rule in one file only

Suppressed findings are dropped before reports are written and before the CI exit-code gate, so they never reappear in a later run.


Tool Matrix

Language / Surface Tool What it does
Python ruff Fast linter + import sort
Python mypy Static type checker
Python vulture Dead code (with whitelist support)
Python pip-audit CVE scan in dependencies
Python deptry Missing / unused dependencies
JS / TS eslint Linter (ESLint v9 flat config + legacy)
JS / TS tsc TypeScript type checker
JS / TS knip Unused files, exports, dependencies
JS / TS npm-audit CVE scan in dependencies
JS / TS depcheck Missing / unused dependencies
Universal gitleaks Secrets in the working tree
Universal semgrep Pattern-based security (multi-language)
Universal sonarless SonarQube: bugs, vulns, code smells (30+ languages, requires Docker)
GitHub Actions actionlint Workflow file linter
Shell shellcheck Shell script linter
Docker hadolint Dockerfile linter

Install hints are exposed via polycheck explain <tool>.


How It Works

                ┌────────────────────────────────────────────┐
                │              polycheck.run                 │
                └─────────────────────┬──────────────────────┘
                                      │
       dependency check → install approval → detect → filter → run → dedupe → group
                                      │
   ┌────────────┬─────────────┬───────┴────────┬──────────────┐
   │ Python     │ JS / TS     │ Universal      │ Polyglot     │
   │ ruff       │ eslint      │ gitleaks       │ semgrep      │
   │ mypy       │ tsc         │ **sonarless**  │              │
   │ vulture    │ knip        │                │              │
   │ pip-audit  │ npm-audit   │                │              │
   │ deptry     │ depcheck    │                │              │
   └────────────┴─────────────┴────────────────┴──────────────┘
                                      │
                          normalize → Finding
                                      │
                  ┌───────────────────┼───────────────────┐
              markdown               json              sarif
              (LLM-friendly)     (canonical)        (IDE / GH code-scanning)

Every analyzer is wrapped by a Tool adapter in src/polycheck/tools/. Each adapter:

  1. Calls the underlying tool as a subprocess.
  2. Parses its output (JSON or text, with format-specific regexes).
  3. Emits Finding objects with a stable schema.

A finding has a fingerprint of (tool, rule, file, line, column), so two tools reporting the same defect converge to one row.

sonarless (Docker-based)

sonarless starts a local SonarQube instance in Docker, scans your code, and queries the SonarQube API for per-file issues. It covers 30+ languages for bugs, vulnerabilities, code smells, and security hotspots.

  • Requires Docker installed and running
  • Install when Docker is available: curl -sSL https://raw.githubusercontent.com/gitricko/sonarless/main/install.sh | bash
  • The guided MCP workflow offers to install sonarless automatically when Docker is available.
  • Web UI: http://localhost:9234 (admin/Son@rless123)
  • Clean up: sonarless docker-clean

PATH setup: After installing sonarless, add it to your PATH:

# Add to ~/.bashrc or ~/.zshrc
export PATH="$HOME/.sonarless:$PATH"

# Or create a wrapper script
echo '#!/bin/bash
exec $HOME/.sonarless/makefile.sh "$@"' > $HOME/.sonarless/sonarless
chmod +x $HOME/.sonarless/sonarless

Note for OpenCode users: If you're using OpenCode in a sandboxed environment, Docker may not be accessible due to snap confinement. Install Docker via apt (sudo apt install docker.io) instead of snap for full compatibility.


Adding a Language or Tool

Adding a new analyzer is a single file:

# src/polycheck/tools/mypy_advanced.py
from ..finding import Category, Severity
from .base import Tool

class MypyAdvancedTool(Tool):
    name = "mypy-advanced"
    category = Category.TYPE
    languages = ["python"]

    def is_applicable(self, repo):
        return (repo / "pyproject.toml").exists()

    def run(self, repo):
        # call subprocess, parse output, return list[Finding]
        ...

ToolRegistry.discover() will auto-register it on first import. No core changes required.

To add a new language (e.g. Go, Rust), add a marker to the LANGUAGES tuple in src/polycheck/detect.py, and existing tools that already speak the language (e.g. semgrep, gitleaks) will pick it up automatically. New language-specific tools just set languages = ["go"].


Origin

polycheck started because a coworker pasted this prompt into Claude Code for two projects:

"Go bug hunting, carefully analyze the entire code. Create a list of bugs and errors. Sort by critical to minor. Max 20 items."

It burned through a massive amount of tokens and produced very little useful outcome. The LLM was re-reading code that existing tools already analyze faster and more reliably.

That's when it clicked: there's a more efficient way to use LLMs. Static analyzers already do the cheap, exhaustive pass — linting, type checking, CVE scanning, secret detection. Give the LLM the structured report from those tools, and it can focus on triage and verification instead of re-reading everything from scratch.

We need to learn to combine new technology with established tools, not replace the old with the new. It reminds me of the blockchain hype during university — everyone wanted to use it as a distributed database when highly optimized systems already existed for that. The same pattern is repeating with LLMs: they're not the solution for everything. Sometimes the right answer is a thin wrapper that connects tools that already work.

polycheck is that wrapper. It doesn't try to understand your code. It lets your linters do what they're good at, and hands the LLM a tight report to act on.


Philosophy

  • Static analyzers are cheap; reading code is expensive. polycheck does the cheap pass exhaustively.
  • One schema, many backends. Every analyzer maps to Finding. Reporters only know one shape.
  • LLMs are a second pass, not a substitute. polycheck doesn't call any model. It produces the artifacts that make an LLM's review step fast and focused.
  • No magic. polycheck is a thin subprocess wrapper. It doesn't try to understand your code. Your linters already do that better than any LLM would.
  • Reports are git-tracked. polycheck-reports/ is plain text. Diff it across PRs.

License

MIT.

Metadata

Release files for polycheck 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for polycheck 0.2.1
File Size Uploaded Provenance Actions
polycheck-0.2.1.tar.gz 87.7 kB With provenance Details for polycheck-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for polycheck 0.2.1
File Interpreter ABI Platform Actions
polycheck-0.2.1-py3-none-any.whl Python 3 none any Details for polycheck-0.2.1-py3-none-any.whl

Total release size: 169.8 kB

Release files / polycheck-0.2.1.tar.gz

Download URL polycheck-0.2.1.tar.gz
Size 87.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fece87da7f643c74448da3a77ebb6dea6e17914c0e9329e2f294cc65306e6415
BLAKE2b-256 checksum
How to use checksums
09389a58427a6839347dba1ba24ea457b9dd8f5d132b298114cf80c4d3dcbde4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / polycheck-0.2.1-py3-none-any.whl

Download URL polycheck-0.2.1-py3-none-any.whl
Size 82.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0c8c9d970ec29d58fb9722bc885e0a3c201251aad1351abfe8d34edae1f36dbb
BLAKE2b-256 checksum
How to use checksums
95fdbc5832727e385b00fd6f3b207d6a8bbb9b0dd20ce35baaabbf076c3e83f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for polycheck 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for polycheck-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page