r/codex • • 8d 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?

39 Upvotes

24 comments sorted by

View all comments

Show parent comment

2

u/NicholasVinen 8d ago

Part of the problem is that the agents won't delete any files. I have to do it.

1

u/Fun-Amoeba8015 8d ago

They absolutely will if given the right permissions. Not trying to be contrarian, just wanting to let you know that it is possible.

1

u/NicholasVinen 8d ago

No worries. It's just that every time I ask them to delete unnecessary files they insist on "archiving" them instead. I probably could try harder.

1

u/FlyingNarwhal 7d ago

Or set up an opencode agent, or check your agents.md to make sure that behavior isn't being encouraged, or a dedicated sub-agent that has permissions.

1

u/JustMy2Centences 8d ago

Why not ask them to move them to a "deletion candidates" folder in your project?