Skip to content

This thread's worktree was removed to save disk space for threads actively worked on. #12895

Open

Description

@alexaka1

What version of the Codex App are you using (From “About Codex” dialog)?

26.224.1209 (697)

What subscription do you have?

Pro

What platform is your computer?

Darwin 24.6.0 arm64 arm

What issue are you seeing?

Worktree cleaned up. This thread's worktree was removed to save disk space on threads that are active being worked on, as in I sent a message to in 30/60 minutes ago and it is the second most recent thread in a project. This happens randomly periodically when new threads are created on unrelated projects. This is really bad as I have just lost hours of work because of this.

The model didn't delete anything. This is entirely Codex App driven as far as I know.

What steps can reproduce the bug?

No idea.

What is the expected behavior?

Don't clean things up unless the user explicitly asks for it.

Additional information

Image

Activity

  1. added
    app
    on Feb 26, 2026
  2. added
    bug
    on Feb 26, 2026
  3. added
    worktrees
    on Apr 24, 2026
  4. dex-tripnull commented on Sep 19, 2026

    @dex-tripnull

    Corroborating Windows Codex Desktop occurrence: a task used for an ongoing scheduled workflow lost its managed worktree repeatedly while its branch and task remained in place. The scheduled run failed before executing work because the saved working directory was absent. One supported Handoff attempt then failed with “The source thread workspace is not a git repository,” so it could not rebind the task after the workspace vanished. We did not establish what removed the worktree and are not attributing it to a specific cleanup path. The workflow was moved to a separately verified durable checkout rather than reconstructing the missing managed worktree again. Expected: active scheduled workspaces should not disappear without an explicit owner action, and a supported recovery/rebind path should remain available if they do. Private task IDs, paths, and logs omitted.

  5. MeteorsLiu commented on Nov 23, 2026

    @MeteorsLiu

    Same issue.

    I use codex cli on XXX worktree, it just works fine until i open codex desktop, it removes my workthree XXX without any notification!

    I am surprised, THIS IS SO DANGEROUS!

    I didn't push that worktree to the remote, codex desktop removes it without any confirm. Luckily, astra helps me to find it back.

    And I found this is a feature for codex desktop.... In the latest version of Codex Desktop, it will remove worktrees automatically when the number of worktrees exceeds 15. But it seems like this feature removes worktrees randomly...

    Don't update the latest codex desktop, who came up with this shit feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugworktrees

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions