How-to · 30 Oct
How-to · 3 min read
How to clear old Claude Code and Codex files on a Mac
If you use AI coding agents like Claude Code, Codex or Cursor every day, your Mac slowly fills with their old versions, debug logs and caches. You notice it when the disk warning shows up and none of your own files explain the missing gigabytes. The folders sit in hidden places like ~/.claude, ~/.codex and Library caches. And deleting the wrong one could wipe your session history or a setup you still need.
- Published
- 17 Nov 2026
- Delivery
- No. 12
- Evidence
- 9 claims quoted from diskcensus.com
01
Why it's hard
Agent tools update often and many keep each old version on disk, while logs and caches pile up in the background without any cleanup of their own. These files live in dot folders and Library paths that Finder hides by default, so normal storage views lump them into a vague category. General Mac cleaners tend to know about browser and system caches but not about where each agent stores its data. Then there is the risk, because the same folder can hold a disposable cache right next to your conversation history. So most people either leave it all in place or delete a whole folder and hope for the best.
This part describes the usual way. It makes no claims about Disk Census, so nothing is quoted here.
02
How Disk Census does it
Disk Census has a separate AI Agents view that finds old versions, caches and logs from tools like Claude Code, Codex, Cursor and Gemini CLI. It sorts what it finds into items that are safe to clean because they rebuild on their own, items that need your review, and items like agent history that are shown for information. Nothing is deleted until you tick it and confirm the list. You can do the same from Terminal with the census command, or let your agent run it. Each row shows the size and the exact path, so you can see which tool and which version a file belongs to before it goes.
Old versions, caches and logs from tools like Claude Code and Codex add up.Quoted from diskcensus.com
Disk Census finds them, and anything you might want back waits for your review.Quoted from diskcensus.com
census findings --category ai_agentsQuoted from diskcensus.com
03
Step by step
- 1Install Disk Census on a Mac with macOS 12 or later and run a scan.
- 2Open the AI Agents view to see each tool and how much space it uses.
- 3Clean the items marked safe, such as debug logs and old versions, after checking the list.
- 4Look at the review items one by one, like a large virtual machine bundle, before deciding.
- 5Untick anything you want kept so later cleans leave it alone.
- 6Or run census findings --category ai_agents in Terminal to get the same list as text.
04
Tips
Clean the safe group first. Debug logs, caches and old versions are rebuilt when needed, so clearing them frees space without touching how your agent works today.
Rebuilt automatically when needed.Quoted from diskcensus.com
Be slow with history. Session folders can be large, but they hold past conversations you may want to search later, which is why they are listed for information rather than offered for cleanup. If you never look back at old sessions, you can still clear them later by hand, knowing exactly where they are.
General advice. Not a claim about the product.
Remember that cleaned items do not go to the Trash. The space comes back right away, but so does the need to check the list before you confirm. A quick look at the paths is usually enough to catch anything you did not mean to include.
Deleted items skip the Trash, so you get the space back right away.Quoted from diskcensus.com
If one cache keeps growing back and you want it left alone, untick it once. Disk Census skips it in later cleans, which saves you rechecking it every time.
Untick an item once and Disk Census leaves it alone from then on.Quoted from diskcensus.com
05
Questions
Can my AI agent run the cleanup itself?
Yes. The census command line ships inside the app, and your agent can run it too.
Your agent can run census too.Quoted from diskcensus.com
Do deleted files go to the Trash first?
No. Disk Census deletes permanently, and only the exact items you approve.
Disk Census deletes permanently, and only the exact items you approve.Quoted from diskcensus.com
Is there a free trial?
No. There is no trial and no free version, but there is a 14-day refund if it does not do what the site says.
None, and no free version.Quoted from diskcensus.com