Project cleanup guide

How to Clean Vibe-Coded Projects Without Losing Source

Separate source code from node_modules, .next, dist, build, DerivedData, caches, and stale generated output before archiving or cleaning an AI-built project.

Reviewed 4 August 2026 · macOS 13 or later · Apple silicon and Intel

Identify the project and its build system

Before deleting anything, identify the language, framework, package manager, build system, and deployment target. The same folder name can have a different role in a web app, native app, data project, or local AI experiment.

Check that manifests and lockfiles exist, source is committed, and important local-only assets are backed up. A generated folder is only safely re-creatable when the inputs required to rebuild it still exist.

Separate source from generated output

  • Keep source files, assets, package manifests, lockfiles, migrations, and documentation
  • Review node_modules, .next, dist, build, coverage, DerivedData, and temporary bundles
  • Preserve databases, uploads, environment-specific assets, and local configuration when they contain unique data
  • Never place secret keys or credentials into a project archive
  • Use ignore rules to prevent generated output from entering version control or future archives

Choose cleanup or archive

Clean generated output when the project is active and you only need to reclaim space until the next build. Archive when the experiment is finished but the source may be useful later. Delete the entire project only when its value, backup, and dependencies have been reviewed.

A good archive is smaller than the working directory because it preserves durable inputs and leaves out files that package managers and build tools can reproduce.

Verify before permanent removal

Open the cleaned project, reinstall dependencies if needed, and run its normal build or test. Keep removed files in Trash until that verification succeeds. For an archive, inspect the archive contents and test extraction before deleting the original working directory.

Frequently asked questions

Can I delete node_modules?

Usually it can be recreated from a valid lockfile and package manifest, but doing so requires reinstalling dependencies. Confirm the project metadata is present and committed before removal.

What should a project archive keep?

Keep source code, assets, manifests, lockfiles, documentation, migrations, and any local data or configuration that cannot be reconstructed. Exclude secrets from archives and handle them through your normal secure backup process.

Free scan

See what is actually using your Mac.

Scan first. Review every finding. Upgrade only when you want DiskTidy to clean.

Download DiskTidy