~/.codex and ~/.claude sorted before cleanup
A cleanup that could delete your chats: items sorted Keep, History, Work, Clearable or Unknown, each command approved by you.
367 saves on X, as of Posted
Prompt
Disk audit: ~/.codex and ~/.claude
Report first. Change nothing until I approve.
1. Measure: du -sh both folders, the 20 biggest items in each, and Codex sessions/ + archived_sessions/ by month. Sizes, counts and dates only. Never open auth, config or chat files.
2. Sort every item into one bucket:
- Keep: auth, config, rules, skills, memories, every database file
- History: chats, prompt history, generated images. Gone for good if deleted
- Work: Codex worktrees. Any with changes or unpushed commits moves to Keep
- Clearable: cache, tmp, debug, trash folders
- Unknown: treat as Keep
3. Propose numbered commands, each with its bucket and the GB it frees. Clearable only by default, and skip anything touched in the last 24 hours. For History, offer to move it to a folder or drive I pick, or gzip it, and note that a moved Codex chat can't be reopened until it's back. Never rm history, never rm -rf a worktree, never touch a database. If a setting caps the growth, name it: Codex history.max_bytes, Claude Code cleanupPeriodDays.
4. Stop. Run only the numbers I approve, then show before and after.Next Send it to Codex.
Before you clean up ~/.codex, have Codex sort out what’s safe to delete and what would take your chat history with it.
My disk was 96% full, so I checked: ~/.codex alone was 82 GB.
- 54 GB of archived chats, 3,900 of them, going back to last November
- the biggest single chat is 2 GB, and 21 are over 500 MB
- the cache that’s safe to delete comes to under 0.2 GB
To free up space, move those old chats to an external drive and move them back when you need them.
