delete-this

delete-this is a skill for Claude Code from mikestangdevs/craft-skills. It costs 102 tokens per session (1,367 once invoked), scanned A, original, MIT.

A cleanup skill that finds code no longer needed and removes it after checking that it is unused. It looks for dead branches, unused exports, commented-out blocks, obsolete feature flags, one-use abstractions, and stale TODOs.

In plain words
What is it for?
Use it before adding features to a cluttered area or when you suspect dead code, to safely investigate and remove unused branches, flags, exports, comments, abstractions, and TODOs.
Why use it?
It reduces clutter that makes a codebase harder to understand and change. Removing proven-dead code can make room for new work without adding more layers around old leftovers.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the craft-skills plugin — 17 skills shipped together

Good fit Use it before adding features to a cluttered area or when you suspect dead code, to safely investigate and remove unused branches, flags, exports, comments, abstractions, and TODOs.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mikestangdevs/craft-skills/delete-this
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.

Any agent
npx skills add mikestangdevs/craft-skills --skill delete-this
Clone the repo
git clone --depth 1 https://github.com/mikestangdevs/craft-skills

Made for: Claude Code.

Or install craft-skills, the plugin that ships this one along with the rest of its 17 skills.

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 delete-this

README.md
[![agentmods](https://agentmods.dev/badge/skills/mikestangdevs/craft-skills/delete-this.svg)](https://agentmods.dev/skills/mikestangdevs/craft-skills/delete-this)
Your own site
<a href="https://agentmods.dev/skills/mikestangdevs/craft-skills/delete-this"><img src="https://agentmods.dev/badge/skills/mikestangdevs/craft-skills/delete-this.svg" alt="Measured on agentmods" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,367 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.00102 $0.01367
Opus 5 $0.00051 $0.00683
Sonnet 5 $0.00020 $0.00273
Haiku 4.5 $0.00010 $0.00137

Measured 7d ago against content hash 7839fcadb051, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

delete-this 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 7d 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/craft/delete-this/SKILL.md · 91 lines

How it starts

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

Delete This

The failure mode this fixes

Codebases accrete. Every feature adds; almost nothing subtracts. Agents make this worse — they're trained to produce code, not remove it, so they route around dead code instead of deleting it. The result is a graveyard of commented-out blocks, flags that are always true, abstractions invented for a second caller that never arrived, and TODOs from engineers who left two years ago. Every line of it is read, parsed, and feared by everyone who touches the file.

The best refactor is often a deletion. This skill finds what no longer earns its place and removes it safely — proving it's dead before it's gone.

When to Use This Skill

  • A file or module feels heavier than what it does
  • Before adding a feature to an already-cluttered area (clear the ground first)
  • You see commented-out code, // TODO (2023), or if (false) branches
  • An abstraction is used by exactly one caller
  • A feature flag has been at one value for months

Don't use when: you can't yet prove the code is unused, or when "dead" code is actually a public API / plugin surface others depend on. When in doubt, prove first (step 2). For a small dead line you noticed while editing something else, don't open a deliberate sweep — that's boyscout territory (bounded, in-scope cleanup). This skill is the deliberate, repo-wide hunt.

Instructions

1. Inventory the candidates

Scan the target scope and list deletion candidates by category:

  • Dead branches — conditions that can't be true (if (false), flags pinned to one value)
  • Unused symbols — exports, functions, variables with no callers
  • Commented-out code — version control already remembers it; the comment is noise
  • Single-use abstractions — interfaces/factories/generics with exactly one implementation or caller
  • Stale markers — TODOs/FIXMEs older than the problem they describe
  • Orphaned config — flags, env vars, settings nothing reads
  • Orphaned tests & deps — tests that only exercise code being deleted; package dependencies nothing imports once the sweep lands

Read the full file on GitHub · 91 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. 7d ago First seen · 91 lines · 102 tokens per session scan A 7839fcadb051

Subscribe to this mod's changes

delete-this is a skill published in the GitHub repository mikestangdevs/craft-skills (4 stars, last pushed 2mo ago), licensed MIT. It adds 102 tokens to every session and 1,367 once invoked, about $0.0005 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-31.