Skip to main content
← Blog
Guide4 min read

What Is aislop? The Open-Source AI Slop Code Detector, Explained

The CLI, the score, the rules, and the three places to run it: your terminal, CI and your coding agent.

aislop is an open-source CLI that detects AI slop in code. It scans a repository, reports each finding with file and line, and gives the project a score from 0 to 100. It is built for code written with Claude Code, Cursor, Codex and similar agents, where tests and lint pass but the code still carries swallowed errors, comments that narrate the obvious, unsafe casts and leftovers from earlier drafts. This page is the short answer to "what is aislop"; the product page and docs have the long one.

npx aislop@latest scan

aislop and scanaislop.com

  • aislop is the CLI, MIT-licensed, at github.com/scanaislop/aislop. It is published to npm and PyPI as aislop and to Homebrew as scanaislop/tap/aislop.
  • scanaislop.com is its website: docs, this blog, the changelog, public report pages at scanaislop.com/<owner>/<repo>, a browser scan at /try, and the GitHub app that runs the same scan on pull requests.

How the AI slop code detector works

A scan runs five engines over the files in scope and combines their findings into one score:

EngineWhat it checks
FormattingThe project's formatter (Biome, ruff, gofmt and others) in check mode
LintingBug-finding lint rules, such as oxlint for JS/TS and ruff for Python
Code QualityFunction and file size, nesting depth, parameter count, duplicate blocks, unused code
AI SlopAgent-specific patterns: narrative and trivial comments, swallowed exceptions, unsafe type assertions, hallucinated imports, hardcoded URLs, console leftovers, todo stubs, unused CSS
SecurityHardcoded secrets, eval and innerHTML, SQL and shell injection, vulnerable dependencies

The rules are deterministic pattern and AST checks. There is no model call while scanning, so a scan is fast (small projects finish in well under a second) and repeatable: the same code at the same aislop version always gets the same score. That property is what makes it usable as a merge gate. The rules reference lists every rule, and scoring explains the weights.

What a finding looks like

  > AI Slop
  [ERROR] Empty catch block swallows errors silently
    src/signup.ts:14
    Handle errors explicitly: log with context, rethrow, or return an error value

  [WARN] 'as any' bypasses type safety
    src/signup.ts:12
    Use a proper type or a more specific assertion

That is real output from aislop 0.20.0. The full run, with the code it came from, is in another AI slop code example, scanned and the code behind a generated landing page.

How aislop differs from a linter

A linter checks whether code follows language and style rules. aislop runs a linter as one of its engines, then adds rules for things linters usually allow because they are legal code:

  • A comment that restates the next line is valid syntax. ai-slop/trivial-comment flags it.
  • A catch block with only a comment inside compiles. ai-slop/swallowed-exception reports it as an error.
  • An import of a package that is not in your manifest may only fail at runtime. ai-slop/hallucinated-import catches it at scan time.
  • A staging URL in source passes every type check. ai-slop/hardcoded-url flags it.

It also turns everything into one number per project, which is easier to gate on than a lint error count. aislop does not replace your linter config; it uses it. For a longer comparison with other tools, see AI code quality tools in 2026.

Where to run it

Locally

npx aislop@latest scan          # whole project
npx aislop@latest scan --changes # only files changed against HEAD
npx aislop@latest fix            # remove mechanical findings

Bun, pnpm, Homebrew and pip work too; see bunx aislop scan and --share.

In CI

- run: npx --yes aislop@latest ci

aislop ci prints JSON and exits non-zero when the score is below your threshold or an error-severity finding is present. aislop init writes the config and a GitHub Actions workflow for you, and aislop baseline write lets an existing codebase fail only on new findings. See CI docs.

As an agent hook

npm install -g aislop
aislop hook install --claude   # or --cursor, --gemini, --pi

The hook scans each file the agent edits and returns the findings to the agent in the same turn, so it fixes them before you review. See agent hooks.

What it does not do

  • It does not guess whether a person or a model wrote the code. It reports patterns.
  • It does not judge intent. A change that is clean but solves the wrong problem scores fine.
  • It does not upload your code. Scans run locally. Usage telemetry is on by default and documented, with an opt-out, in the telemetry docs.

For the full background on slop detection, read the AI slop detector guide. To see a score without installing anything, scan a public repo in the browser, or go back to the scanaislop.com homepage.

Frequently asked questions

What is aislop?

aislop is an MIT-licensed command-line tool that scans a codebase for patterns AI coding agents tend to leave behind, such as swallowed exceptions, narrative comments, as any casts, hallucinated imports and dead code, and scores the result from 0 to 100.

Is aislop the same as scanaislop.com?

scanaislop.com is the website for aislop. It hosts the docs, the blog, public report pages for GitHub repos and a GitHub app. The CLI is at github.com/scanaislop/aislop and on npm, PyPI and Homebrew as aislop.

Does aislop use an LLM to detect AI slop?

No. Detection is deterministic: there is no LLM in the runtime path, so the same code always gets the same score. An LLM only comes in if you hand findings to your own coding agent with aislop fix or aislop agent.

Does aislop tell me whether code was written by AI?

No. It flags patterns that make code worse regardless of who wrote them. The patterns are common in agent output, which is why the rules are tuned for them.

Which languages does aislop support?

TypeScript, JavaScript, Expo / React Native, Python, Go, Rust, Ruby, PHP, Java, C# and C/C++.

Is aislop free?

The CLI is free and open source. Run it with npx aislop@latest scan, no account needed.

All posts