Keep Your Composer Dependencies Clean

Automatically detect and remove unused Composer packages from your PHP projects. Optimize performance, reduce security risks, and maintain a cleaner codebase.

🔍 Try It Now View Documentation

Why Use composer-unused?

Keep your PHP projects clean and secure by identifying dependencies that are no longer needed

🔍

Smart Code Analysis

Scans your entire codebase to identify which Composer packages are actually being used, going beyond simple dependency trees.

Performance Optimization

Remove unused dependencies to reduce bundle size, decrease installation time, and improve application startup performance.

🛡️

Security Benefits

Minimize attack surface by removing unnecessary packages that could introduce vulnerabilities to your project.

⚙️

Easy Integration

Simple CLI tool that integrates seamlessly with your existing Composer workflow and CI/CD pipelines.

🎯

Configurable Filtering

Customize analysis with filters and patterns to handle edge cases and project-specific requirements.

📊

Clear Reporting

Get detailed reports showing exactly which packages are unused and why, helping you make informed decisions.

How It Works

Three simple steps to clean up your dependencies

1

Install & Run

Download the .phar file or install via PHIVE, then run composer-unused in your project directory.

2

Code Analysis

The tool scans your codebase to identify which symbols from each package are actually referenced in your code.

3

Remove Safely

Review the results and safely remove unused packages using standard Composer commands.

See It In Action

Try the Interactive Playground

Experience composer-unused without installing anything. Add your PHP code and dependencies to see which packages are actually being used.

Perfect for reproducing issues, testing configurations, or exploring how composer-unused works with different code patterns.

Launch Playground
$ composer-unused composer-unused 0.9.3 by Andreas Frömer and contributors Scanning files... 100/100 [============================] 100% Found 5 unused packages: psr/log symfony/console monolog/monolog doctrine/annotations phpunit/phpunit (require-dev) Run with --excludePackage to filter results.

Documentation & Resources

Everything you need to get started and master composer-unused

Community & Support

Connect with the community and support the project