knip
Skill0 starsChanged 10 months agoMITView on GitHub
Run knip to find and remove unused files, dependencies, and exports. Use for cleaning up dead code and unused dependencies.
- Installs packages
1 other project uses a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- brianlovin/agent-configedited, first seen Feb 25, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- brianlovin/agent-config★ 37525% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository35 other files it gives its agents.
- skills/vercel-composition-patterns/AGENTS.mdAGENTS.md
- skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- bunSkill
- central-stationSkill
- chrome-devtoolsSkill
- databaseSkill
- deploymentSkill
- design-spec-rulesSkill
- deslopSkill
- faviconSkill
- find-skillsSkill
- git-commit-messageSkill
- githubSkill
- interfaces-raunofreibergSkill
- mymindSkill
- next-best-practicesSkill
- paper-mcpSkill
- projectsSkill
- pr-trendsSkill
- railway-docsSkill
- ramsSkill
- reclaudeSkill
- sentrySkill
- serviceSkill
- simplifySkill
- skill-creatorSkill
- statusSkill
- tailwind-v4Skill
- technical-writing-styleguideSkill
- vercel-composition-patternsSkill
- vercel-react-best-practicesSkill
- web-design-guidelinesSkill
- web-interface-guidelinesSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run knip to find and remove unused files, dependencies, and exports from this codebase.
- Distinctive: line 12
Check if knip is available:
- Very specific: line 13
Run npx knip --version to test
- Very specific: line 14
If it fails or is very slow, check if knip is in package.json devDependencies
- Very specific: line 15
If not installed locally, install with npm install -D knip (or pnpm/yarn equivalent based on lockfile present)
- Very specific: line 17
If no knip.json or knip.jsonc config exists and knip reports many false positives, consider creating a minimal config based on the …
- Very specific: line 21
Run npx knip to get initial report
- Distinctive: line 45
Use the AskUserQuestion tool to clarify before deleting these.
- Distinctive: line 49
Run knip, capture full output
- Distinctive: line 51
Ask about uncertain items in a single batch question
- Distinctive: line 77
If knip config exists, respect its ignore patterns
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Knip Code Cleanup
Run knip to find and remove unused files, dependencies, and exports from this codebase.
Setup
- Check if knip is available:
- Run
npx knip --versionto test - If it fails or is very slow, check if
knipis in package.json devDependencies - If not installed locally, install with
npm install -D knip(or pnpm/yarn equivalent based on lockfile present)
- Run
- If no
knip.jsonorknip.jsoncconfig exists and knip reports many false positives, consider creating a minimal config based on the frameworks detected in package.json
Execution
- Run
npx knipto get initial report - Review the output categories:
- Unused files - files not imported anywhere
- Unused dependencies - packages in package.json not imported
- Unused devDependencies - dev packages not used
- Unused exports - exported functions/variables not imported elsewhere
- Unused types - exported types not used
Cleanup Strategy
Auto-delete (high confidence):
- Unused exports that are clearly internal (not part of public API)
- Unused type exports
- Unused dependencies (remove from package.json)
- Unused files that are clearly orphaned (not entry points, not config files)
For these, proceed with deletion without asking. Use --fix --allow-remove-files for automated fixes, or manually delete/edit as needed.
Ask first (needs clarification):
- Files that might be entry points or dynamically imported
- Exports that might be part of a public API (index.ts, lib exports)
- Dependencies that might be used via CLI or peer dependencies
- Anything in paths like
src/index,lib/, or files with "public" or "api" in the name
Use the AskUserQuestion tool to clarify before deleting these.
Workflow
- Run knip, capture full output
- Categorize each issue as auto-delete or needs-clarification
- Ask about uncertain items in a single batch question
- Perform all deletions (use Edit tool to remove exports, Bash to remove files/deps)
- Re-run knip to verify cleanup is complete
- Repeat until no issues remain or only intentionally-ignored items exist
Common Commands
# Basic run
npx knip
# Production only (ignore test files)
npx knip --production
# Auto-fix what's safe
npx knip --fix
# Auto-fix including file deletion
npx knip --fix --allow-remove-files
# JSON output for parsing
npx knip --reporter jsonNotes
- If knip config exists, respect its ignore patterns
- Watch for monorepo setups - may need
--workspaceflag - Some frameworks need plugins enabled in config
- Re-run after each batch of fixes to catch newly-exposed unused code
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

