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.
Always-safe vs. gated
Section titled “Always-safe vs. gated”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_modulesinsidenode_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 aPodfile. - 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.
No rules match your search.
JavaScript / TypeScript25 safe1 gated
| Name | Kind | Description |
|---|---|---|
.angular | safe | Angular CLI build cache |
.astro | safe | Astro build cache |
.cache | safe | Generic framework cache (Parcel, Gatsby, and others) |
.contentlayer | safe | Contentlayer generated content cache |
.docusaurus | safe | Docusaurus build cache |
.expo | safe | Expo cache |
.next | safe | Next.js build output |
.nuxt | safe | Nuxt dev/type-generation cache |
.nyc_output | safe | nyc raw coverage data |
.output | safe | Nuxt 3 build output (Nitro) |
.parcel-cache | safe | Parcel cache |
.serverless | safe | Serverless Framework packaged build artifacts |
.svelte-kit | safe | SvelteKit build output |
.swc | safe | SWC compiler cache |
.turbo | safe | Turborepo cache |
.vite | safe | Vite cache |
bower_components | safe | Bower dependencies (legacy) |
coverage | safe | Test coverage reports (Istanbul/nyc/Jest/Vitest, also SimpleCov for Ruby) |
dist | safe | Generic build output (also used by many other ecosystems' bundlers) |
jspm_packages | safe | JSPM dependencies (legacy) |
node_modules | safe | npm / yarn / pnpm dependencies |
out | safe | Generic build output (e.g. Next.js static export) |
playwright-report | safe | Playwright HTML report output |
storybook-static | safe | Storybook build output |
test-results | safe | Playwright test results |
build | gated | 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 |
Python11 safe1 gated
| Name | Kind | Description |
|---|---|---|
__pycache__ | safe | Python bytecode cache |
.eggs | safe | setuptools egg build cache |
.hypothesis | safe | Hypothesis property-testing cache |
.ipynb_checkpoints | safe | Jupyter notebook checkpoint snapshots |
.mypy_cache | safe | mypy type-checker cache |
.pytest_cache | safe | pytest cache |
.ruff_cache | safe | Ruff linter cache |
.tox | safe | tox test environments |
.venv | safe | Virtual environment |
htmlcov | safe | coverage.py HTML report output |
venv | safe | Virtual environment |
build | gated | 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 |
Rust2 safe2 gated
| Name | Kind | Description |
|---|---|---|
registry | safe | Cargo crate registry cache (~/.cargo/registry/), regenerable via cargo build |
target | safe | Cargo build output — also Maven's default build output directory |
build | gated | 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 |
vendor | gated | 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 |
Go1 gated
| Name | Kind | Description |
|---|---|---|
vendor | gated | 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 |
Apple / Xcode / Swift3 safe3 gated
| Name | Kind | Description |
|---|---|---|
.build | safe | Swift Package Manager build output (`swift build`) |
.swiftpm | safe | Xcode's local Swift Package Manager cache |
DerivedData | safe | Xcode derived data |
build | gated | 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 |
Carthage | gated | Carthage build/checkout output, fully regenerable via `carthage bootstrap` Requires a sibling: Cartfile or Cartfile.resolved |
Pods | gated | CocoaPods dependencies — only meaningful next to a project's Podfile Requires a sibling: Podfile |
Java / JVM (Gradle, Maven, Android, Eclipse)1 safe4 gated
| Name | Kind | Description |
|---|---|---|
target | safe | Cargo build output — also Maven's default build output directory |
.cxx | gated | Android NDK/CMake native build cache (Android Studio) Requires a sibling: build.gradle or build.gradle.kts or settings.gradle or settings.gradle.kts |
.gradle | gated | Gradle project/build cache Requires a sibling: build.gradle or build.gradle.kts or settings.gradle or settings.gradle.kts |
bin | gated | .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 |
build | gated | 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 |
.NET1 safe2 gated
| Name | Kind | Description |
|---|---|---|
.vs | safe | Visual Studio's local solution cache |
bin | gated | .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 |
obj | gated | .NET intermediate build output next to a C#/VB#/F# project or solution file Requires a sibling: *.csproj or *.vbproj or *.fsproj or *.sln |
PHP1 gated
| Name | Kind | Description |
|---|---|---|
vendor | gated | 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 |
Ruby1 safe2 gated
| Name | Kind | Description |
|---|---|---|
.yardoc | safe | YARD documentation generation cache |
pkg | gated | Gem build output from `rake build`/`gem build`, only next to a Gemfile Requires a sibling: Gemfile |
vendor | gated | 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 |
Dart / Flutter1 safe1 gated
| Name | Kind | Description |
|---|---|---|
.dart_tool | safe | Dart/Flutter tooling cache (pub, build_runner, analyzer) |
build | gated | 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 |
Elixir1 safe2 gated
| Name | Kind | Description |
|---|---|---|
.elixir_ls | safe | ElixirLS language server cache |
_build | gated | Mix compiled build output, regenerable via `mix compile` Requires a sibling: mix.exs |
deps | gated | Mix fetched dependencies, regenerable via `mix deps.get` Requires a sibling: mix.exs |
C / C++ (CMake)1 gated
| Name | Kind | Description |
|---|---|---|
build | gated | 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 |
Haskell2 safe
| Name | Kind | Description |
|---|---|---|
.stack-work | safe | Stack build output |
dist-newstyle | safe | Cabal (new-style) build output |
Elm1 safe
| Name | Kind | Description |
|---|---|---|
elm-stuff | safe | Elm compiler cache and dependencies |
Zig2 safe
| Name | Kind | Description |
|---|---|---|
zig-cache | safe | Zig compiler cache |
zig-out | safe | Zig build output |
Version control metadata
| Name | Kind | Description |
|---|---|---|
.git | Git metadata | |
.hg | Mercurial metadata | |
.svn | Subversion metadata |
Customizing the ruleset
Section titled “Customizing the ruleset”You can extend, replace, or narrow these defaults with a purgeit.config.ts.
Restrict the CLI to a subset of rules:
purgeit --targets node_modules,distDisable all gated rules and only match always-safe directories:
purgeit --no-gatedDon’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).
Where the defaults come from
Section titled “Where the defaults come from”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.