ql-deslop

ql-deslop is a skill for Claude Code, Codex from andyzengmath/quantum-loop. It costs 83 tokens per session (2,531 once invoked), scanned A, original, MIT.

A post-review cleanup step for AI-written code. It checks only changed files for duplication, unused code, unnecessary wrappers, broken module boundaries, and untested paths, then requires regression tests before keeping proposed deletions.

In plain words
What is it for?
Cleaning a story or feature after review approval and before merging it into the feature branch.
Why use it?
Code can meet requirements while still containing extra or unused pieces that make it harder to maintain or hide defects.

Skill for Claude CodeCodex

Part of the quantum-loop plugin — 10 skills, 10 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/andyzengmath/quantum-loop/ql-deslop
Any agent
npx skills add andyzengmath/quantum-loop --skill ql-deslop
Clone the repo
git clone --depth 1 https://github.com/andyzengmath/quantum-loop

Made for: Claude Code, Codex.

Or install quantum-loop, the plugin that ships this one along with the rest of its 10 skills, 10 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ql-deslop

README.md
[![agentmods](https://agentmods.dev/badge/skills/andyzengmath/quantum-loop/ql-deslop.svg)](https://agentmods.dev/skills/andyzengmath/quantum-loop/ql-deslop)
Your own site
<a href="https://agentmods.dev/skills/andyzengmath/quantum-loop/ql-deslop"><img src="https://agentmods.dev/badge/skills/andyzengmath/quantum-loop/ql-deslop.svg" alt="Measured on agentmods" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,531 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00083 $0.02531
Opus 5 $0.00042 $0.01265
Sonnet 5 $0.00017 $0.00506
Haiku 4.5 $0.00008 $0.00253

Measured 3d ago against content hash e3d56d61914b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ql-deslop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/ql-deslop/SKILL.md · 197 lines

How it starts

The opening of the file, as written. The whole thing — 197 lines — stays where its author put it; the contents beside it link to each section on GitHub.

ql-deslop — post-review AI-slop cleanup

Purpose

Review approval does not mean the code is clean. LLM-authored code routinely introduces:

  • Duplication of helpers / types / imports under slightly different names.
  • Dead code — functions added but never called; exports that no consumer uses.
  • Needless abstraction — factory for one caller; wrapper that only aliases; configurable field never varied.
  • Boundary violations — private functions accessed via string names; cross-module reaches that skip the public API.
  • Missing tests — paths and branches not exercised by any test.

Per Schreiber & Tippe 2025, 12.1% of AI-generated files contain ≥1 CWE, and per Zhong et al. 2026 (278k conversations) AI suggestions increase cyclomatic complexity 10-50× more than human edits. Without an explicit cleanup step, every autonomous run accumulates slop.

ql-deslop adds an explicit cleanup pass AFTER the story's review gate passes but BEFORE the merge to the feature branch. Borrowed directly from OMC Ralph Steps 7.5 (deslop) + 7.6 (regression re-verify).

When to use

  • Automatically, as a mandatory step between ql-review PASS and the git merge in ql-execute.
  • Manually, at any point after a story is implemented, to clean up before review.
  • After absorbing a foreign branch (CPC promotion, cherry-pick) — the absorbed work may carry slop.

Opt-out

Single flag: --no-deslop. Used only when:

  • The story is a pure test addition (nothing to clean).
  • The deslop pass itself was run earlier in the same wave on the same files.
  • The user explicitly demands skip (rare; recorded in commit trailer Deslop: skipped | <reason>).

Scope — strict file-list only

The deslop pass operates on git diff --name-only BASE_SHA..HEAD_SHA — the EXACT files the story touched. It never broadens scope silently. Reaching into unchanged files is an anti-pattern and is explicitly forbidden.

Smell taxonomy — 5 categories

1. Duplication

Detectors:

  • Identifier similarity across changed files: extract top-level symbol names; flag near-duplicates (e.g., parseRequest / parseReq / handleParse) via Levenshtein or canonical-alpha-rename + exact match (per HyClone arXiv:2508.01357).
  • Function-body AST hash: for each function in the diff, compute tree-sitter AST hash after alpha-renaming; flag duplicates across files.
  • Import redundancy: same module imported as different names in sibling files.

Read the full file on GitHub · 197 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 197 lines · 0 tokens per session scan A e3d56d61914b

Subscribe to this mod's changes

ql-deslop is a skill published in the GitHub repository andyzengmath/quantum-loop (24 stars, last pushed 2mo ago), licensed MIT. It adds 83 tokens to every session and 2,531 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories