Skip to content

Case study · Built at Studio CC

tidyup

A command-line tool that frees up ports and disk space on a developer's machine: it stops whatever is holding a port, deletes old dependency and build folders, and starts a project's dev servers from one file.

Developer tool · Open source CLI

48 GB

from projects untouched for 45 days

tidyup

2026 · Built at Studio CC

Year
2026
Role
Solo developer
Built at
Studio CC
Type
Developer tool · Open source CLI
Status
Live
  • Rust
  • ratatui
  • rayon
  • clap
  • GitHub Actions
  • crates.io

The challenge

Two things slow every developer down. A dev server left running holds port 3000, and finding it means looking up the same lsof command again. And every project leaves behind node_modules, Rust target folders, .next caches and Python environments that quietly fill the disk long after the project is finished.

The approach

  1. 01

    Ports with context

    tidyup ports lists every listening process with the project folder it runs from, so three node processes can be told apart. System processes are hidden by default.

  2. 02

    Stop politely, then firmly

    tidyup 3000 sends SIGTERM, gives the process three seconds to exit, and only then sends SIGKILL.

  3. 03

    Delete only what can be rebuilt

    tidyup clean finds dependency and build folders across 28 kinds of project, but only when the file that creates them sits next to them: no package.json, no delete.

  4. 04

    Honest sizes

    Sizes are what deleting actually frees. Files hard-linked from elsewhere, like pnpm's shared store, don't count; files whose links all live inside the folder, like Cargo's build outputs, do.

  5. 05

    A dev stack in one command

    tidyup up starts every service in a tidyup.toml, frees their ports first and prefixes each line of output. Ctrl-C stops every service and everything it started.

  6. 06

    Global caches too

    With --caches it also finds the caches tools keep outside any project: Xcode, npm, pnpm, Cargo, Go, Homebrew and more, plus Docker's unused images and build cache. On my own Mac that came to 135 GB.

  7. 07

    Knows Docker

    A port held by Docker shows the container's name, and stopping it runs docker stop on that container instead of killing Docker itself.

  8. 08

    A dashboard for both

    Run with no arguments, tidyup opens a terminal dashboard: live ports on one tab, deletable folders on the other, sortable by size or age.

The outcome

Open source under the MIT licence and published on crates.io, so anyone with Rust can install it with cargo install tidyup. It is a single 1.6 MB binary for macOS and Linux, tested in CI on both.

Projects I hadn't touched in 45 days held 48 GB of node_modules, target and .next folders. tidyup found them, let me pick, and deleted them with a live progress bar.

Key decisions

Why it's built this way

  1. 01

    Matching on the project file

    over matching folder names

    A folder called "build" or "target" might be your own. tidyup only deletes one when the package.json, Cargo.toml or Podfile that generates it sits right next to it.

  2. 02

    Skipping hidden folders

    over scanning everything

    Editor extensions ship their own node_modules inside hidden folders. Deleting those would break the editor, so tidyup never looks inside them.

  3. 03

    Process groups

    over stopping only the started process

    pnpm dev starts node, which starts esbuild. Each service runs in its own process group, so Ctrl-C stops the whole tree and nothing is left holding the port.

  4. 04

    Stopping the container

    over killing the process on the port

    Every port Docker publishes belongs to Docker's own process. Killing it would take every container down, so tidyup looks up which container publishes the port and stops only that one.

  5. 05

    Deleting in parallel

    over one file at a time

    Deleting is limited by how fast the filesystem removes files, not by CPU. Spreading subfolders across every core makes large cleanups noticeably faster.

  6. 06

    A demo mode

    over recording on a real machine

    The README's recordings come from scripted runs against made-up projects and processes, so no real paths or process names end up in them, and anyone can record them again.

Next case study

Edition – Ops & Hosting Platform

Read it →

Have a problem worth solving?