Heads up: still under development - expect rough edges

CLI for AI-assisted development

Sweep your workspace clean, fast, so your agent fleet can run again.

Brooom finds and cleans the disk clutter that agent tools, parallel branches and forgotten projects leave behind. Nothing changes before you have seen the plan and said yes.

AI agents leave worktrees, branches, logs, caches and dependency folders behind, then brooom sweeps them away:
$ brooom sweep
Proceed with 4 items (2.2 GB)? [y/N] y
reclaimed 2.2 GB

Pick a preset, sweep

A preset decides what br sweep cleans. It shows the plan and asks once before it acts. Every preset skips unmerged and uncommitted work, dirty worktrees and worktrees whose upstream is gone; br review decides on those one by one.

br sweep after-agents [--dry-run] [--yes]

--dry-run only shows the plan and changes nothing; --yes skips the question, for scripts.

What it sweeps

  • worktrees whose branch is merged (squash and rebase merges too), clean ones only
  • local branches merged into the base branch
  • AI tool artifacts in the repository: run logs, transcripts, caches, scratch files
Detectors
Minimum confidence
medium

See what a sweep does

br sweep shows everything worth cleaning, grouped by detector with the reclaimable space up front, and asks once before it cleans.

$ br sweep
merged-branch / delete-branch: 2 items, 0 B
  delete branch feat/login-form with -d (0 B)
    $ git branch -d feat/login-form
  delete branch fix/typo with -d (0 B)
    $ git branch -d fix/typo
build-artifacts / trash: 1 item, 610.0 MB
  move node_modules (610.0 MB) to trash (610.0 MB)
    $ trash /home/dev/code/acme-api/node_modules
total reclaimable: 610.0 MB
Proceed with 3 items (610.0 MB)? [y/N] y
undo: brooom undo 20260930-142201-3f9a
2 merged branches removed, 1 build artifact removed. 610.0 MB reclaimed

Illustrative output

br is the short name the install script adds next to brooom. If something on your machine already uses br, the installer tells you, andbrooom works just the same.

Heads up: still under development - expect rough edges

Install

Downloads the latest release for your platform, verifies its sha256 checksum and installs it without sudo, together with the short command br (unless something else already uses br, in which case it tells you). It needs a published release, and the first major release is not out yet.

macOS / Linux
curl -fsSL https://raw.githubusercontent.com/Tobias-Braun/brooom/main/scripts/install.sh | sh
Windows (PowerShell)
irm https://raw.githubusercontent.com/Tobias-Braun/brooom/main/scripts/install.ps1 | iex

Built to be trusted with your disk

Scoped by default: without flags Brooom only touches the repository you are in, and paths outside the allowed scope are refused.

  • Safe by default

    Every command shows its plan and asks once before it acts (--dry-run to only look, --yes for scripts). Sweep never touches unmerged work, files go to the OS trash, and br undo restores what is restorable.

  • Git-aware

    Finds stale and merged branches, including squash merges, orphaned worktrees and git bloat. Branches go with git branch -d, and -D only with --force.

  • Agent-artifact-aware

    Knows where Claude Code, Cursor, Aider, Copilot and friends leave logs, JSONL transcripts and caches. Tool config such as settings, instructions, skills and commands is never touched.

  • Fast

    Parallel directory walking, skip lists for huge irrelevant folders and cached sizes that are invalidated by mtime.

  • Cross-platform

    One static binary for Windows, macOS and Linux on amd64 and arm64, using the native Recycle Bin, macOS Trash or freedesktop trash.

Detectors

Seven read-only detectors find the clutter; presets pick which of them run, and--detector narrows a preset further. Detectors only report, nothing changes until you say yes.

Git

merged-branch

Local branches whose tip is already in the base branch (main, master, develop, trunk), found by ancestry and, by default, by patch id so squash merges count too. Protected branches such as main and release/* are never suggested.

Run by after-agents, everything

worktrees

Linked worktrees whose branch is merged, detached worktrees whose commits all landed on the base under other ids, and worktrees whose directory is gone. Worktrees in use are protected, and dirty ones are left to br review.

Run by after-agents, everything

git-bloat

Many loose objects, a large reflog, too many packs or large blobs. Suggests git gc, reflog expiry and pruning with configurable expiry dates; the stash reflog is never expired.

Run by everything

stale-branch

Local branches without a commit for 90 days that are not merged. Each one shows whether its commits exist on a remote and, through gh when available, whether a pull request is open. This is unmerged work, so br review decides on it one by one.

No preset runs it; br review does

Files

ai-artifacts

Run logs, JSONL transcripts, caches and scratch folders of Claude Code, Cursor, Aider, Copilot and others in the project, plus the transcripts Claude Code keeps for the repository in your home directory. Settings, instructions, skills and commands are never touched.

Run by after-agents, everything

log-and-runtime-files

npm, yarn and pnpm debug logs, rotated logs, crash dumps, editor swap files, .DS_Store and Thumbs.db, Jest, Vitest and pytest caches and coverage output. Files a process has open are flagged, not suggested.

Run by tidy, everything

build-artifacts

node_modules, dist, build, target, .venv, __pycache__, .next and similar folders, weighted by how long the project has been inactive (30 days by default, from the last commit and source change).

Run by everything

Sweep after every agent run

Add Brooom as a stop hook and it cleans up each time your agent finishes. The hook runs the after-agents preset with --yes, so nobody has to answer: the preset only removes merged worktrees and branches and agent leftovers, never unmerged or uncommitted work, and br undo restores the last sweep. The report goes to stderr, because the harness reads stdout as JSON. Outside a git repository the hook does nothing.

.claude/settings.json
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "if git rev-parse --git-dir >/dev/null 2>&1; then br sweep after-agents --yes >&2 || exit; fi; echo '{}'"
          }
        ]
      }
    ]
  }
}

Zero config, fully configurable

All fields have safe defaults, so Brooom works inside a repository without any config, andbr sweep ~/code covers every repository below a folder. Tune the rest in~/.brooom/config.json. This excerpt makes br sweep run the after-agents preset, raises the minimum age to 30 days, turns one detector off and prints the summary format by default.

{
  "version": 1,
  "sweep": { "preset": "after-agents" },
  "thresholds": { "min_age_days": 30 },
  "detectors": {
    "git-bloat": { "enabled": false }
  },
  "output": { "format": "summary" }
}