codebase-cleanup

Scan codebases recursively to identify unused, redundant, and dead files.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/escotilha/claude-public --skill codebase-cleanup-escotilha
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-cleanup
Source: https://github.com/escotilha/claude-public/tree/main/skills/codebase-cleanup
Command: npx skills add https://github.com/escotilha/claude-public --skill codebase-cleanup-escotilha

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps you reduce repository size and maintenance burden by finding files that appear unused, redundant, temporary, empty, or duplicated inside a codebase.

Core Features & Use Cases

  • Unused/orphan detection: Builds an import reference graph to flag source files that are not imported and are not protected entry points.
  • Unnecessary/temp/backup detection: Identifies common backup and temporary artifacts (e.g., *.bak, *.tmp, .DS_Store) for high-confidence cleanup.
  • Duplicates and staleness: Detects identical-file duplicates via hashing and flags older files not modified in over a year for review.
  • Safety-first deletion workflow: Produces a detailed report and only deletes after user permission, with backup/move support and deletion logs for auditing.
  • Protected entry points: Avoids suggesting deletion of common entry/config indicators such as package.json and index/app/server/main files.

Quick Start

Run the cleanup analysis on your project by asking: “Analyze my codebase at /path/to/project and give me a report of unused and unnecessary files, then propose high-confidence deletions for me to confirm.”

Frequently Asked Questions about codebase-cleanup

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

FAQPage Schema
How do I find and remove unused files in my codebase without breaking entry points?

To find unused files safely, you can build a static import graph to detect orphaned modules while protecting common entry points like index, app, server, and main files from deletion. The tool generates categorized findings with confidence levels and requires explicit permission before removing anything.

What is the best way to detect duplicate and temporary files for repository maintenance?

The best way to detect duplicate and temporary files is by hashing identical files and scanning for common backup artifacts like .bak, .tmp, and .DS_Store. This process flags redundant and stale files not modified in over a year for high-confidence cleanup and review.

How does orphan detection work for unused modules in a software project?

Orphan detection works by recursively scanning your project with specified excludes and building a static import reference graph. It flags source files that are not imported anywhere and are not identified as protected entry points, helping you reduce repository bloat.

Can I safely delete dead code and still keep an audit log of the removed files?

Yes, you can safely delete dead code while keeping an audit log. The workflow uses a safe delete or move strategy, generates a detailed report, and only executes removal after explicit user permission, providing deletion logs for auditing purposes.

Does the codebase cleanup process protect configuration files like package.json from accidental deletion?

Yes, the cleanup process protects configuration files like package.json from accidental deletion. It explicitly avoids suggesting deletion of common entry and config indicators, ensuring your application entry points remain intact during repository maintenance.