Is it safe to delete Codex worktrees?
A separate copy of a project that the Codex app made for a thread, so its changes don't touch your main checkout.
Review first
It's your own data, or hard to recreate. Decide item by item.
~/
- Only when it contains .git
What it is
The Codex app creates a git worktree for each thread that runs in its own worktree, in a short-named folder inside its worktrees folder. Each worktree is a full copy of the project's files with a .git file that points back to the main repository, and it grows as the thread installs dependencies and builds. These worktrees aren't on a branch. By default Codex keeps your 15 most recent worktrees and saves a snapshot of each one's work before it deletes it; permanent worktrees are never deleted automatically.
If it's removed
Changes in the worktree that you haven't committed are lost with the folder. Commits made in it that aren't on a branch can be lost too, once git tidies up. The main repository keeps working, and git forgets the missing worktree the next time it tidies up.
How it's removed
Moved to the Trash, where you can restore it.
The free analyzer finds it and explains it. Removing it is Pro, after a review sheet that lists every move and command. It's never checked for you: it waits for your choice.
Sources
- learn.chatgpt.com/docs/environments/git-worktrees
- learn.chatgpt.com/docs/config-file/environment-variables
- git-scm.com/docs/git-worktree
Last checked on 14 Oct 2026. Every entry is written and checked by hand; the app and the command-line tool use the same words.