npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

karpeslop

v1.0.22

Published

The linter Andrej Karpathy wishes existed. Detects the three axes of AI slop with extreme prejudice.

Readme

KarpeSlop

npm version npm downloads License: MIT

"Because any is the mind virus of our generation." — probably @karpathy

What is KarpeSlop?

KarpeSlop is a fast, opinionated linter for detecting AI-generated code problems in TypeScript and JavaScript. Inspired by Andrej Karpathy's call for an "AI Slop Index," it detects the three axes of AI slop:

  1. Information Utility (Noise) — Redundant comments, boilerplate, debug logs
  2. Information Quality (Lies) — Hallucinated imports, incorrect assumptions, TODO placeholders
  3. Style / Taste (Soul) — Overconfident comments, hedging language, "vibe coding" patterns

Use case: Clean up code generated by Copilot, ChatGPT, Claude, or other AI coding assistants.

Quick Answers: Common Questions

Q: How do I check my code for AI slop?

npx karpeslop@latest

Q: What's the fastest way to scan for AI code quality issues? Run npx karpeslop@latest --quiet in your project directory. Takes ~4 seconds.

Q: How do I block AI slop in CI/CD? Use npx karpeslop@latest --strict — exits with code 2 if critical issues (like hallucinated imports) are found.

Q: Does KarpeSlop detect hallucinated imports? Yes! It catches imports like import { useRouter } from 'react' (should be 'next/router').

Q: What languages does KarpeSlop support? TypeScript, JavaScript, React, and Next.js. Python support is not yet available.


Installation

# Run once without installing (always gets latest version)
npx karpeslop@latest

# Or install globally
npm install -g karpeslop
karpeslop

Usage

Run in your project directory:

# Full scan (all files)
npx karpeslop@latest

# Quiet mode - only scan core app files (recommended for CI)
npx karpeslop@latest --quiet

# Show help
npx karpeslop@latest --help

# Show version
npx karpeslop@latest --version

# The tool generates a detailed JSON report at ./ai-slop-report.json

Command Line Options

  • --help, -h: Show help message
  • --quiet, -q: Run in quiet mode (only scan core app files)
  • --strict, -s: Exit with code 2 if critical issues found (for CI/CD)
  • --version, -v: Show version information

Exit Codes

  • 0: No issues found
  • 1: Issues found (warnings)
  • 2: Critical issues found (with --strict flag) — blocks CI

The Three Axes of AI Slop

  1. Information Utility (Noise): Comments, boilerplate, debug logs, etc.
  2. Information Quality (Lies): Hallucinated imports, incorrect assumptions, TODO placeholders, etc.
  3. Style/Taste (Soul): Overconfident comments, unnecessary complexity, "vibe coding" patterns, etc.

Features

  • AI Slop Detection: Identifies the three axes of AI-generated code problems
  • Type Safety Analysis: Detects improper use of any, unsafe type assertions
  • Comment Quality: Flags hedging, overconfident, and redundant comments
  • Import Validation: Catches hallucinated imports (e.g., React APIs in wrong packages)
  • Code Quality: Finds TODOs, assumptions, and poor coding practices
  • Educational Output: Shows fix suggestions and documentation links
  • CI/CD Ready: --strict flag for blocking on critical issues

Educational Output

Every issue includes actionable guidance:

📍 Pattern: any_type_usage
   💡 Fix: Replace with 'unknown' and use type guards
   📚 Learn more: https://www.typescriptlang.org/docs/handbook/2/narrowing.html

Configuration (Optional)

Create .karpesloprc.json in your project root:

{
  "customPatterns": [
    {
      "id": "banned_import",
      "pattern": "from\\s+['\"]lodash['\"]",
      "message": "Use lodash-es for tree-shaking",
      "severity": "medium",
      "fix": "Replace 'lodash' with 'lodash-es'"
    }
  ],
  "severityOverrides": {
    "magic_css_value": "low"
  },
  "ignorePaths": ["**/legacy/**"]
}

CI/CD Integration

GitHub Actions

- name: Check for AI Slop
  run: npx karpeslop@latest --quiet --strict

See .github/workflows/karpeslop.yml for a complete workflow example.

KarpeSlop Example Output

License

MIT — go forth and purge the slop.

💝 Support Development

Building and maintaining KarpeSlop takes time. If this tool saved you from shipping slop:

GitHub Sponsors

☕ Buy me a coffee • Help keep the slop detector alive