scanaislop/aislop
Open-source code-quality scanner for AI-assisted development. Catch dead code, unsafe casts, swallowed errors, and duplication locally or in CI. Deterministic rules, no LLM at runtime.
aislop — Catch the slop AI coding agents leave in your code
aislop is a command-line tool that scans your codebase for the messy patterns that AI coding assistants (like Claude Code, Cursor, Codex, and OpenCode) tend to leave behind. It gives your code a score from 0 to 100, runs in under a second, and is fully deterministic — the same code always gets the same score, with no AI involved in the analysis itself.
What it detects
It looks for over 50 different issues across 12 programming languages (TypeScript, JavaScript, Expo/React Native, Python, Go, Rust, Ruby, PHP, Java, Scala (beta), C#, and C/C++). Examples of the "slop" it catches:
- Narrative comments above code that is already self-explanatory
- Swallowed exceptions (ignored errors)
- Hidden fallbacks that might mask bugs
as anytype casts- Hallucinated imports (imports that don't exist)
- Duplicated helper functions
- Dead code
- TODO stubs
- Oversized functions
It also covers formatting, linting, complexity, and security checks.
How it works
You run aislop scan on your project (or a specific folder) and it immediately reports a score and a list of findings. The scanner is deterministic — it uses static analysis rules, not a language model, so results are consistent and fast.
Key commands
aislop scan— Score the current directory (or a specific path). Options let you scan only changed files (--changes), staged files (--staged), or compare against a base branch (--base). Output can be plain text, JSON, or SARIF (for GitHub code scanning).aislop fix— Automatically fix purely mechanical issues (unused imports, dead code, formatting). Use--safefor only reversible fixes, or-ffor aggressive fixes (removing dependencies, unused files). You can also hand off remaining issues to your coding agent with--claude,--codex, etc.aislop agent— Runs a local repair session using your installed coding agent (Codex, Claude Code, OpenCode, etc.). It creates a temporary worktree, applies safe fixes, streams the agent's repair, verifies with a scan, and leaves the diff for review. Can also open a PR (--pr) or apply directly (--apply).aislop hook install— Installs a hook that runs after every agent edit, giving immediate feedback. Supports quality-gate mode to block if the score regresses.aislop ci— CI mode: outputs JSON and exits with code 1 if the score falls below a threshold. Can gate only the files a PR changes.aislop baseline— Accept current findings as a baseline; CI then only fails on new issues.aislop init— Creates a.aislop/config.ymlfile (with--strictfor an enterprise-grade setup).aislop doctor— Checks which analysis engines can run on your machine.aislop rules— Lists all rules with severity, fixability, and score impact.aislop trend— Shows score history over time (stored locally in.aislop/history.jsonl).aislop badge— Generates a public badge URL for your README.aislop share(viascan --share) — Prints a public report link for GitHub repos (no upload; the page scans the public repo itself).
Installation
The same CLI is available through multiple package managers:
- npm:
npm install -g aislopor run without installing vianpx aislop@latest scan - Yarn:
yarn dlx aislop scan - Bun:
bunx aislop scanorbun add -g aislop - Homebrew:
brew install scanaislop/tap/aislop - PyPI:
pipx install aislop(needs Node.js on PATH)
Configuration
You can customize behavior with a .aislop/config.yml file:
- Exclude files/directories (e.g.,
**/*.test.ts) - Override rule severities (e.g., turn
ai-slop/narrative-commentinto a warning or off) - Extend a parent config
- Set CI thresholds
You can also suppress findings inline with comments like // aislop-ignore-next-line or // aislop-ignore-line, and ignore whole paths with an .aislopignore file.
Editor & MCP support
- A JSON Schema is provided for editor autocomplete/validation of the config file.
- An MCP server (
aislop-mcp) exposes tools (aislop_scan,aislop_fix,aislop_why,aislop_baseline) for use in Claude Desktop, Cursor, or Codex.
CI integration
- Pre-commit: Use
aislop scan --stagedor the bundled pre-commit hook. - GitHub Actions: Use
aislop initto generate a workflow, or add a self-contained action that always runs the latest CLI.
Notes
- Unsupported languages: If a repo is mostly a language not in the 12 supported, aislop withholds the score rather than giving a misleading number.
- Scala support is beta — coverage is still being refined.
- Optional tools: Some checks (e.g., Ruff, golangci-lint, Java formatters, security scanners) require additional setup — see the installation docs.
- No API keys required:
aislopitself never asks for OpenAI/Anthropic keys; it uses your existing agent CLIs' local auth.
License
MIT-licensed and free to use.
For full details, see the README and the linked docs.
Related
- Dispatch
- Project
- Project
- Project
- Project