shift: Skill for Claude Code

.claude/skills/dead-code/SKILL.md

dead-code is a skill for Claude Code from shift-editor/shift. It costs 61 tokens per session (1,753 once invoked), scanned A, original, Apache-2.0.

A process for finding code that is no longer used and removing it after checking its references and exports.

In plain words
What is it for?
Use it to audit unused files, exports, and class members with Knip and code-level verification.
Why use it?
It reduces unused code while avoiding deletion of files or interfaces that are still needed indirectly.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is shift-editor/shift's own configuration. It tells Claude Code how to work on shift itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything shift configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shift-editor/shift. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shift-editor/shift/main/.claude/skills/dead-code/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/shift-editor/shift

Made for: Claude Code.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/shift-editor/shift/dead-code"><img src="https://agentmods.dev/badge/skills/shift-editor/shift/dead-code.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,753 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.00061 $0.01753
Opus 5.5 $0.00024 $0.00701
Sonnet 5.5 $0.00012 $0.00351
Haiku 4.5 $0.00006 $0.00175

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

Security

Grade A, and why

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 1mo 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.

.claude/skills/dead-code/SKILL.md · 164 lines

How it starts

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

/dead-code — Find and Remove Dead Code

Use this skill to find unused files, exports, and class members in the codebase. It uses Knip as a candidate generator, then verifies each candidate through AST-level analysis and interface tracing before removing anything.

NEVER use knip --fix — it has previously deleted code that was actually in use, breaking the editor and tests.

Phase 1: Discovery

Run Knip to generate candidates:

pnpm deadcode 2>&1        # unused files + exports
pnpm deadcode:class 2>&1  # unused class members

Parse the output into three categories:

  • Unused files — files with zero imports
  • Unused exports — exported symbols with no consumers
  • Unused class members — class methods/properties reported as unused

Phase 2: Verification

For each candidate, apply the appropriate checks below. Use scripts/find-refs.ts when reading code alone is insufficient.

Verifying Unused Files

  1. Grep for the filename (without extension) across the codebase
  2. Check config references: tsconfig.json, vite.*.config.ts, forge.config.ts
  3. Check if it's a test helper imported by test files (Knip may miss test-only imports)
  4. Check if it's referenced in package.json scripts or CI workflows

Verifying Unused Exports

  1. Check if re-exported by a barrel file (index.ts) consumed by another package
  2. Check if used in extends/implements clauses
  3. Check if used only in test files (Knip sometimes misses test imports)
  4. Run npx tsx scripts/find-refs.ts <file> <symbol> for compiler-level reference count

Verifying Unused Class Members (Main Pain Point)

This is where most false positives occur. Knip cannot trace usage through interfaces, composite types, or dep interfaces.

Check these patterns in order:

  1. Interface contract — Is the member defined on an interface the class implements? Check the known interface contracts below.
  2. Composite type — Is the class consumed through a type intersection? e.g., ShiftEditor = EditorAPI & CanvasCoordinatorContext means all EditorAPI members on Editor are used.
  3. Dep interface — Is the member part of a dependency injection interface? Classes implement dep interfaces that are consumed by managers.
  4. Base class — Is the member defined on a base class (BaseCommand, BaseTool) and used by subclasses?
  5. Abstract member — Is it an abstract method that subclasses must implement?
  6. Find References — Run npx tsx scripts/find-refs.ts <file> <memberName> for compiler confirmation.

Read the full file on GitHub · 164 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. 1mo ago First seen · 164 lines · 61 tokens per session scan A c97e44e50f6b

Subscribe to this mod's changes

dead-code is a skill published in the GitHub repository shift-editor/shift (379 stars, last pushed today), licensed Apache-2.0. It adds 61 tokens to every session and 1,753 once invoked, about $0.0002 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-09-01.

Related

Other skills, from other repositories

review

Review one pull request for real bugs, regressions, and convention violations. Enumerate candidate issues across the whole diff, verify each against the code, then return structured line-anchored findings and a verdict. Read-only on GitHub; the orchestrator posts the review.

emdash-cms/emdash · 57 tokens

adversarial-reviewer

Stress-test a code change for concrete correctness defects, unsafe assumptions, and failure modes. Use when the user explicitly asks for an adversarial review, a deep bug hunt, or to tear a change apart, or to check your own change before submitting it. Do not use for ordinary review, style feedback, or general…

emdash-cms/emdash · 72 tokens

agent-upkeep

Perform one small, scoped maintenance improvement to the Elements monorepo and open a single reviewable pull request. Use this skill for scheduled or unattended upkeep runs that improve unit test coverage for one file, fix one behavioral bug in one module, or move one off ESLint rule toward enforcement to reduce…

NVIDIA/elements · 115 tokens

agent-debug-ci

Investigate failed scheduled or nightly GitHub Actions runs on the default branch, determine whether the failure is reproducible and repository-owned, implement the smallest evidence-backed fix, validate it, and open a pull request. Use when a failed nightly CI event starts an agent, or when the standard CI or…

NVIDIA/elements · 80 tokens

omk-code-review

Review implementation changes against contracts and real failure modes, preserve minimal patches, and verify regressions without confusing test counts, generated code volume or CI claims with production correctness.

dmae97/omk · 38 tokens

architecture-audit

Systematic architecture audit and refactoring methodology for Rust + TypeScript codebases. Use when performing refactoring, cleanup, unification, code review, dead code removal, module reorganization, or tech debt elimination. Ensures no naming confusion, semantic overloading, hidden defaults, duplicate logic, or…

org2AI/ORG2 · 70 tokens