# Is it safe to delete the pre-commit cache?

- URL: https://moreroom.app/folders/precommit-cache
- Item: pre-commit hook environments
- Location: `~/.cache/pre-commit`
- Verdict: Safe to remove — Rebuilt or re-downloaded automatically when needed.
- Comes back on its own: yes
- Source: MoreRoom rules catalogue (2026-10-17), by Yando Pte. Ltd.

## What is it?

The pre-commit framework installs the tools your Git hooks use (linters, formatters and their language runtimes) into isolated environments in `~/.cache/pre-commit`, one per hook repository and version. Environments for old hook versions stay when you update your configuration.

## What happens if you delete it?

pre-commit installs the environments again the next time a hook runs, which makes that commit noticeably slower. Your `.pre-commit-config.yaml` files are not affected.

## How to remove it properly

Run `pre-commit gc` to remove only environments no longer used by any configuration, or `pre-commit clean` to remove them all; both are pre-commit’s own commands. Moving the folder to the Trash is equivalent to `pre-commit clean`.
