Glossary

What is AI slop in code?

Code that runs but carries the tells of being generated without care. It passes review because it looks tidy, and it makes the codebase harder to live with.

Updated October 1, 2026

Short answer. AI slop is code with the habits of a model that was rewarded for looking helpful: comments that narrate, defensive wrappers that do nothing, duplicated helpers and loosened tests. Each one is small; together they cost every future reader. Most of it can be found mechanically.

Common tells

  • Comments that restate the next line instead of explaining why.
  • try/catch blocks that only rethrow.
  • if (x) return true; else return false;
  • Placeholder comments like // ... rest of the code, left in a real file.
  • Duplicated logic next to a helper that already does the job.
  • Leftover debug logging and TODO stubs.
  • Tests loosened, skipped or deleted to get to green.

What it looks like

// Loop through the users
for (const user of users) {
  try {
    if (user.active) { return true; } else { return false; }
  } catch (e) {
    throw e;
  }
}

Three tells in eight lines: a comment that says what the code says, a catch that only rethrows, and an if/else that returns the condition. The loop also returns on the first user, which is either a bug the noise was hiding or should have been users[0]?.active; if every user was meant, it's users.some(u => u.active).

How it gets in

Models are rewarded for looking helpful, so they explain what they did in comments, wrap code in defensive blocks, and reach for a fresh helper rather than searching for the one that exists. Under pressure to make tests pass, they sometimes change the test instead of the code. None of it is malicious; all of it adds up.

Why it matters

Each tell is small. Together they add noise that every future reader pays for, hide the real logic in diffs, and weakened tests quietly remove the safety net the next change depends on.

Reviewing for it

  • Read the test changes first. A test that got looser in a bug fix is the most expensive kind of slop.
  • Search for an existing helper before accepting a new one.
  • Delete any comment that only repeats the code; keep the ones that say why.
  • Look for catches that don't handle anything, and logging nobody will read.

Getting rid of it with Macaron

macaron deslop finds the common JavaScript and TypeScript tells, and macaron deslop --fix applies the safe fixes; a fix that would add a syntax error is rejected and the file left as it was. It works without an API key, and exits with code 1 when it finds anything, so it can fail a pull request check.

macaron deslop src
macaron deslop --fix src --dry-run
macaron deslop src --json

In the desktop app, de-slop combines these rules with the open-source React Doctor CLI for React projects, and can hand the findings to a separate Claude Code or Codex chat to clean up.

Questions

Is all AI-written code slop?+

No. Slop is about care, not origin. The same tells show up in rushed human code.

Can a linter catch it?+

Some of it. Rethrow-only catches and boolean if/else returns are mechanical. Duplicated helpers and loosened tests need a reader who knows the codebase.

Which languages does macaron deslop cover?+

JavaScript and TypeScript. The desktop app adds React-specific checks through React Doctor.

Should I block pull requests on it?+

If the rules you pick have few false positives for your codebase, yes. Use --rules to choose them; deslop exits with code 1 when it finds anything.

How do I stop the agent writing it in the first place?+

Tell it which habits to avoid in your project instructions, ask it to check its own diff before finishing, and review tests first.

Keep reading