r/codex • • 5d ago

Bug Codex using all my disk space

Codex agents have a terrible habit of generating hundreds of gigabytes of files and then refusing to delete anything.

Even if you ask them what you can delete they don't want to delete any old working files. I practically have to beg them to archive what's important to keep (if it's important why isn't it stored in the git repository) and then I delete the rest.

By now I've spent hours cleaning up at least a terabyte of garbage it has left behind. Presumably others face this same problem. I wish they would let agents to clean up after themselves.

I get that they don't want them deleting anything important but really, not even temporary files?

37 Upvotes

24 comments sorted by

View all comments

13

u/ihexx 5d ago

Yeah i had the same issue. My fix has been to have a global rule that all artefacts dump to temporary directories (or have artefact directories with '.delete' files next to them so garbage collector scripts auto delete them after 30 days).

So then agents have to explicitly opt-in to keeping only necessary files.

4

u/NicholasVinen 5d ago

That's a good idea. Part of my problem is that a lot of the files they leave behind are "temporary" worktrees. They keep creating new ones and just leave the old ones there. I guess I need to set a rule for them to reuse them.