tl-knip

Find and remove unused files, dependencies, and exports in TypeScript and JavaScript projects.

Updated Feb 14, 2026
One-click install
npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-knip
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tl-knip
Source: https://github.com/toddlevy/tl-agent-skills/tree/main/skills/tl-knip
Command: npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-knip

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Knip finds and removes dead code, unused dependencies, and unused exports across TypeScript and JavaScript projects, helping teams keep codebases lean and easier to maintain.

Core Features & Use Cases

  • Configuration-first workflow that surfaces hints and reduces false positives.
  • Plugin ecosystem auto-detection for frameworks and CI integration.
  • Barrel-file handling and monorepo support, with agent cleanup guidance.
  • Use case: Clean up production dependencies in a large monorepo while preserving public API.

Quick Start

Run a full Knip analysis to audit and clean up dead code in your repository.

Frequently Asked Questions about tl-knip

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find and remove unused dependencies in a TypeScript monorepo?

You can find and remove unused dependencies in a TypeScript monorepo by running a configuration-first dead-code analysis that auto-detects framework plugins and resolves barrel files. This reliably identifies unused exports and dependencies across multi-project codebases.

What is the best way to automate dead-code cleanup in a CI pipeline?

Automating dead-code cleanup in a CI pipeline involves running a configuration-first analysis that surfaces unused files, dependencies, and exports. The workflow reduces false positives and provides agent guidance for reliable removal across JavaScript and TypeScript projects.

Does Knip work with barrel files and path aliases in JavaScript projects?

Yes, Knip works with barrel files and path aliases by handling them natively during the unused export analysis. This ensures that re-exported modules and aliased imports are correctly traced, preventing false positives during dependency cleanup.

Can I clean up unused exports across multiple projects without breaking my public API?

You can clean up unused exports across multi-project codebases while preserving your public API by utilizing a configuration-first workflow. This approach surfaces hints and manages resources carefully, ensuring essential public exports remain untouched during dead-code removal.

Why does dead-code analysis report false positives in my TypeScript project?

False positives in dead-code analysis often occur when framework plugins, path aliases, or barrel files are not properly resolved. A configuration-first workflow with auto-detected plugins and alias resolution mitigates these issues by accurately tracing dependency usage.

How do I configure Knip to recognize custom assets and scripts?

You can configure Knip to recognize custom assets and scripts by enabling optional references and resources. This on-demand guidance allows the analysis to account for non-standard dependencies, ensuring they are not flagged as unused files during the cleanup process.