The folders you did not make
With an AI coding tool, a new project costs one sentence. So does a second copy of it to try another idea, a build to see whether it works, and a fresh set of packages to run it. People call it vibe coding.
What is easy to miss is that every one of those steps writes folders to your disk, and many of them stay there. The tool moves on to the next task. You never opened those folders, so you do not think of them as yours.
Storage settings will not help much. It mostly shows categories, not folders, and a lot of this sits in hidden folders it does not name.
Where the space goes
Six kinds of thing. The folder names are the ones you will see on your own disk. These tools change quickly, so the details are as their makers documented them in November 2026.
- Extra copies of the project. To work on two things at once, an assistant makes a second working copy of your project, called a worktree. Each copy has its own files, and usually its own installed packages and build output. OpenAI’s documentation says it plainly: “Worktrees can take up a lot of disk space.”
- Installed packages. A web project keeps its packages in a folder called
node_modules; a Python project keeps them in a virtual environment, often called.venv. Every project and every copy gets its own. The package managers also keep what they downloaded, mostly in hidden folders in your home folder. - Build output. Each time an assistant builds an Xcode project to check its work, Xcode writes build output to a folder called DerivedData. A copy of the project in a different place gets a build folder of its own, and that folder stays when the copy is gone. Xcode taking up space on your Mac covers DerivedData and simulators in full.
- The record of every session. Claude Code and Codex each keep a record of what you asked and what they did, in a hidden folder in your home folder. Long sessions make large files. Ordinary ChatGPT chats are different: OpenAI says they stay in your account, so they are unlikely to be what fills a disk.
- The tools themselves. The desktop apps keep data of their own in your Library too, and it may be large; a map will show you. Xcode downloads each coding agent you turn on, and Apple points to Settings → Components for managing its downloads.
- Projects you abandoned. The experiment from March that never worked. It still has its packages, its builds and its copies.
Where Claude Code and Codex put the first and the fourth of these:
| Tool | Extra project copies | Session records |
|---|---|---|
| Claude Code | Inside the project: a hidden .claude folder, then worktrees. It removes a copy that holds no changes when an ordinary session ends. | In .claude in your home folder. Deleted after 30 days by default; sessions started in the Claude desktop app are kept until you set a limit. |
| Codex, now part of the ChatGPT desktop app | In your home folder: .codex, then worktrees. It keeps the 15 most recent by default. | In .codex in your home folder. No age limit found in its documentation. |
If your tools run code in Docker, that is one more large file of its own: see Docker and VM disk images on a Mac.
See it first, with Klarity
Klarity, the Mac disk space analyzer I build, draws a folder as a map. Every folder is a rectangle, and its size on screen is the space it takes on disk, so the biggest thing is the biggest shape.
View Klarity Disk on the Mac App Store
Click Home in the sidebar. Klarity scans hidden folders too, so .claude, .codex and package downloads such as .npm appear as rectangles beside Desktop and Documents, with their sizes. Double-click any rectangle to go inside it.
Then look at the colours. Klarity colours each rectangle by how long since it last changed: blue for this month, through green, gold and orange, to red for three years or more. In a folder of projects, that is the question you need answered. Blue is what you are working on. A large gold or orange rectangle is probably a project nobody has touched in a year or more, still carrying its packages and its builds. Double-click it and the colours inside confirm it.
Select a rectangle and the inspector on the right shows its size, its share of the folder above, how many items it holds, when it last changed and the largest things inside. Large files in the toolbar lists the biggest single files in the folders the scan has opened. To find one very long session record, double-click into .claude and then projects first.
One honest limit. Klarity shows you size and age. It cannot tell you whether a folder holds the only copy of your work, and it does not clean anything by itself. That decision stays with you, and the next section is about making it.
Klarity is on the Mac App Store. It is $6.99 once, for macOS 14.6 or later, with no subscription, no account and no network access.
What comes back by itself, and what does not
This is the part worth reading slowly.
Rebuilt when you next need it:
- Build folders in DerivedData. Apple says the folder “is often large and can be re-created at any time from your source files”. The next build is slower, once.
node_modules. The project keeps a list of the packages it needs, and installing from that list fills the folder again.- Python virtual environments. Python’s own documentation calls one disposable: “it should be simple to delete and recreate it from scratch.” That holds as long as the project lists what it needs.
- Package downloads. Downloaded again when needed, which costs time and data, not work.
Not rebuilt. Check before you touch these:
- Extra copies with unfinished work. If an assistant changed files in a copy and those changes were never merged or pushed, that copy may be the only place they exist.
- Projects that were never pushed anywhere. A scratch project that lives only on this Mac is gone when its folder is.
- Session records. Anthropic says what you lose with Claude Code’s: you can no longer resume or rewind those past sessions, and the notes the tool saved about each project go with them.
- The tools’ own folders as a whole.
.claudeand.codexalso hold your settings, and Codex can keep your sign-in there. Never move the whole folder to the Trash to save space.
How to get it back, lowest risk first
- Old build folders. Start here, because Xcode makes them again. Follow the Xcode guide for DerivedData.
- Packages in projects you are not working on. Find a gold or orange project on the map, open it, and move its
node_modulesor.venvto the Trash. Keep the project. If it still has its list of packages, they install again when you come back. - Finished copies. First make sure the work in them was merged or pushed. Then let the tool that made the copy remove it. In the ChatGPT desktop app, archiving a chat deletes its copy, and Codex saves a snapshot of the work first. Claude Code asks whether to keep or remove a copy that has work in it when you leave an ordinary session; choosing remove deletes that work, so check first. Either is better than the Trash, because the project keeps a record of its copies. Git itself will not remove a copy with uncommitted changes unless it is forced to, which is the protection you want.
- Old session records. Use the tool’s own settings. Claude Code deletes transcripts after 30 days unless that was changed; the setting is called
cleanupPeriodDays. Sessions started from the Claude desktop app are kept with no age limit unless you set one. Codex has settings that cap its history file or turn it off; none was found in its documentation for older session records. Delete records by hand only if you are sure you will not need to go back. - Abandoned projects. Open the folder and look. If it exists nowhere else and you might want it, copy it to another drive first. Then move it to the Trash.
In Klarity, right-click a rectangle or use the Move to Trash… button in the inspector. Klarity only ever moves things to the Trash. A folder of 1 GB or more needs a slide to confirm, and anything inside your Library, outside its Caches, Developer and Logs folders, gets an extra warning first, because apps keep their data there. A few folders your account depends on are refused outright. Until you empty the Trash, the space is not free, and a mistake can still be put back.
Keep it from coming back
- When a task is finished and its work is merged or pushed, archive the chat or let the assistant remove the copy it made. Both tools already clear some copies by themselves: Codex keeps the 15 most recent by default, and Claude Code removes a copy that holds no changes when an ordinary session ends.
- Keep experiments in one folder, so they are easy to find later.
- Look at your home folder on the map once a month. Old and big is the combination worth acting on; finding old files on a Mac uses the same approach for everything else.
See your disk. Clearly.
$6.99 one-time · macOS 14.6+ · Apple Silicon & Intel
Download on Mac App StoreQuestions people ask
Can I delete the .claude or .codex folder to free space?
Not the whole folder. Besides session records it holds your settings, and Codex can keep your sign-in there. Look inside it on a map first, and use the tool’s own settings where it has them: Claude Code can limit how long session records are kept, and Codex can cap the size of its history file.
Is it safe to delete node_modules?
In a project that still has its list of packages, the folder can be installed again, so you lose time, not work. Move it to the Trash, and keep the project itself.
Why does one Xcode project have so many DerivedData folders?
A copy of a project in a different place gets a build folder of its own, so each copy an assistant builds leaves one behind, and it stays after the copy is removed. Apple says derived data can be re-created at any time from your source files, so the old ones can be cleared.
What is a worktree, and can I delete one?
A worktree is a second working copy of a project that shares its history with the original. Remove one only after its changes are merged or pushed, and let the tool that made it do the removing where you can.
— Mukul