npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

reclaim-cli

v0.4.0

Published

Finds stale local projects and reclaims disk space from their build artifacts

Downloads

315

Readme

reclaim-cli

npm CI license

Finds projects you haven't touched in a while and reclaims the disk space taken by their regenerable build output (node_modules, .build, DerivedData, Gradle build, …). Source files are never touched.

macOS, Linux and Windows. Supports Node.js, Swift (SwiftPM / Xcode) and Android (Gradle) projects.

Install

npm install -g reclaim-cli
reclaim-cli init        # folders, thresholds, daily schedule, terminal reminder

To run from source instead: npm ci && npm run build && npm link.

How it works

  1. Scan – walks your watched folders and finds project roots (outermost marker wins, so a monorepo is one project).
  2. Judge – a project is stale when its most recent sign of life is older than staleAfterDays (default 60). Signs of life: newest source-file mtime (artifact folders excluded), last commit, last change to .git/HEAD / .git/index.
  3. Measure – sizes the artifacts of stale projects (du on macOS/Linux, recursive walk on Windows).
  4. Remind – the daily job updates the pending file in the state dir and sends a native notification (node-notifier: Notification Center / toasts / notify-send) when at least minReclaimableMB can be reclaimed. A tiny shell hook prints that line when you open a terminal.
  5. Clean – reclaim-cli review (interactive) or reclaim-cli clean removes only artifacts.

What counts as an artifact

| Type | Always removed | Removed only if git-ignored | |---|---|---| | Node | node_modules, .next, .nuxt, .turbo, .svelte-kit, .parcel-cache | dist, build, out, coverage | | Swift | .build, matching ~/Library/Developer/Xcode/DerivedData/<project>-<hash> | .swiftpm, Pods, Carthage/Build | | Android | build, .gradle, .cxx next to a Gradle file | – |

Safety

  • Stale projects with uncommitted changes or unpushed commits (repos with a remote) are listed but skipped. Disable with reclaim-cli config set skipDirty false.
  • A removal must be strictly inside its project (or DerivedData for Xcode); symlinks are never followed.
  • reclaim-cli clean --dry-run shows exactly what would be removed. Every removal is logged (reclaim-cli log).

Commands

reclaim-cli init                         interactive setup
reclaim-cli add|remove <folder>          manage watched folders
reclaim-cli ignore <path> [--remove]     never report a project at/below this path
reclaim-cli scan [--all] [--json] [--quiet] [--notify]
reclaim-cli review                       pick projects to clean interactively
reclaim-cli clean [paths…] [--dry-run] [-y]
reclaim-cli schedule install|uninstall|status [--at HH:mm]
reclaim-cli hook install|print           terminal reminder + completion for new shells
reclaim-cli completion <zsh|bash|powershell>  print the completion script
reclaim-cli snooze <3d|12h> | --clear    mute reminders
reclaim-cli log [-n 20]                  history of removals
reclaim-cli config get [key] | set <key> <value>

Terminal reminder and shell completion

reclaim-cli init offers to set this up, or run it yourself:

reclaim-cli hook install

This writes a per-platform hook script (zsh on macOS, bash on Linux, PowerShell on Windows) and sources it from your shell rc file. The script is pure shell, so opening a terminal never starts Node and nothing breaks if reclaim-cli is not on your PATH. On the first prompt it prints the pending reminder (compatible with Powerlevel10k's instant prompt, reminders older than 3 days are ignored) and registers tab completion for reclaim-cli:

  • commands and subcommands, with descriptions (reclaim-cli sch<TAB>, reclaim-cli schedule <TAB>)
  • flags with descriptions (reclaim-cli scan --<TAB>)
  • folders for add, remove, ignore and clean; setting names for config get|set, and true/false for boolean settings

The completion is generated from the CLI's own command tree. After upgrading, run reclaim-cli hook install again to refresh it. It needs zsh's completion system (compinit), which frameworks such as oh-my-zsh already enable.

Prefer to wire it up yourself? source <(reclaim-cli completion zsh) after compinit does the same.

Daily schedule

reclaim-cli schedule install installs a daily job (launchd on macOS, systemd/cron on Linux, Task Scheduler on Windows) that runs reclaim-cli scan --notify --quiet at scheduleAt. The agent stores the absolute path to Node and to reclaim-cli; if you switch Node versions, run reclaim-cli schedule install again (reclaim-cli schedule status tells you when it's broken). If notifications are blocked, enable them under System Settings → Notifications (Notification Center / toasts / notify-send).

Configuration

~/.config/reclaim-cli/config.json on macOS/Linux (%APPDATA%/reclaim-cli on Windows; state in ~/.local/state/reclaim-cli/, %LOCALAPPDATA%/reclaim-cli on Windows). Override locations with RECLAIM_CLI_CONFIG_DIR / RECLAIM_CLI_STATE_DIR.

| Key | Default | | |---|---|---| | roots | [] | folders to scan | | staleAfterDays | 60 | idle days before a project is stale | | minReclaimableMB | 500 | minimum total before reminding | | scheduleAt | "10:00" | daily scan time | | notify | true | native notification from the daily scan | | skipDirty | true | skip projects with uncommitted/unpushed work | | maxDepth | 4 | how deep to look for project roots | | types | ["node","swift","android"] | enabled project types | | ignore | [] | paths to skip |

Extending

  • New project type: implement ProjectType (src/core/types.ts) in src/types/ and register it in src/types/index.ts.
  • New scheduler/hook: implement Scheduler/ShellHook for your OS in src/platform/<os>/ and wire it in src/platform/index.ts (paths, scheduler, notifier, shell hook).

Development

npm run dev         # rebuild on change
npm test            # vitest
npm run typecheck
npm run lint        # biome

Releasing

Releases are published to npm from GitHub with trusted publishing (no npm token). The workflow is .github/workflows/release.yml.

npm version patch|minor|major        # bumps package.json, commits, tags vX.Y.Z
git push --follow-tags
gh release create vX.Y.Z --generate-notes

Publishing the GitHub Release triggers the workflow, which checks that the tag matches package.json, runs lint, typecheck, tests and build, then runs npm publish. Mark the release as a pre-release to publish it under the next dist-tag instead of latest.

License

MIT