Remove AI-Generated Code Slop

VerifiedSafe

Detects and removes extraneous code patterns commonly introduced by AI assistants, such as redundant comments, overly defensive checks, unnecessary type casts, and verbose error handling. Helps maintain consistency with the existing codebase after AI-generated changes are merged.

Sby Skills Guide Bot
DevelopmentIntermediate
606/2/2026
Claude Code
#ai-slop#code-cleaning#defensive-checks#verbosity

Recommended for

Our review

Cleans up code by removing AI-generated artifacts such as superfluous comments, excessive defensive checks, and unnecessary try/catch blocks.

Strengths

  • Removes redundant comments while preserving useful ones
  • Eliminates `any` casts and over-engineered patterns
  • Preserves actual bug fixes and intended functionality

Limitations

  • May remove comments that some developers consider important
  • Does not replace a thorough manual review
  • Only operates on the diff against the main branch
When to use it

Use this skill after generating code with an AI to make it more natural and consistent with project conventions.

When not to use it

Avoid using it on manually written code or when reviewing human-authored code.

Security analysis

Safe
Quality score88/100

The skill uses standard development tools (Bash, Read, Edit, Grep) to analyze and edit code within a local repository. It does not instruct any destructive actions, data exfiltration, or execution of external payloads. The operations are confined to code cleanup, posing no meaningful security risk.

No concerns found

Examples

Deslop entire branch
Remove AI slop from my current branch
Clean up verbose code
Deslop the changes in this PR
Remove defensive checks
Remove unnecessary try/catch blocks and redundant null checks from the new code

name: deslop description: Use when removing AI-generated slop, cleaning up verbose code, or removing unnecessary defensive checks. Triggers on "remove slop", "clean up AI code", "deslop". allowed-tools:

  • Bash
  • Read
  • Edit
  • Grep

Remove AI Code Slop

Check the diff against main and remove all AI-generated slop introduced in this branch.

Usage

/deslop

What It Removes

  • Extra comments that a human wouldn't add or are inconsistent with the rest of the file
  • Extra defensive checks or try/catch blocks that are abnormal for that area of the codebase (especially if called by trusted/validated codepaths)
  • Casts to any to get around type issues
  • Over-engineered patterns that don't match the file's existing style
  • Unnecessary type annotations on obvious types
  • Verbose error handling where simpler patterns exist
  • Redundant null checks in already-validated paths
  • Excessive logging beyond what's normal for the codebase

What It Preserves

  • Actual bug fixes and intended functionality
  • Comments that provide genuine value
  • Defensive code at trust boundaries (user input, external APIs)
  • Type annotations that improve clarity

Process

  1. Gets diff between current branch and main
  2. Reviews each changed file for AI slop patterns
  3. Removes slop while preserving intended changes
  4. Reports a 1-3 sentence summary of what was changed

Output

A brief summary like:

"Removed 3 unnecessary try/catch blocks in query.py, deleted 5 redundant comments in handler.ts, and removed 2 any casts that were hiding type issues."

Related skills