[{"data":1,"prerenderedAt":235},["ShallowReactive",2],{"blog-article-\u002Fblog\u002Fcodex-disk-usage":3},{"id":4,"title":5,"author":6,"body":7,"category":217,"cover":218,"coverAlt":219,"description":220,"draft":221,"extension":222,"meta":223,"navigation":224,"path":225,"publishedAt":226,"seo":227,"stem":228,"tags":229,"translationKey":233,"updatedAt":226,"__hash__":234},"articles_en\u002Fblog\u002Fcodex-disk-usage.md","Codex Disk Usage Too High? Free Up Space, Keep Your Projects","Harry",{"type":8,"value":9,"toc":208},"minimark",[10,19,22,35,40,50,61,67,71,79,90,96,107,110,114,128,131,137,143,146,149,153,156,163,175,183,187,190,196],[11,12,13,14,18],"p",{},"You've been building things with Codex, and now your drive is running short of space. A look inside ",[15,16,17],"code",{},".codex"," turns up a folder much larger than you expected. What can you actually remove?",[11,20,21],{},"Not everything in there is a cache. Project copies, downloaded dependencies, build files, and chat history can all contribute. Wiping the folder could take unfinished work with it.",[11,23,24,28,29,34],{},[25,26,27],"strong",{},"Start with caches and rebuildable files you no longer need, not the projects themselves."," ",[30,31,33],"a",{"href":32},"\u002F","MangoDisk"," helps you find the biggest folders, then review the items its cleanup rules support. You don't have to hunt through every project or learn a set of terminal commands first.",[36,37,39],"h2",{"id":38},"why-is-it-so-big-when-the-code-is-so-small","Why is it so big when the code is so small?",[11,41,42,43,49],{},"When Codex runs tasks in separate worktrees, each copy of a project can accumulate its own dependencies and build files. OpenAI's ",[30,44,48],{"href":45,"rel":46},"https:\u002F\u002Flearn.chatgpt.com\u002Fdocs\u002Fenvironments\u002Fgit-worktrees",[47],"nofollow","worktree documentation"," explains this extra disk usage.",[11,51,52,53,56,57,60],{},"For a web project, ",[15,54,55],{},"node_modules"," holds packages the project needs to run. A Rust project's ",[15,58,59],{},"target"," folder holds compiled output. Even after you put a project aside, those files may still be there.",[11,62,63,64],{},"But don't assume they're the biggest problem on your computer. Session history or the app's own caches might account for more. ",[25,65,66],{},"Check the largest folders first so you spend time cleaning something that will actually make a difference.",[36,68,70],{"id":69},"see-where-the-space-is-going","See where the space is going",[11,72,73,74,78],{},"Open ",[30,75,77],{"href":76},"\u002Fdocs\u002Ffeatures\u002Fdisk-analysis","Disk Space Analysis"," in MangoDisk and scan the relevant drive or user folder. The larger a rectangle, the more space that folder takes up. Click through to see what's inside.",[11,80,81],{},[82,83],"img",{"alt":84,"decoding":85,"height":86,"loading":87,"src":88,"width":89},"MangoDisk Disk Space Analysis showing folder sizes in a directory list and treemap","async",1590,"lazy","https:\u002F\u002Fassets.mangodisk.app\u002Fimages\u002Fscreenshots\u002Fen\u002Flight-05-disk-space-analysis.jpg",2372,[11,91,92,93,95],{},"For Codex, look for ",[15,94,17],{}," in your user folder. If you've changed its storage location, check that location instead. Tasks running in WSL or on a remote computer need to be checked in that environment, not just on your local drive.",[11,97,98,99,102,103,106],{},"If ",[15,100,101],{},"worktrees"," is large, open the projects inside it and see whether dependencies, build output, or your own files account for most of the space. If ",[15,104,105],{},"sessions"," is the large folder, that's conversation history; it needs different treatment.",[11,108,109],{},"You haven't deleted anything at this point. You've just found where a cleanup is worth considering.",[36,111,113],{"id":112},"keep-the-project-remove-what-you-can-rebuild-later","Keep the project. Remove what you can rebuild later.",[11,115,116,117,121,122,124,125,127],{},"MangoDisk 1.1.0 added cleanup support for Codex worktrees. ",[30,118,120],{"href":119},"\u002Fdocs\u002Ffeatures\u002Fdeep-clean","Deep Cleanup"," checks recognized worktrees for supported dependencies and build files, including ",[15,123,55],{},", certain framework caches, and ",[15,126,59],{},". It also checks supported Codex-related caches and some diagnostic files.",[11,129,130],{},"Expand the scan results to see paths, sizes, and cleanup notes. Projects you won't be running again soon are a good place to start.",[11,132,133],{},[82,134],{"alt":135,"decoding":85,"height":86,"loading":87,"src":136,"width":89},"MangoDisk Deep Cleanup showing cache categories, selection controls, and project build artifacts","https:\u002F\u002Fassets.mangodisk.app\u002Fimages\u002Fscreenshots\u002Fen\u002Flight-01-deep-cleanup.jpg",[11,138,139,142],{},[25,140,141],{},"Project build artifacts are unchecked by default. These rules remove only the supported items you select, not source code, Git data, or whole worktrees."," You can keep a project without also keeping all of its installed dependencies and build output on disk.",[11,144,145],{},"The trade-off is time: when you return to it, you'll need to reinstall dependencies or rebuild, which may require an internet connection. Leave today's active projects alone. If you've manually edited anything inside a dependency folder, save those changes elsewhere first.",[11,147,148],{},"Before cleaning, save your work, let tasks finish, close Codex or ChatGPT when prompted, and stop the relevant builds and tests. Check the selection before confirming; there's no need to select every result.",[36,150,152],{"id":151},"what-if-chat-history-is-taking-up-the-space","What if chat history is taking up the space?",[11,154,155],{},"Don't treat it like a download you can simply fetch again. Session files may be needed to recover or continue earlier tasks.",[11,157,158,159,162],{},"MangoDisk can show how much space those folders use, ",[25,160,161],{},"but Deep Cleanup does not currently delete Codex session history",". If that's where most of the space has gone, clearing caches will only help so much. Check for Codex updates and review its current history-management options, keeping the tasks you need and backing up important data.",[11,164,165,166,171,172,174],{},"For entire worktrees you no longer need, review Codex's ",[30,167,170],{"href":168,"rel":169},"https:\u002F\u002Flearn.chatgpt.com\u002Fdocs\u002Fenvironments\u002Fgit-worktrees#worktree-cleanup",[47],"worktree retention and cleanup settings"," after saving your changes. Don't delete the whole ",[15,173,17],{}," folder or assume that archiving a task clears all its history.",[11,176,177,178,182],{},"One important distinction: Disk Space Analysis shows readable files, not a list of junk. Manually deleting from the treemap is permanent and bypasses the Trash or Recycle Bin. Leave anything you're unsure about in place; the ",[30,179,181],{"href":180},"\u002Fdocs\u002Fsafety","safety guide"," explains the difference.",[36,184,186],{"id":185},"make-room-without-starting-over","Make room without starting over",[11,188,189],{},"The more projects you work on, the less appealing it becomes to track every cache by hand. Let MangoDisk find the big folders, then review the dependencies and build files from projects you've put aside.",[11,191,192,195],{},[30,193,194],{"href":32},"Download or update MangoDisk"," to see what's worth cleaning on your computer. It's free and open source, runs on Windows and macOS, and needs no account or login. Disk analysis and Deep Cleanup run locally; you don't need to enable AI explanations.",[11,197,198,199,203,204],{},"Related: ",[30,200,202],{"href":201},"\u002Fblog\u002Fcargo-cache-vs-target-folder","Cargo Cache vs target Folder: What Can You Delete?"," · ",[30,205,207],{"href":206},"\u002Fblog\u002Fis-ai-disk-cleanup-safe","Is AI Disk Cleanup Safe?",{"title":209,"searchDepth":210,"depth":210,"links":211},"",2,[212,213,214,215,216],{"id":38,"depth":210,"text":39},{"id":69,"depth":210,"text":70},{"id":112,"depth":210,"text":113},{"id":151,"depth":210,"text":152},{"id":185,"depth":210,"text":186},"Developer Disk Cleanup","\u002Fimages\u002Fblog\u002Fcodex-disk-usage.webp","A brush lifts cache blocks away from a laptop while project files and chat history stay beside it","Codex disk usage growing? Find what's taking up space with MangoDisk, clean supported caches and build files, and keep your code and chat history out of the cleanup.",false,"md",{},true,"\u002Fblog\u002Fcodex-disk-usage","2026-09-11T11:20:00+08:00",{"title":5,"description":220},"blog\u002Fcodex-disk-usage",[230,231,232],"Codex disk usage","Codex cache cleanup","Codex worktrees","article-codex-disk-usage","2p61w6AxlCCDdvGO_pOAq0rGR8EocJnlf8wGlV3r5RE",1789210724596]