Skip to content

Built-in rules

purgeit ships with a default ruleset ported from the original CLEANUP.sh and substantially expanded since. Every rule below is rendered directly from purgeit’s source (RULE_CATALOG in src/rules/catalog/) — this page can’t drift out of sync with what the CLI actually matches, because it’s generated from the same data the scan engine compiles against.

Rules come in three kinds:

  • always-safe — deletable wherever the name appears in a project tree, no further proof needed. Once matched, the walker stops descending into it (no point looking for node_modules inside node_modules).
  • gated — the name alone is too generic to trust (build, bin, vendor, …), so it’s only reported when a sibling manifest in the same parent directory proves it’s really generated output for a specific ecosystem — e.g. Pods/ only counts next to a Podfile.
  • pruned (version control metadata) — never descended into at all, and never itself a deletion candidate.

Expand a section below for that ecosystem’s rules. Names repeated across sections (like build or vendor) are genuinely polyglot — gated on whichever ecosystem’s manifest happens to be present, so one rule definition safely covers all of them.

64 built-in rules across 16 ecosystems, generated directly from purgeit's source — see how always-safe and gated differ.

64 rules
25 safe1 gated
NameKindDescription
.angularsafe

Angular CLI build cache

.astrosafe

Astro build cache

.cachesafe

Generic framework cache (Parcel, Gatsby, and others)

.contentlayersafe

Contentlayer generated content cache

.docusaurussafe

Docusaurus build cache

.exposafe

Expo cache

.nextsafe

Next.js build output

.nuxtsafe

Nuxt dev/type-generation cache

.nyc_outputsafe

nyc raw coverage data

.outputsafe

Nuxt 3 build output (Nitro)

.parcel-cachesafe

Parcel cache

.serverlesssafe

Serverless Framework packaged build artifacts

.svelte-kitsafe

SvelteKit build output

.swcsafe

SWC compiler cache

.turbosafe

Turborepo cache

.vitesafe

Vite cache

bower_componentssafe

Bower dependencies (legacy)

coveragesafe

Test coverage reports (Istanbul/nyc/Jest/Vitest, also SimpleCov for Ruby)

distsafe

Generic build output (also used by many other ecosystems' bundlers)

jspm_packagessafe

JSPM dependencies (legacy)

node_modulessafe

npm / yarn / pnpm dependencies

outsafe

Generic build output (e.g. Next.js static export)

playwright-reportsafe

Playwright HTML report output

storybook-staticsafe

Storybook build output

test-resultssafe

Playwright test results

buildgated

Generic build output directory name, reused by npm scripts, Python setuptools, CocoaPods/Xcode, CMake, Gradle, Flutter, and Cargo — gated on whichever manifest is actually present

Requires a sibling: Podfile or *.xcodeproj or *.xcworkspace or CMakeLists.txt or package.json or pyproject.toml or requirements.txt or build.gradle or build.gradle.kts or pubspec.yaml or Cargo.toml

11 safe1 gated
NameKindDescription
__pycache__safe

Python bytecode cache

.eggssafe

setuptools egg build cache

.hypothesissafe

Hypothesis property-testing cache

.ipynb_checkpointssafe

Jupyter notebook checkpoint snapshots

.mypy_cachesafe

mypy type-checker cache

.pytest_cachesafe

pytest cache

.ruff_cachesafe

Ruff linter cache

.toxsafe

tox test environments

.venvsafe

Virtual environment

htmlcovsafe

coverage.py HTML report output

venvsafe

Virtual environment

buildgated

Generic build output directory name, reused by npm scripts, Python setuptools, CocoaPods/Xcode, CMake, Gradle, Flutter, and Cargo — gated on whichever manifest is actually present

Requires a sibling: Podfile or *.xcodeproj or *.xcworkspace or CMakeLists.txt or package.json or pyproject.toml or requirements.txt or build.gradle or build.gradle.kts or pubspec.yaml or Cargo.toml

2 safe2 gated
NameKindDescription
registrysafe

Cargo crate registry cache (~/.cargo/registry/), regenerable via cargo build

targetsafe

Cargo build output — also Maven's default build output directory

buildgated

Generic build output directory name, reused by npm scripts, Python setuptools, CocoaPods/Xcode, CMake, Gradle, Flutter, and Cargo — gated on whichever manifest is actually present

Requires a sibling: Podfile or *.xcodeproj or *.xcworkspace or CMakeLists.txt or package.json or pyproject.toml or requirements.txt or build.gradle or build.gradle.kts or pubspec.yaml or Cargo.toml

vendorgated

Composer's PHP dependency directory, a Go module's vendored dependencies, Cargo's vendored crates, or Bundler's vendored gems — gated on whichever manifest is present

Requires a sibling: composer.json or go.mod or Cargo.toml or Gemfile

1 gated
NameKindDescription
vendorgated

Composer's PHP dependency directory, a Go module's vendored dependencies, Cargo's vendored crates, or Bundler's vendored gems — gated on whichever manifest is present

Requires a sibling: composer.json or go.mod or Cargo.toml or Gemfile

3 safe3 gated
NameKindDescription
.buildsafe

Swift Package Manager build output (`swift build`)

.swiftpmsafe

Xcode's local Swift Package Manager cache

DerivedDatasafe

Xcode derived data

buildgated

Generic build output directory name, reused by npm scripts, Python setuptools, CocoaPods/Xcode, CMake, Gradle, Flutter, and Cargo — gated on whichever manifest is actually present

Requires a sibling: Podfile or *.xcodeproj or *.xcworkspace or CMakeLists.txt or package.json or pyproject.toml or requirements.txt or build.gradle or build.gradle.kts or pubspec.yaml or Cargo.toml

Carthagegated

Carthage build/checkout output, fully regenerable via `carthage bootstrap`

Requires a sibling: Cartfile or Cartfile.resolved

Podsgated

CocoaPods dependencies — only meaningful next to a project's Podfile

Requires a sibling: Podfile

1 safe4 gated
NameKindDescription
targetsafe

Cargo build output — also Maven's default build output directory

.cxxgated

Android NDK/CMake native build cache (Android Studio)

Requires a sibling: build.gradle or build.gradle.kts or settings.gradle or settings.gradle.kts

.gradlegated

Gradle project/build cache

Requires a sibling: build.gradle or build.gradle.kts or settings.gradle or settings.gradle.kts

bingated

.NET build output next to a C#/VB#/F# project or solution file — also Eclipse's default Java output directory next to a .classpath

Requires a sibling: *.csproj or *.vbproj or *.fsproj or *.sln or .classpath

buildgated

Generic build output directory name, reused by npm scripts, Python setuptools, CocoaPods/Xcode, CMake, Gradle, Flutter, and Cargo — gated on whichever manifest is actually present

Requires a sibling: Podfile or *.xcodeproj or *.xcworkspace or CMakeLists.txt or package.json or pyproject.toml or requirements.txt or build.gradle or build.gradle.kts or pubspec.yaml or Cargo.toml

1 safe2 gated
NameKindDescription
.vssafe

Visual Studio's local solution cache

bingated

.NET build output next to a C#/VB#/F# project or solution file — also Eclipse's default Java output directory next to a .classpath

Requires a sibling: *.csproj or *.vbproj or *.fsproj or *.sln or .classpath

objgated

.NET intermediate build output next to a C#/VB#/F# project or solution file

Requires a sibling: *.csproj or *.vbproj or *.fsproj or *.sln

1 gated
NameKindDescription
vendorgated

Composer's PHP dependency directory, a Go module's vendored dependencies, Cargo's vendored crates, or Bundler's vendored gems — gated on whichever manifest is present

Requires a sibling: composer.json or go.mod or Cargo.toml or Gemfile

1 safe2 gated
NameKindDescription
.yardocsafe

YARD documentation generation cache

pkggated

Gem build output from `rake build`/`gem build`, only next to a Gemfile

Requires a sibling: Gemfile

vendorgated

Composer's PHP dependency directory, a Go module's vendored dependencies, Cargo's vendored crates, or Bundler's vendored gems — gated on whichever manifest is present

Requires a sibling: composer.json or go.mod or Cargo.toml or Gemfile

1 safe1 gated
NameKindDescription
.dart_toolsafe

Dart/Flutter tooling cache (pub, build_runner, analyzer)

buildgated

Generic build output directory name, reused by npm scripts, Python setuptools, CocoaPods/Xcode, CMake, Gradle, Flutter, and Cargo — gated on whichever manifest is actually present

Requires a sibling: Podfile or *.xcodeproj or *.xcworkspace or CMakeLists.txt or package.json or pyproject.toml or requirements.txt or build.gradle or build.gradle.kts or pubspec.yaml or Cargo.toml

1 safe2 gated
NameKindDescription
.elixir_lssafe

ElixirLS language server cache

_buildgated

Mix compiled build output, regenerable via `mix compile`

Requires a sibling: mix.exs

depsgated

Mix fetched dependencies, regenerable via `mix deps.get`

Requires a sibling: mix.exs

1 gated
NameKindDescription
buildgated

Generic build output directory name, reused by npm scripts, Python setuptools, CocoaPods/Xcode, CMake, Gradle, Flutter, and Cargo — gated on whichever manifest is actually present

Requires a sibling: Podfile or *.xcodeproj or *.xcworkspace or CMakeLists.txt or package.json or pyproject.toml or requirements.txt or build.gradle or build.gradle.kts or pubspec.yaml or Cargo.toml

2 safe
NameKindDescription
.stack-worksafe

Stack build output

dist-newstylesafe

Cabal (new-style) build output

1 safe
NameKindDescription
elm-stuffsafe

Elm compiler cache and dependencies

2 safe
NameKindDescription
zig-cachesafe

Zig compiler cache

zig-outsafe

Zig build output

NameKindDescription
.gitpruned

Git metadata

.hgpruned

Mercurial metadata

.svnpruned

Subversion metadata

You can extend, replace, or narrow these defaults with a purgeit.config.ts.

Restrict the CLI to a subset of rules:

Terminal window
purgeit --targets node_modules,dist

Disable all gated rules and only match always-safe directories:

Terminal window
purgeit --no-gated

Don’t see your ecosystem, or want a rule removed? See Configuration for alwaysSafe/gated/alwaysSafeRemove/gatedRemove, or open an issue/PR — Contributing has the recipe for adding a new ecosystem to the catalog (one file, a handful of lines).

The built-in catalog lives in src/rules/catalog/ — one file per ecosystem (javascript.ts, python.ts, rust.ts, apple.ts, dotnet.ts, java-jvm.ts, ruby.ts, dart-flutter.ts, elixir.ts, haskell.ts, elm.ts, zig.ts, vcs.ts), plus shared.ts for names used unqualified across multiple ecosystems (build, vendor). default-rules.ts and gate-conditions.ts derive the flat name lists and compiled gate predicates the scanner actually uses from this catalog — nothing scan-relevant is hand-duplicated. It’s also exported from the package’s public API (see API reference) as RULE_CATALOG, so this same data is available to anything built on top of purgeit as a library, not just this page.