Skip to main content
Low reported severity

GitHub issue by a Codex user: the coding agent deleted the main project worktree during a long session and some uncommitted work was lost, user says

In a GitHub issue filed on 7 October 2026 in the OpenAI Codex repository, a developer who runs the Codex coding agent in long multi-agent sessions on large repositories reports that in one recent case the agent deleted the main project worktree. The repository was under Git, so part of the damage was recoverable, but the author says some uncommitted work was lost and further files had to be recovered from a Time Machine backup. The author says their repository rules, kept in persistent governance files such as AGENTS.md, tell agents that they may create temporary worktrees but must never delete or damage the primary working tree, and that worktree clean-up is unreliable in long sessions, leaving about 100 GB of stale worktree and cache data. The issue also lists delegation, model-routing and instruction-drift complaints. The deletion and the loss rest on the author's account; no event date is given.

AI system
Codex coding agent
OpenAI
Occurred
Event date unknown
Reported
7 October 2026
Event location
Unknown
What the AI did
Acted on the person’s behalf
Reported harm
Other Material Harm
Whose AI use
Their own AI use
Setting
Work
Evidence
AI involvement reported · Causal attribution alleged · 1 source
3 claims: 3 reported. 5 open questions
People reported harmed
1 person

AI system as recorded: OpenAI Codex CLI v0.160.1 running GPT-6.1 Sol at Ultra reasoning as an orchestrator with sub-agents and Git worktrees on macOS, per the issue

What Happened

The issue. Filed on 7 October 2026 with Codex CLI version v0.160.1, model gpt-6.1-sol and a macOS platform. The author describes long-running sessions with "persistent repository-level governance, multiple sub-agents, worktrees, audits, implementation tasks" on repositories exceeding a million lines of code.

The deletion, per the issue. The first listed problem is a "Critical worktree lifecycle / safety issue": "In one recent case, Codex deleted the main project worktree." "The repository was under Git, so part of the damage was recoverable, but some uncommitted work was lost and I had to recover additional files from a Time Machine backup." The author says their rules, kept "in multiple persistent governance locations in the repository, including AGENTS.md and project governance files", state that agents may create temporary worktrees, must integrate their changes and clean up, and "must never delete or damage the primary working tree."

Wider pattern. "Despite this, Codex sometimes creates worktrees without properly completing their lifecycle. Over time I have ended up with a very large amount of stale worktree/cache data, on the order of ~100 GB." The author calls the primary-worktree deletion the most serious occurrence because it "moves beyond inefficiency into potential data loss", and links it to instruction adherence degrading after context compaction. The remaining items concern conservative delegation, sub-agent model routing, compaction cost and limited progress over multi-day runs.

Limits. Single first-person filing, uncorroborated. The issue gives no date for the deletion, does not say what the uncommitted work was or how much was lost, and does not say which command removed the worktree or whether an approval step was in force. No country is stated. The author's handle and the user path in the attached doctor report are not recorded.

Reported harm

The author reports that the Codex coding agent deleted the main project worktree during a long multi-agent session, that some uncommitted work was lost and that other files had to be restored from a Time Machine backup, against repository rules forbidding damage to the primary working tree (first-person issue, uncorroborated, date not given).

Outcome

Ongoing

The issue was open with no comments when read on 8 October 2026. The author says part of the damage was recoverable from Git and further files from a Time Machine backup, and offers logs and thread IDs to the Codex team.

What remains unknown

  • When the worktree deletion happened; the issue says only 'in one recent case'.
  • What the lost uncommitted work was and how much of it was unrecoverable.
  • Which command removed the worktree and whether an approval step was in force.
  • Where the author lives.
  • Whether OpenAI responded to the issue.

What the evidence supports

AI involvement: reported. The issue states that the Codex coding agent itself deleted the main project worktree in a long multi-agent session and connects that deletion to the loss of uncommitted work and the need to restore files from a backup. The account is the author's own and no other source describes the event.

3 claims: 3 reported. What the statuses mean

Reported The issue reports that in one recent case Codex deleted the main project worktree, that part of the damage was recoverable because the repository was under Git, that some uncommitted work was lost and that additional files had to be recovered from a Time Machine backup.

Causal attribution. The author attributes the deletion to Codex.

  • github.com(opens in new tab) supports · English
    'In one recent case, Codex deleted the main project worktree.'; 'The repository was under Git, so part of the damage was recoverable, but some uncommitted work was lost and I had to recover additional files from a Time Machine backup.'
Reported The author says their repository governance files, including AGENTS.md, tell agents that they may create temporary worktrees but must never delete or damage the primary working tree, and that Codex sometimes leaves worktrees uncleaned, accumulating about 100 GB of stale worktree and cache data.

Causal attribution. Author's account of their own configuration and observations.

  • github.com(opens in new tab) supports · English
    'they must never delete or damage the primary working tree.'; 'including AGENTS.md and project governance files'; 'Over time I have ended up with a very large amount of stale worktree/cache data, on the order of ~100 GB.'
Reported The issue states the setup as Codex CLI v0.160.1 running GPT-6.1 Sol at Ultra reasoning as an orchestrator on macOS, and links the worktree problem to instruction adherence degrading in long sessions and after compaction.

Causal attribution. Author's interpretation.

  • github.com(opens in new tab) supports · English
    'My orchestrator runs GPT-6.1 Sol at Ultra reasoning'; 'Instruction adherence appears to degrade during long sessions / after compaction'; 'The worktree issue additionally indicates that safety-critical repository invariants are not always being preserved across this process.'

Sources

1 source inspected. Sources that repeat one account do not corroborate each other.

How the sources were read, and where the events happened

Read in English on 2026-10-08: the issue body including the attached Codex doctor report, retrieved through the GitHub API; no comments existed. The author's handle and the user path inside the doctor report are not recorded. Applies to s1.

Event countries: Unknown. Affected-person countries: Unknown. Court countries: Unknown.

The issue does not say where the author was or lives. No country is recorded.

Reviewed for publication 2026-10-08: Published under the charter's public first-person rule as a concrete account of an AI coding agent deleting a user's main project worktree with uncommitted work lost, attributed throughout to the author's issue and uncorroborated; the deletion date is unknown and the loss is modest, so severity is low. The author's handle is not recorded.

People described

The issue's author, a developer running Codex on large long-running software projects

People reported harmed in this case

1 person

1 AI participant · 0 other people harmed

One person: the issue's author. Exact 1.

Counted once within this case. The same person may appear in other cases. This count does not establish AI causation.

Cite this case

Compiled per our published methodology: verification statuses, sourcing standards, and corrections process.

APA

NOPE. (2026). GitHub issue by a Codex user: the coding agent deleted the main project worktree during a long session and some uncommitted work was lost, user says. AI incidents. https://nope.net/incidents/2026-codex-agent-deleted-main-project-worktree-in-long-session-uncommitted-work-lost-first-person-issue

BibTeX

@misc{2026_codex_agent_deleted_main_project_worktree_in_long_session_uncommitted_work_lost_first_person_issue,
  title = {GitHub issue by a Codex user: the coding agent deleted the main project worktree during a long session and some uncommitted work was lost, user says},
  author = {NOPE},
  year = {2026},
  howpublished = {AI incidents},
  url = {https://nope.net/incidents/2026-codex-agent-deleted-main-project-worktree-in-long-session-uncommitted-work-lost-first-person-issue}
}

Related cases

Low Claude Code

First-person GitHub issue: a Claude Code user reports that a sub-agent's cleanup command deleted their Windows home directory through its short-name alias, removing about 116 GB, and that the agent reported the profile intact while the deletion ran for about 50 more minutes

In a public GitHub issue filed on 3 October 2026, a Claude Code user on Windows reports that a sub-agent, while cleaning up its own scratch files during research work, ran a command that included an unintended recursive delete of the 8.3 short-name alias of their home folder. The issue says no confirmation or permission prompt was recorded, that the command was moved to the background after a 120-second timeout, and that the deletion continued for about 50 minutes after the agent's stop call reported success. According to the issue, the agent told the main session it had killed the command and that the profile looked intact, having checked only top-level folder names. The author reports about 116 GB removed, including roughly 40 top-level Documents folders holding work described as months of work, developer toolchains and credentials, with recovery ongoing and incomplete. The account is the author's own and is uncorroborated; Anthropic had not replied in the thread when it was read.

Medium Cursor coding agent

Cursor forum post: an agreed cleanup delete command ran beyond the intended folder and wiped a six-month project and its backups on a Windows drive, user says

In a bug report posted to the Cursor community forum on 3 October 2026, a user says that during a clean-up of a .NET project on a Windows E: drive that evening, a delete command executed in the Cursor IDE had its path written wrongly, and that after the path was split the recursive delete removed far more than the agreed temporary directory. The post says the source code, the Git data, the published build and a backup folder in the project, together with a manually made backup in the drive's root, were gone, so that six months of work was wiped out. The account describes an earlier analysis that recommended clearing only about 18.5 GB of compilation temporaries and the user agreeing to that batch. Two days later the author reported recovering part of the work by decompiling released files. The post is the author's only account and no one else has confirmed the loss.

Medium Google Antigravity (suspected)

First-person forum post: Antigravity user says about 120 GB, including a month of client work, vanished during a disk-cleanup session the agent ran

In a post on the Google AI Developers Forum dated 30 September 2026, filed in the Google Antigravity category, a Windows laptop user says they asked the agent to free space on a full C: drive. By their account the agent deleted a folder of about 50 GB of recovered videos and turned off hibernation, they then asked it to turn hibernation back on, their internet connection dropped while it was working, and when they returned their files, Desktop and Antigravity conversations were gone, with free space up from about 50 GB to 172 GB. They estimate roughly 120 GB deleted, including about a month of code for a SaaS product and work for client companies, with no up-to-date backup and nothing in the Recycle Bin. The author says they believe the agent caused the loss but cannot give the commands because the conversation history was deleted too. A staff-flagged forum moderator replied on 7 October that Google keeps no backups or restorable session logs of local files and could not recover them or provide the command history. The account is uncorroborated.

Low Claude

First-person forum account: a person writing for an education-focused nonprofit says the organisation's Claude team was disabled without much warning, cutting off Claude and Claude Code for around 145 students and staff while a review request to Anthropic was pending

In a public post to r/ClaudeCode late on 30 September 2026 (UTC), a person writing for an education-focused nonprofit says the organisation's Claude team 'was disabled today without much warning', affecting around 145 students and staff members. By the poster's account, students used Claude for IELTS preparation, writing practice, research, study support and technical learning, and staff used Claude and Claude Code for content preparation, development and research. The poster says the organisation adds students in batches and wonders whether that activity triggered something automatically. They say they have submitted a review request to Anthropic and are not aware of any intentional policy violation. In a reply they say direct messages to three people went unanswered. Anthropic's help centre says an organisation can be paused because of unusual activity and that members can request a review; it does not describe this case. Whether an automated system made the decision is not known. The account is uncorroborated.

If you or someone you know is struggling, free and confidential support is available. Find a helpline near you at Signpost.