Skip to main content

AI-SLOP Detector - Ship Code. Not Slop.

AI-SLOP Detector

Ship Code. Not Slop.

Find warning signs of unfinished code in Python, JavaScript/TypeScript, Go, and Rust.
No API key. No network calls. Your code never leaves your machine.

PyPI version npm version VS Code Marketplace version Python versions Languages: Python, JS/TS, Go, Rust MIT License

CI PyPI downloads per month PyPI downloads total npm downloads per month VS Code installs GitHub stars

Quick Start · What You Get · VS Code · CI/CD · AI Agents · Security · Full Guide


What Is AI-SLOP Detector?

Code can look finished and still hide a stub, a swallowed error, an input nothing reads, or a todo!() that panics when it is reached. Linters pass it because it is well-formed, and AI assistants produce a lot of it.

AI-SLOP Detector is a static analyzer for that gap. It reads your code without running it, reports each spot with the file, the line, the rule and a fix, and gives every file a 0-100 score (higher = more warning signs). It does not tell whether a person or an AI wrote the code; it reports what is in the code.

  • 55 rules across Python (37), JavaScript/TypeScript (8), Go (6) and Rust (4)
  • Deterministic: the same input gives byte-identical JSON
  • Local only: no API key, no model download, no network call during a scan
  • Everywhere you work: terminal, VS Code, CI gates, pre-commit, AI agents (MCP)

Quick Start

60-second first run (more in the guide):

pip install ai-slop-detector
slop-detector --project .

No configuration is needed. Then:

Next Command
One file slop-detector path/to/file.py
Every report in one folder (Markdown, HTML, PDF with an installed Chrome or Edge, AI report and work order, JSON) slop-detector --project . --report-dir slop-report
JSON for scripts (UTF-8, safe on Windows PowerShell) slop-detector --project . --json --output slop.json
Fail a CI build slop-detector --project . --ci-mode hard --ci-report
No install uvx ai-slop-detector --project . or npx ai-slop-detector --project .

Every command and option: docs/GUIDE.md.

What You Get

The terminal screen (slop-detector --project examples/demo_project): the score and its band, the findings by severity, the first findings with the rule and the reason, and what to do next.

Terminal summary of examples/demo_project

--details prints the full metric tables, --quiet one line.

The HTML report (-o report.html; -o report.pdf prints the same page): every finding with its fix and evidence, and the review candidates apart from the score.

HTML report of examples/demo_project

Outputs for AI agents, made to be acted on, not read:

Output What it is
--format ai-md (AI work order) Markdown for an agent: the rules it must follow, a VERIFY question per rule, every file bound to the SHA-256 of the bytes scanned, one block per item. It is read back before it is written and refuses when an item is missing or doubled.
--format ai (AI report) One JSON object per line: each finding with its location, rule, fix and evidence.
--json The full result, including scan_coverage (what was measured and how) and next_steps.

Details: docs/REPORTS.md · docs/AI_WORK_ORDER.md · what you get, in the guide.

Languages

Language Files Read by (base install) Optional extra (Python 3.10+) Rules
Python .py Python AST - 37
JavaScript / TypeScript .js .jsx .ts .tsx regex reader (god functions, dead code and complexity are not measured) [js]: tree-sitter, measures all 8 8
Go .go regex reader, measures every Go rule [go] installs tree-sitter-go; the analyzer does not use it yet 6
Rust .rs token scanner, measures every Rust rule [rust]: tree-sitter, same findings 4
pip install "ai-slop-detector[js]"     # or [rust]; on Python 3.8/3.9 the base install reads these files

Rule counts come from the pattern registry in docs/PATTERNS.md (55 rules), which a test keeps in line with the analyzers. A scan says which reader ran for each language (scan_coverage.analysis_modes).

What It Detects

Language Example Rules (sample)
Python a function that returns a constant where its docstring promises a computed result; a handler that turns a failure into success; a parameter nothing reads; an import of a package that does not exist return_constant_stub, failure_as_success, ignored_parameter, phantom_import
JavaScript / TypeScript any types, empty arrow functions, ==, leftover console.log js_any_type, js_empty_arrow, js_double_equals, js_console_log
Go ignored errors, panic() as error handling, empty functions go_ignored_error, go_panic, go_empty_func
Rust todo!() and unimplemented!() outside test code, leftover dbg!() rust_todo_macro, rust_unimplemented_macro, rust_dbg_macro

Python files also get hollow review candidates: functions that report success with no effect, inputs that reach nothing, docstring promises the body cannot keep. They are listed for review and never change the score.

All 55 rules: docs/PATTERNS.md.

How It Works

flowchart TD
    A["Project or file"] --> B{"Language by file extension"}
    B -->|.py| P["Python<br/>AST, 37 rules<br/>LDR, ICR, DDC, Purity"]
    B -->|.js .jsx .ts .tsx| J["JavaScript / TypeScript<br/>tree-sitter or regex, 8 rules"]
    B -->|.go| G["Go<br/>regex reader, 6 rules"]
    B -->|.rs| R["Rust<br/>tree-sitter or token scanner, 4 rules"]
    P --> F["File score 0-100<br/>higher = more warning signs"]
    J --> F
    G --> F
    R --> F
    P --> H["Hollow review candidates<br/>Python only, not scored"]
    F --> S["Project score<br/>weighted by lines of code"]
    S --> O["Terminal, Markdown, HTML/PDF,<br/>JSON, AI work order"]
    H --> O
    S --> C["CI gate: soft, hard, quarantine"]
    F --> V["VS Code: line marks, hover, Problems"]

The same input gives the same output: scoring is deterministic and needs no model or network. Details: docs/HOW_IT_WORKS.md.

Scoring Model

Score Status
< 30 CLEAN
30 - 50 SUSPICIOUS
50 - 70 INFLATED_SIGNAL
>= 70 CRITICAL_DEFICIT
  • Higher score = more warning signs. Each file gets a deficit score from 0 to 100; the project score weights files by their lines of code.
  • CLEAN is a score band, not "no findings". A clean project can still have open findings; its next steps then say how many, and how many are critical or high.
  • Nothing measured is not clean. When no file could be analyzed, reports read NOT EVALUATED, and --fail-threshold fails.
  • Findings are leads, not verdicts. The tool reads code statically: it does not run it.

How the score is computed: the scoring model in the guide and docs/MATH_MODELS.md.

VS Code Extension

Findings where you write code, for all four languages: a tint and a severity bar on the line, the message at the end of it, a hover with the Fix and a link that copies a work order for an AI agent, the Problems panel, a sidebar of files by score, and the file score in the status bar. It runs the same local backend; nothing is sent anywhere.

Install from the Marketplace · extension guide

CI/CD Integration

# GitHub Actions
- name: AI-SLOP Gate
  run: |
    pip install ai-slop-detector
    slop-detector --project . --ci-mode hard --ci-report
Mode What it does
--ci-mode soft Reports only, never fails the build
--ci-mode hard Fails on a deficit score >= 70, 3 or more critical patterns, inflation >= 1.5 or DDC < 0.5 (inflation and DDC are Python metrics)
--ci-mode quarantine Escalates a file after 3 violations

The gate judges every analyzed file: Python, JS/TS, Go and Rust. pre-commit hooks (slop-detector, slop-detector-warn, slop-detector-patterns) and more: CI/CD in the guide · docs/CI_CD.md.

AI Agents

Surface How
MCP server slop-detector mcp (or npx ai-slop-detector mcp) for Claude Code and other MCP clients
Claude Code skill cp -r claude-skills/slop-detector ~/.claude/skills/: a review loop of review, pulse, sweep with JSON output
AI work order --format ai-md, bound to the SHA-256 of each scanned file (see What You Get)
REST A local FastAPI server ([api] extra) that binds 127.0.0.1
Node npx ai-slop-detector runs the same Python backend; typed results at ai-slop-detector/types

Details: Claude Code integration · docs/CLAUDE_CODE_SKILL.md · docs/API.md.

Local Calibration

Every scan is recorded locally (~/.slop-detector/history.db) with what measured it. slop-detector . --self-calibrate reports how the weights would change from the comparable runs of one project. It is advisory: it never writes weights; you change them in .slopconfig.yaml if you agree. slop-detector --init detects the project's domain and sets that domain's pattern thresholds, printing every change. Local calibration in the guide · docs/SELF_CALIBRATION.md.

Security Considerations

  • No network during a scan. A test runs a full project scan with every socket connection refused and requires that none was attempted.
  • --read-only writes nothing to the project or the home directory.
  • history.db lives in your home directory, outside every repository.
  • .slopconfig.yaml lists which functions are exempt from complexity rules, so it maps the weak spots of a codebase; --init adds it to .gitignore (remove that line to share it with your team).
  • Reports describe your code. Every report names file paths, function names and docstring text, and the AI work order (auditor mode) quotes code lines: share them as you would the code.

More: security considerations in the guide · SECURITY.md.


Why Not Just Use a Linter?

Ruff, pylint, ESLint, and SonarQube primarily check syntax, style, and general static-quality rules. They'll happily pass code that follows every rule and still does nothing — which is exactly what AI assistants tend to produce. This tool checks the other half: does the code contain structural evidence for what it and its docs claim? Structural evidence is not proof that a claim is true; the tool does not run your code.

Can it catch... ruff / pylint / SonarQube AI-SLOP Detector
Style, formatting, syntax Yes No (not its job)
An empty function with a real-looking body or fake return No Yes
A module imported but never actually used downstream Partial (unused-import) Yes (usage ratio)
A handler or pipeline that's defined but never wired in No Yes
Docs or comments that oversell what the code does No Yes
Copy-pasted duplicate functions across files Partial Partial (exact duplicates)
Runs offline, no API key, deterministic core score Yes Yes

Use a linter for correctness-of-form. Use this for "is this code real, or just plausible-looking." The two are complementary — run both.

When NOT to Use This

  • You want style or formatting enforcement — use ruff / black / ESLint. This tool ignores style on purpose.
  • You need a runtime correctness guarantee — a low score means cleaner structure, not that the code works. Keep your tests.
  • Your code isn't Python, JS/TS, Go or Rust — other languages aren't analyzed yet.
  • You expect thresholds tuned to your repository — weights are the defaults or the values in your .slopconfig.yaml; nothing tunes them automatically. Treat findings as leads, not verdicts.

How Results Are Checked

Deterministic The same input gives byte-identical JSON across cache, hash seed, Rust helper and working directory; --read-only writes nothing to the project or the home directory.
Says when it measured nothing Every project result carries measurement_state (COMPLETE, PARTIAL, NO_MEASUREMENT) and score_valid. When nothing was measured, human reports read NOT EVALUATED instead of a clean verdict, and a scan whose files all failed to analyze fails --fail-threshold.
Its own tests are tested More than 1,900 tests run in CI on Python 3.8 to 3.12. Behavior changes are checked against deliberately broken copies of the code (mutation testing): in v3.14.0, 133 of 133 breakages of the item identity, binding, work-order and docstring-promise rules were caught; in v3.15.0, 24 of 24 breakages of the work-order families, file table, read-back check and budget (v3.12.0: 21 of 21).
Rules state their reasons Each rule ships with tests that name the code shape it reports and the shapes it leaves alone; the CHANGELOG records every behavior change.

Release Highlights

v3.16.1: Rust files are analyzed (todo!(), unimplemented!(), dbg!(), TODO comments) and judged by the CI gate like the other languages; Go and JS/TS regex readers no longer report text inside strings or comments; the CI report states its verdict and lists files it could not analyze. Every release: docs/RELEASE_NOTES.md · CHANGELOG.md.

Document Map

The full guide holds everything this page leaves out: docs/GUIDE.md.

Topic Where
Every command, the npm wrapper All commands · CLI usage
Reports Reports · AI work order
Rules and analyzers Patterns · What it detects · Adding a language
Scoring and metrics How it works · Math models · Validation
Configuration Configuration guide · Examples · History tracking
Architecture Architecture · Governance · Agent workflow
Releases Release notes · Changelog · Roadmap

More sections of the guide (old links to this page land here):

Development

git clone https://github.com/flamehaven01/AI-SLOP-Detector.git
cd AI-SLOP-Detector
pip install -e ".[dev]"
pytest tests/

Development guide · Contributing · development in the guide.

Download Stats

PyPI weekly downloads

Chart updated weekly via GitHub Actions. Monthly installs: pypistats.org (mirrors excluded). Total: pepy.tech (incl. mirrors)

License

MIT — see LICENSE.


Flamehaven Labs • Issues • Discussions • Docs

Metadata

Release files for ai-slop-detector 3.16.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 ai-slop-detector 3.16.1
File Size Uploaded Provenance Actions
ai_slop_detector-3.16.1.tar.gz 501.7 kB With provenance Details for ai_slop_detector-3.16.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-slop-detector 3.16.1
File Interpreter ABI Platform Actions
ai_slop_detector-3.16.1-py3-none-any.whl Python 3 none any Details for ai_slop_detector-3.16.1-py3-none-any.whl

Total release size: 977.2 kB

Release files / ai_slop_detector-3.16.1.tar.gz

Download URL ai_slop_detector-3.16.1.tar.gz
Size 501.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1a0ba8748103424a5e57fea7b0992768cc2261016089d880b732e0b181fd591e
BLAKE2b-256 checksum
How to use checksums
7acc04ecbf2f2fd9f5d83764a0d9f16d66a00618a465d82c4e9a0b9893c19809
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 17, 2026.

Transparency log

Release files / ai_slop_detector-3.16.1-py3-none-any.whl

Download URL ai_slop_detector-3.16.1-py3-none-any.whl
Size 475.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8236dd1848b94fa2dda45ab4404a512cd20df8001f1ff8c6bfd0de543770327c
BLAKE2b-256 checksum
How to use checksums
edccbb4947f606ed9737588bc2cdfad24b25ed482b172aede63d04cfacda470b
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 17, 2026.

Transparency log

Security for ai-slop-detector 3.16.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 ai_slop_detector-3.16.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 17, 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.

Release history Release notifications | RSS feed

This release

3.16.1 This release

2 release files Full provenance

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