knip-cleanup

knip-cleanup is a skill for Claude Code from suxrobGM/jobpilot. It costs 79 tokens per session (1,942 once invoked), scanned A, original, MIT.

A workflow for adding Knip to a TypeScript project and finding exports that no other file uses. It also cleans up barrel files, which are files that re-export code from elsewhere.

In plain words
What is it for?
Use it to set up Knip, establish a reliable baseline, remove dead exports, simplify pass-through barrel files, and narrow exports to actual imports.
Why use it?
It helps remove unused public code without relying on a misleading first scan. Rechecking after each cleanup finds further dead exports while reducing the risk of deleting something needed.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: positional $N argument.

Good fit Use it to set up Knip, establish a reliable baseline, remove dead exports, simplify pass-through barrel files, and narrow exports to actual imports.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/suxrobgm/jobpilot/knip-cleanup
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 suxrobGM/jobpilot --skill knip-cleanup
Clone the repo
git clone --depth 1 https://github.com/suxrobGM/jobpilot

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 knip-cleanup

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/suxrobgm/jobpilot/knip-cleanup"><img src="https://agentmods.dev/badge/skills/suxrobgm/jobpilot/knip-cleanup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 79 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,942 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00079 $0.01942
Opus 5 $0.00039 $0.00971
Sonnet 5 $0.00016 $0.00388
Haiku 4.5 $0.00008 $0.00194

Measured 6d ago against content hash 07767106d060, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

knip-cleanup 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 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (references/debarrel.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/knip-cleanup/SKILL.md · 160 lines

How it starts

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

Knip Integration and Barrel Cleanup

Four phases, each one committed and verified on its own. Later phases depend on earlier ones: every deletion exposes another layer of dead code, so knip is re-run between them rather than once at the start.

Do not start at phase 3. A knip baseline full of false positives will delete something real.

Phase 0: measure before believing the complaint

If the user also reports line-ending churn on every format, check before changing anything:

git ls-files --eol | awk '{print $1, $2}' | sort | uniq -c | sort -rn | head
<formatter> --check .    # biome check . / prettier --check .

i/lf w/lf across the board with a clean formatter run means the tracked tree is already normalized and the churn is in newly created files. The fix is prevention, not renormalizing: .editorconfig with end_of_line = lf, the editor's own EOL setting ("files.eol": "\n" for VS Code), and git config core.autocrlf false locally. Renormalizing a tree that is already LF produces a huge no-op diff and fixes nothing.

Phase 1: a baseline that is actually true

Install knip at the repo root, one config, one script. In a monorepo never give each package its own config: a per-workspace run cannot see that another workspace imports the symbol, so every shared export reads as dead.

{
  "$schema": "https://unpkg.com/knip@<major>/schema.json",
  "tags": ["-knipignore"],
  "workspaces": {
    "packages/lib": {
      "entry": ["src/index.ts", "src/**/*.test.ts"],
      "project": ["src/**/*.ts"],
      "includeEntryExports": true,
      "ignoreExportsUsedInFile": true
    }
  }
}

Then iterate until the report contains only real findings. Expect these, in this order:

  • Every compiled entrypoint must be listed. Grep the Dockerfiles, CI, and build scripts for --outfile, --entry, bun build, esbuild. A second binary built from src/worker.ts is invisible to knip and its whole dependency tree reports as unused.
  • Config files that read env at load time (prisma.config.ts and friends) crash knip's plugin loader. Disable that plugin ("prisma": false) rather than faking the variable.
  • includeEntryExports: true wherever package.json exports uses wildcards. A map like "./utils/*": "./src/utils/*.ts" makes every file an entry, and knip then reports nothing at all for that package. Verify by adding a deliberately unused export and confirming knip sees it — silence is the failure mode here, so it will not announce itself.
  • Framework-indirect dependencies (@prisma/client, pg, a JWT lib reached through a plugin) go in ignoreDependencies. Check each one is genuinely reached before ignoring it.
  • Type-level assertions are not dead code. A type XInSync = [Assert<A, B>, Assert<B, A>] drift guard has no runtime caller by design. Tag it @knipignore (with "tags": ["-knipignore"] in the config) and say in a comment what it guards. Deleting it silently removes a check.

Read the full file on GitHub · 160 lines

Files

What ships with it

1 file 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. 6d ago First seen · 160 lines · 79 tokens per session scan A 07767106d060

Subscribe to this mod's changes

knip-cleanup is a skill published in the GitHub repository suxrobGM/jobpilot (67 stars, last pushed 2d ago), licensed MIT. It adds 79 tokens to every session and 1,942 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-06.

Related

Other skills, from other repositories

api-development

This skill should be used when implementing backend API services, file operations, and process management in TypeScript/Node.js.

Myst4ke/mcp-to-skills-converter · 26 tokens

phx-deps-audit

Audit Hex deps for supply-chain security risk — bidi chars, compile-time exec, maintainer changes, typosquats, CVEs. Use after mix deps.update, when checking if a package upgrade is safe, or reviewing mix.lock PR diffs.

oliver-kriska/claude-elixir-phoenix · 58 tokens

deps-vet

Record a vetted Hex package version in hexvet.exs after a security review — manages the audit ledger, not the scanner. Use to approve a dep after /phx:deps-audit findings or to initialize hexvet.exs.

oliver-kriska/claude-elixir-phoenix · 53 tokens

phx-plan

Plan features spanning multiple domains: billing (Stripe), auth (RBAC), real-time (Presence), webhooks, jobs (Oban). Use when designing interconnected systems or converting review findings into tasks.

oliver-kriska/claude-elixir-phoenix · 44 tokens

deps-update

Bump outdated Hex deps — inventory, snapshot changelogs, update, fix breaks, split reviewable PRs (patches bundled, majors solo). Use to upgrade/bump Elixir dependencies or when versions fall behind. NOT for deps.get failures (/phx:investigate).

oliver-kriska/claude-elixir-phoenix · 60 tokens

phx-deps-update

Bump outdated Hex deps — inventory, snapshot changelogs, update, fix breaks, split reviewable PRs (patches bundled, majors solo). Use to upgrade/bump Elixir dependencies or when versions fall behind. NOT for deps.get failures (phx-investigate).

oliver-kriska/claude-elixir-phoenix · 62 tokens