Unused
A tool to identify potentially unused code.
Install / Use
/learn @unused-code/UnusedREADME
Unused
Unused identifies unused code in Rails, Phoenix, and other types of applications, improving developer productivity

Installing and Updating
Homebrew (Recommended)
You can install the formulae via Homebrew with brew tap:
brew tap unused-code/formulae
Next, run:
brew install unused
This will install unused and its corresponding dependencies.
Updating
To update, run:
brew update
brew upgrade unused
Caveats (Apple Installation on M1 and Intel CPUs)
unused can be installed to use a memory allocator called mimalloc.
In local benchmarks (which are documented in the commit introducing mimalloc),
it speeds up execution by a significant amount, but unfortunately runs
into sporadic issues with segmentation faults
on Apple M1 devices. For this reason, unused by default is installed
without mimalloc on Macs, using the stock Rust allocator instead.
If you are using a Mac with an Intel chip and you wish to use mimalloc, you must specifically request it:
brew install unused --with-mimalloc
To completely refresh your install:
brew uninstall unused
brew untap unused-code/formulae
brew tap unused-code/formulae
brew install unused --with-mimalloc
Nix
There is a Nix expression available in nixpkgs.
There are many ways to run unused with Nix, but the simplest is:
nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixpkgs-unstable.tar.gz -p unused --run 'unused --help'
Linux
Precompiled binaries are available for the latest release.
Download the linux-musl binary, and move the binary to somewhere within your $PATH.
Prerequisites
It is strongly recommended you install Universal Ctags to generate tags files. Universal Ctags supports more languages and has native parsers for a good number of them, resulting in faster tags generation time.
It is also recommended that you have a tags file generated on a semi-regular basis. Tim Pope wrote an article about wiring up ctags generation with a git hook. thoughtbot's dotfiles also reference a ctags git hook.
Usage
From your project directory, run:
unused
This will generate a list of tokens and corresponding definition locations for removal consideration.
You can see supported command-line flags with:
unused --help
Troubleshooting
If you run into trouble, run
unused doctor
This will perform a series of simple checks to help identify obvious issues with configuration.
Contributing
This project uses just for common development tasks.
Run the project checks before opening a PR:
just test
If you do not have the required test tooling installed yet, run:
just setup
License
Copyright 2020 Josh Clayton. See the LICENSE.
Related Skills
node-connect
344.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
96.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
344.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
344.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
