{"slug": "show-hn-aislop-a-cli-for-catching-ai-generated-code-smells", "title": "Show HN: AISlop, a CLI for catching AI generated code smells", "summary": "AISlop, a new open-source command-line tool, now detects \"AI code smells\" left by coding agents like Claude Code and Cursor, analyzing code for issues such as narrative comments, swallowed exceptions, and dead code. The tool scores changes from 0 to 100 using over 40 deterministic rules across seven programming languages, operating without a language model in its runtime path. Released under an MIT license, AISlop aims to catch code rot that passes traditional tests and linters, offering auto-fix capabilities and integration hooks for popular AI coding agents.", "body_md": "**Catch the slop AI coding agents leave in your code.**\n\nThe patterns Claude Code, Cursor, Codex, and OpenCode leave behind: narrative comments above self-explanatory code, swallowed exceptions, `as any`\n\ncasts, hallucinated imports, duplicated helpers, dead code, todo stubs, oversized functions. Tests pass. Lint passes. The code rots anyway.\n\naislop catches them. 40+ rules across 7 languages (TS/JS, Python, Go, Rust, Ruby, PHP, Java). Scores every change 0–100. Sub-second. Deterministic — no LLM in the runtime path, same code in, same score out. MIT-licensed, free CLI.\n\n```\nnpx aislop scan\n```\n\nNo install needed. Works on any project. Get your score in seconds.\n\n```\nnpx aislop fix                   # auto-fix issues\nnpx aislop fix -f                # aggressive fixes (deps, unused files)\nnpx aislop ci                    # CI mode (JSON + gate)\nnpx aislop hook install --claude # per-edit hook\n```\n\n**Public badge**: Show your score on your README\n\n```\n[![aislop](https://badges.scanaislop.com/score/<owner>/<repo>.svg)](https://scanaislop.com)\n```\n\nRun `npx aislop badge`\n\nto auto-generate. Free at [scanaislop.com](https://scanaislop.com).\n\n```\n# Run without installing\nnpx aislop scan\n\n# npm\nnpm install --save-dev aislop\n\n# yarn\nyarn add --dev aislop\n\n# pnpm\npnpm add -D aislop\n\n# Global\nnpm install -g aislop\n```\n\nAlso available as [ @scanaislop/aislop](/scanaislop/aislop/blob/main/docs/installation.md) on GitHub Packages.\n\n```\nnpx aislop scan           # current directory\nnpx aislop scan ./src     # specific directory\nnpx aislop scan --changes # changed files from HEAD\nnpx aislop scan --staged  # staged files only\nnpx aislop scan --json    # JSON output\n```\n\n**Exclude files**: `node_modules`\n\n, `.git`\n\n, `dist`\n\n, `build`\n\n, `coverage`\n\nexcluded by default. Add more in `.aislop/config.yml`\n\n:\n\n```\nexclude:\n  - \"**/*.test.ts\"\n  - src/generated\n```\n\nOr via CLI: `npx aislop scan --exclude \"**/*.test.ts,dist\"`\n\n**Extend config**: Project config can extend a parent:\n\n```\n# .aislop/config.yml\nextends: ../../.aislop/base.yml\nci:\n  failBelow: 80             # override specific keys\n```\n\nAuto-fix what's mechanical (formatters, unused imports, dead code). For issues that need context, hand off to your agent with full diagnostic info.\n\n```\nnpx aislop fix                 # safe auto-fixes\nnpx aislop fix -f              # aggressive: deps, unused files\n```\n\nWhen auto-fix can't solve it, pass the remaining issues to your coding agent with full context:\n\n```\nnpx aislop fix --claude        # Claude Code\nnpx aislop fix --cursor        # Cursor (copies to clipboard)\nnpx aislop fix --gemini        # Gemini CLI\nnpx aislop fix --codex         # Codex CLI\n# Also: --windsurf, --amp, --aider, --goose, --opencode, --warp, --kimi, --antigravity, --deep-agents, --vscode\nnpx aislop fix --prompt        # print prompt (agent-agnostic)\n```\n\nRuns after every agent edit. Feedback flows back immediately.\n\n```\nnpx aislop hook install --claude           # Claude Code\nnpx aislop hook install --cursor           # Cursor\nnpx aislop hook install --gemini           # Gemini CLI\nnpx aislop hook install                    # all supported agents\nnpx aislop hook install claude cursor      # specific agents\n```\n\n**Runtime adapters** (scan + feedback): `claude`\n\n, `cursor`\n\n, `gemini`\n\n.\n\n**Rules-only** (agent reads rules): `codex`\n\n, `windsurf`\n\n, `cline`\n\n, `kilocode`\n\n, `antigravity`\n\n, `copilot`\n\n.\n\n**Quality-gate mode**: Blocks if score regresses below baseline.\n\n```\nnpx aislop hook install --claude --quality-gate\nnpx aislop hook baseline                    # re-capture baseline\nnpx aislop hook status                      # list installed\nnpx aislop hook uninstall --claude          # remove\n```\n\nDocs: `/docs/hooks`\n\nExpose aislop as MCP tools for Claude Desktop, Cursor, Codex:\n\n```\n// ~/.cursor/mcp.json or Claude Desktop config\n{\n  \"mcpServers\": {\n    \"aislop\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"aislop-mcp\"]\n    }\n  }\n}\n```\n\n**Tools**: `aislop_scan`\n\n, `aislop_fix`\n\n, `aislop_why`\n\n, `aislop_baseline`\n\n```\nnpx aislop ci                  # JSON output, exits 1 if score < threshold\nnpx aislop init                # create .aislop/config.yml\nnpx aislop init --strict       # enterprise-grade gate: all engines, typecheck, failBelow 85\nnpx aislop rules               # list rules\nnpx aislop badge               # print badge URL\nnpx aislop                     # interactive menu\n```\n\nDocs: [commands](/scanaislop/aislop/blob/main/docs/commands.md)\n\n```\nnpx aislop scan --staged\n```\n\nRun `npx aislop init`\n\nand accept the workflow prompt, or add manually:\n\n```\n- uses: actions/checkout@v4\n- uses: actions/setup-node@v4\n  with:\n    node-version: 20\n- run: npx aislop@latest ci .\n```\n\n**Composite action**:\n\n```\n- uses: actions/checkout@v4\n- uses: scanaislop/aislop@v0.8\n```\n\nSet minimum score in `.aislop/config.yml`\n\n:\n\n```\nci:\n  failBelow: 70\n```\n\n`aislop ci`\n\nexits 1 when score < threshold. Docs: [CI/CD](/scanaislop/aislop/blob/main/docs/ci.md)\n\n[scanaislop](https://scanaislop.com) is the hosted platform for teams:\n\n- PR gates with score thresholds\n- Standards hierarchy (org → team → project)\n- Dashboards and agent attribution\n- Visual rules manager\n\nSame engines, same scores. CLI is MIT-licensed. [Learn more →](https://scanaislop.com)\n\nAI coding tools generate code that compiles and passes tests but ships with patterns no engineer would write. `aislop`\n\ngives you one score, one gate, and auto-fixes what it can.\n\n**One score**: 0-100, enforced in CI. Weighted so sloppy patterns hit harder than style noise.** Auto-fix first**: Clears formatters, unused imports, dead code mechanically. Hands off the rest to your agent with full context.** Deterministic**: Regex + AST + standard tooling. No LLMs, no API calls. Same code in, same score out.** Zero-config start**:`npx aislop scan`\n\nworks on any repo. Add`.aislop/config.yml`\n\nto tune.\n\nSix deterministic engines run in parallel:\n\n| Engine | What it checks | How |\n|---|---|---|\nFormatting |\nCode style consistency | Biome, ruff, gofmt, cargo fmt, rubocop, php-cs-fixer |\nLinting |\nLanguage-specific issues | oxlint, ruff, golangci-lint, clippy, expo-doctor |\nCode Quality |\nComplexity and dead code | Function/file size limits, deep nesting, unused files/deps (knip), AST-based unused-declaration removal |\nAI Slop |\nAI-authored code patterns | Narrative comments, trivial comments, dead patterns, unused imports, `as any` , `console.log` leftovers, TODO stubs, generic names |\nSecurity |\nVulnerabilities and risky code | eval, innerHTML, SQL/shell injection, dependency audits (npm/pip/cargo/govulncheck) |\nArchitecture |\nStructural rules (opt-in) | Custom import bans, layering rules, required patterns |\n\nSee the full [rules reference](/scanaislop/aislop/blob/main/docs/rules.md).\n\n[Installation](/scanaislop/aislop/blob/main/docs/installation.md) · [Commands](/scanaislop/aislop/blob/main/docs/commands.md) · [Rules](/scanaislop/aislop/blob/main/docs/rules.md) · [Config](/scanaislop/aislop/blob/main/docs/configuration.md) · [Scoring](/scanaislop/aislop/blob/main/docs/scoring.md) · [CI/CD](/scanaislop/aislop/blob/main/docs/ci.md) · [Telemetry](/scanaislop/aislop/blob/main/docs/telemetry.md)\n\n[Discussions](https://github.com/scanaislop/aislop/discussions) for questions, rule requests, and false-positive triage · [Issues](https://github.com/scanaislop/aislop/issues) for bugs\n\nSee [CONTRIBUTING.md](/scanaislop/aislop/blob/main/CONTRIBUTING.md). AI assistants: [AGENTS.md](/scanaislop/aislop/blob/main/AGENTS.md).\n\nBuilt on: [Biome](https://biomejs.dev/), [oxlint](https://oxc.rs/), [knip](https://knip.dev/), [ruff](https://docs.astral.sh/ruff/), [golangci-lint](https://golangci-lint.run/), [expo-doctor](https://docs.expo.dev/)\n\nAuto-updated by `.github/workflows/contributors.yml`\n\n. [Link commit email](https://github.com/settings/emails) or add to [ .github/contributors-overrides.json](/scanaislop/aislop/blob/main/.github/contributors-overrides.json).", "url": "https://wpnews.pro/news/show-hn-aislop-a-cli-for-catching-ai-generated-code-smells", "canonical_source": "https://github.com/scanaislop/aislop", "published_at": "2026-05-29 13:37:38+00:00", "updated_at": "2026-05-29 14:13:30.688081+00:00", "lang": "en", "topics": ["ai-tools", "ai-agents", "ai-products", "ai-startups", "large-language-models"], "entities": ["Claude Code", "Cursor", "Codex", "OpenCode", "AISlop", "scanaislop.com", "GitHub", "MIT"], "alternates": {"html": "https://wpnews.pro/news/show-hn-aislop-a-cli-for-catching-ai-generated-code-smells", "markdown": "https://wpnews.pro/news/show-hn-aislop-a-cli-for-catching-ai-generated-code-smells.md", "text": "https://wpnews.pro/news/show-hn-aislop-a-cli-for-catching-ai-generated-code-smells.txt", "jsonld": "https://wpnews.pro/news/show-hn-aislop-a-cli-for-catching-ai-generated-code-smells.jsonld"}}