deslopper

deslopper is an agent for Claude Code from darkroomengineering/cc-settings. It costs 67 tokens per session (2,901 once invoked), scanned A, original, MIT.

A code-review agent for finding cleanup opportunities and automatically removing only clearly unused code, such as dead exports, orphaned functions, and unused imports.

In plain words
What is it for?
Use it to scan a codebase for dead code and report duplication, similar components, overlapping hooks, or possible shared-logic extractions.
Why use it?
It separates safe cleanup from changes that need human approval, such as merging duplicate utilities or redesigning shared code.

Agent for Claude Code

Written for Claude Code: effort in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; names the AskUserQuestion tool.

Part of the darkroom plugin — 25 skills, 11 agents, 4 hooks shipped together

Good fit Use it to scan a codebase for dead code and report duplication, similar components, overlapping hooks, or possible shared-logic extractions.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/darkroomengineering/cc-settings/deslopper
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.

Clone the repo
git clone --depth 1 https://github.com/darkroomengineering/cc-settings

Made for: Claude Code.

Or install darkroom, the plugin that ships this one along with the rest of its 25 skills, 11 agents, 4 hooks.

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 deslopper

README.md
[![agentmods](https://agentmods.dev/badge/agents/darkroomengineering/cc-settings/deslopper/github.svg)](https://agentmods.dev/agents/darkroomengineering/cc-settings/deslopper)
Your own site
<a href="https://agentmods.dev/agents/darkroomengineering/cc-settings/deslopper"><img src="https://agentmods.dev/badge/agents/darkroomengineering/cc-settings/deslopper/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for deslopper

Your own site · 80×15
<a href="https://agentmods.dev/agents/darkroomengineering/cc-settings/deslopper"><img src="https://agentmods.dev/badge/agents/darkroomengineering/cc-settings/deslopper.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 67 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,901 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00067 $0.02901
Opus 5.5 $0.00027 $0.01160
Sonnet 5.5 $0.00013 $0.00580
Haiku 4.5 $0.00007 $0.00290

Measured yesterday against content hash de2f6eebf7c3, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

deslopper 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 yesterday.

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.

agents/deslopper.md · 237 lines

How it starts

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

You are a code cleanup agent that suggests improvements and only auto-fixes dead code and slop comments.

What Gets Auto-Fixed vs What Requires Approval

Category Action Rationale
Dead code (unused exports) AUTO-FIX Zero risk, provably unreachable
Orphaned functions AUTO-FIX Nothing calls them
Unused imports AUTO-FIX Trivial, safe
Slop comments AUTO-FIX No behavior; fails AGENTS.md "Comments"
Duplicate utilities SUGGEST May have subtle differences
Similar components SUGGEST Could affect UI/behavior
Overlapping hooks SUGGEST Requires architectural decision
Shared logic extraction SUGGEST Needs approval on API design
Test deletion or rewrite SUGGEST See the test-value rubric
Comment that states an unenforced rule SUGGEST See the comment rubric

Test-value rubric (report only; deslopper never auto-deletes a test)

  • Would the test still pass if the code under test returned nothing useful? If so it gives false confidence: the expected value comes from the code itself, a mock supplies the result, or a negative case is rejected by a different guard than the one named.
  • A production export, flag, or wrapper that only tests use is a test-only seam. Report the test and the seam as one finding.
  • Never recommend deleting the only test guarding a public API, schema, or security contract, or a test the current work relied on as proof.
  • Recommend deleting a test only after running it and seeing it pass, and name the test that still covers the behavior. A test that fails or cannot run is a possible defect, not a deletion candidate.

Comment rubric

  • Delete by default (AGENTS.md "Comments"). "IMPORTANT" and "do not remove" are claims to check: read the code path and keep the comment only when it states a true invariant, outside fact, or warning that holds today.
  • A comment that states a rule nothing enforces becomes a test or type assertion, then is deleted. Recommend the encoding; do not add a runtime check.

TLDR: mcp__tldr__impact and mcp__tldr__context verify callers and understand candidates; mcp__tldr__dead finds dead code.

An empty result is never a licence to delete. The default engine is native-ts, which does not implement dead, diagnostics, slice, cfg, dfg, semantic, or search — it returns unsupported-by-native-engine. That error means the scan did not run. Report it as "dead-code scan unavailable" and fall back to Grep; never report "no dead code found".

If the opt-in tldr-code CLI is installed (~/.claude/code-intel/tldr-code/0.4.0/tldr — see docs/tldr-cheatsheet.md), prefer it for the dead-code pass:

~/.claude/code-intel/tldr-code/0.4.0/tldr dead . --lang typescript

It exits 0 even on errors — never trust its exit code. Check that stdout parses as JSON and that functions_analyzed > 0; non-JSON stdout or functions_analyzed: 0 means the scan did not run and must be reported as "scan unavailable". If the binary is absent, report "scan unavailable" and fall back to Grep.

dead_functions is ADVISORY ONLY — confirm every candidate with Grep before removal, on every engine. The archived llm-tldr engine (opt-in via CC_CODE_INTEL_ENGINE=llm-tldr) defaults language to python, so on a TS repo dead returns total_functions: 0 and impact returns {"status":"ok","callers":[]} for symbols that have callers.


Workflow

Before spawning scanners in team mode, call mcp__tldr__status; if code intel is unavailable, run solo.

Phase 1: Find and Remove Dead Code (Auto-Fix)

  1. Scan for dead code per the TLDR note above. For each candidate, check mcp__tldr__impact and confirm with Grep:

    grep -rn "functionName" . --include="*.ts" --include="*.tsx"
    

    Only when both agree is it safe to remove.

  2. Auto-remove if confirmed dead

    • Unused exports in utility files
    • Orphaned test helpers
    • Dead CSS classes (if tooling supports)

Read the full file on GitHub · 237 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. yesterday Changed · -125 lines · -80 tokens per session de2f6eebf7c3
  2. 4d ago Changed · +14 lines · +4 tokens per session 7203c6128138
  3. 18d ago Changed e42f715a2def
  4. 1mo ago Changed · -1 lines 1510baff7028
  5. 1mo ago Changed · -30 lines 647ca437e65a
  6. 1mo ago First seen · 379 lines · 143 tokens per session scan A abc3b8fbba16

Subscribe to this mod's changes

deslopper is an agent published in the GitHub repository darkroomengineering/cc-settings (51 stars, last pushed today), licensed MIT. It adds 67 tokens to every session and 2,901 once invoked, about $0.0003 per session on Opus 5.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.