housekeep-dead-code

housekeep-dead-code is a skill for Claude Code from kensaurus/cursor-kenji. It costs 77 tokens per session (4,600 once invoked), scanned A, original, MIT.

A cleanup procedure that removes unused code from an approved list and then adds a check to prevent new unused items. It deletes by category, makes one commit per category, and runs type checks and tests between steps.

In plain words
What is it for?
Use it after a dead-code plan has been reviewed to delete unused files, exports, dependencies, and other confirmed leftovers. It also helps install a Knip limit in continuous integration, the automated checks run for changes.
Why use it?
It prevents broad, unverified deletion and makes it easier to identify which cleanup group caused a failure. It is meant to execute an approved audit rather than decide on its own what is safe to remove.

Skill for Claude Code

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

Part of the cursor-kenji plugin — 123 skills, 56 commands, 6 agents, 3 MCP servers shipped together

Good fit Use it after a dead-code plan has been reviewed to delete unused files, exports, dependencies, and other confirmed leftovers. It also helps install a Knip limit in continuous integration, the automated checks run for changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/kensaurus/cursor-kenji/housekeep-dead-code
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 kensaurus/cursor-kenji --skill housekeep-dead-code
Clone the repo
git clone --depth 1 https://github.com/kensaurus/cursor-kenji

Made for: Claude Code.

Or install cursor-kenji, the plugin that ships this one along with the rest of its 123 skills, 56 commands, 6 agents, 3 MCP servers.

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 housekeep-dead-code

README.md
[![agentmods](https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/housekeep-dead-code/github.svg)](https://agentmods.dev/skills/kensaurus/cursor-kenji/housekeep-dead-code)
Your own site
<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/housekeep-dead-code"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/housekeep-dead-code/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 housekeep-dead-code

Your own site · 80×15
<a href="https://agentmods.dev/skills/kensaurus/cursor-kenji/housekeep-dead-code"><img src="https://agentmods.dev/badge/skills/kensaurus/cursor-kenji/housekeep-dead-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 77 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,600 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.00077 $0.04600
Opus 5 $0.00039 $0.02300
Sonnet 5 $0.00015 $0.00920
Haiku 4.5 $0.00008 $0.00460

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

Security

Grade A, and why

housekeep-dead-code 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.

skills/housekeep-dead-code/SKILL.md · 388 lines

How it starts

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

housekeep-dead-code — Delete by category, then ratchet

Degree of freedom: MIXED. Category order, the --fix-type sequence, one-commit-per-category, and verification between commits [LOW freedom — run exactly]; whether a specific flagged item is truly dead [HIGH freedom].

Apply-now. plan-dead-code produced the reviewed keep/kill list and the baseline; this makes the repo match it and installs the gate that keeps it matched. Net dead code strictly ≤ before, and no behavior change.

This is the execution arm of plan-dead-code, the same way housekeep-gates executes audit-gate-logic and housekeep-design executes plan-uiux-unification.

Deletion is the approved execution of a plan. The plan-* preservation contract ("no removal without an approved proposal") is satisfied by that approval — not bypassed by this skill.

This skill vs neighbors

Skill Owns
housekeep-dead-code (this) Delete per approved list, cascade, install the ratchet
plan-dead-code Prove it is dead first — config, baseline, keep/kill list
housekeep-gates The aggregator this skill's CI job plugs into
housekeep-backlog Parked-work register — not deletion
workflow-housekeep README sync, build artifacts, dependency bumps
workflow-refactor Restructuring code that stays (duplication fixes land here)
burndown-full One mechanical change to 100% when a prior pass stalled
db-migrator Authoring any DROP migration
plan-data-integrity Whether a destructive migration is safe at all
workflow-green-repo Repo already red before this pass started

How to reason (every commit)

  1. Scope — one category, one commit, from the approved list only
  2. Verify — typecheck + affected tests + build after each category
  3. Attribute — red after a batch means this batch; bisect the batch
  4. Cascade — deletion exposes new deadness; re-run, don't assume

Never carry two categories in one commit. The whole value of the sequence is that a failure names its own cause.

Read the full file on GitHub · 388 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 First seen · 388 lines · 77 tokens per session scan A ebc6e5edb82b

Subscribe to this mod's changes

housekeep-dead-code is a skill published in the GitHub repository kensaurus/cursor-kenji (9 stars, last pushed 2d ago), licensed MIT. It adds 77 tokens to every session and 4,600 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-09-11.