The short answer
- 01
Careful. The hub folder is a cache you can rebuild by downloading again; the token file next to it signs you in to the Hub.
- 02
Every Hugging Face library writes it: transformers, diffusers, datasets, MLX and anything else built on huggingface_hub.
- 03
It never shrinks on its own. Hugging Face keeps old revisions' files when a model updates.
- 04
The commands: hf cache ls to see repos, hf cache rm <repo> to delete one, hf cache prune for old revisions and partial downloads.
See its real size on your Mac. Hoardless measures this folder and previews the delete.Download free trial
What is the ~/.cache/huggingface folder?
It is the Hugging Face home folder, shared by every library built on huggingface_hub. Per Hugging Face's environment variable reference, HF_HOME defaults to ~/.cache/huggingface and holds both your token and the cache.
hub: downloaded models, datasets and spaces, one folder per repo such asmodels--Qwen--Qwen2-7B.HF_HUB_CACHEmoves it.token: your User Access Token, unlessHF_TOKEN_PATHpoints elsewhere.xet: shard cache and staging data used for uploads.datasets: processed data from thedatasetslibrary, when you use it.
Each repo in hub has the same layout: blobs holds the real files named by hash, snapshots has one folder of symlinks per revision, and refs says which revision a branch or tag points to.
What writes it and why does it grow?
Any download from the Hub writes it: loading a model in transformers, diffusers or MLX, hf download, or a datasets load.
Hugging Face's guide says cached files are never deleted from your local directory: when you download a new revision, the previous files are kept in case you need them again. A model you update a few times can hold several revisions of its weights. Interrupted downloads leave .incomplete files in blobs.
How big does it get?
It holds whatever you downloaded, so there is no normal size. Ask the tool, then the disk:
hf cache ls
Lists cached repos with size, last access and refs. Add --revisions to see each revision. Removes nothing.
du -sh ~/.cache/huggingface/*
Prints each part of the Hugging Face home. Removes nothing.
Is it safe to delete ~/.cache/huggingface?
| What | Verdict | What you lose |
|---|---|---|
Old revisions and .incomplete files, via hf cache prune | Safe | Nothing in use. The current revision stays. |
xet | Safe | Upload shards and staging data. Hugging Face says it can be removed entirely. |
A repo you no longer use, via hf cache rm | Safe | That model or dataset. It downloads again on next use. |
The whole hub folder | Careful | Every cached model and dataset; each downloads again, which can be many GB. |
The whole ~/.cache/huggingface | Careful | Everything above plus your token, so you are signed out of the Hub. |
Single files in a repo's blobs | Never | Revisions that link to that blob break. Use hf cache rm. |
How do I clean the Hugging Face cache?
Use the hf CLI. The cache guide documents hf cache rm and hf cache prune, both with --dry-run to preview:
hf cache prune --dry-run
Shows what prune would delete: revisions no branch or tag points to, .incomplete leftovers and shared blobs no repo uses. Run it without --dry-run to delete, after a confirmation prompt.
hf cache rm model/bert-base-cased
Deletes one cached repo permanently, after a prompt. It also accepts a bare revision hash, or an hf:// file URI to drop a single file such as one GGUF quantization.
The manual way: move a whole repo folder, such as ~/.cache/huggingface/hub/models--Qwen--Qwen2-7B, to the Trash. Leave token in place.
What Hoardless does: its Hugging Face detector reads HF_HUB_CACHE, then HF_HOME, then XDG_CACHE_HOME, and lists two rows per repo, both at the Confirm tier: old revisions no ref points to with the blobs only they use, and the rest of the repo, so the two never count the same bytes. Partial downloads untouched for over a day are one Auto row. The datasets cache is a Confirm row. It follows hf cache semantics but moves exact snapshot folders and blobs to the Trash with an undo log, never a blob a kept revision links to, and never the token. A model also stored by Ollama or LM Studio gets a note.
What comes back and when?
A removed repo downloads again the next time code asks for it, in full. Pruned old revisions come back only if something requests that exact revision. If you deleted the token, sign in again with hf auth login.
Old revisions, split out from the models you use
Hoardless lists each Hugging Face repo with its old revisions as a separate row (Confirm tier), partial downloads (Auto), and weights duplicated in Ollama or LM Studio, then moves what you pick to the Trash with an undo log.
14-day full trial. macOS 14 or later.
Questions
Where is the Hugging Face cache on a Mac?
At ~/.cache/huggingface/hub by default. HF_HUB_CACHE changes the hub folder, and HF_HOME moves the whole Hugging Face home, token included.
Will deleting ~/.cache/huggingface log me out?
Yes. huggingface_hub stores your User Access Token in $HF_HOME/token, which is ~/.cache/huggingface/token by default. Delete only the hub folder to keep it.
What does hf cache prune delete?
Revisions no branch or tag points to, leftover .incomplete files from interrupted downloads, and shared blobs no cached repo uses. It asks before deleting and supports --dry-run.
Can I delete the xet folder?
Yes. Hugging Face says you can remove the xet cache entirely to reclaim its space. It holds upload shards and staging data, not your downloaded models.
Do MLX models from Hugging Face land here too?
Yes, when they are downloaded through huggingface_hub. They are stored as repos in the hub folder like any other model.
New guides by email
New guides and Hoardless releases, twice a month at most.
Confirm first. Unsubscribe in one click. Privacy.