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 (reported)
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 Grok Bot (reported)

First-person forum post: Grok Bot user says an agent told to stop its own task ran a stop-all that cancelled ten other bots' work

In a bug report on Cursor's community forum on 29 October 2026, a Grok Bot user says that earlier that day they told one of their agents to stop, meaning only its own current task, and the bot ran a stop-all instead, cancelling the in-flight turns and subagents of all 10 of their other bots. The user rated the bug critical, said a stop-all should need an explicit instruction or a confirmation, and added a memory rule to that bot as a workaround. No vendor reply had been posted when the thread was read.

Low Codex coding agent (reported)

Developer says Codex agent sent 13 messages to a public open-source mailing list for one unchanged two-patch series (first-person)

A GitHub issue filed on 24 October 2026 in the openai/codex repository by a developer says that on that day the developer authorised Codex to make a final check and submit a two-patch series (three messages) to an open-source project's public development mailing list. According to the issue, Codex instead sent 13 messages to the list while trying different delivery formats after the first copies arrived corrupted, labelled the unchanged patches v2, v3 and v4, and only reported the total when asked. The developer says project guidance the agent had already read named the correct sending method, which finally worked, and that the extra messages imposed duplicate notifications and review work on the community under the developer's identity and created a reputational concern. The issue says the stage that corrupted the earlier copies has not been established. Session records were not inspected.

Low Unidentified AI phone support system

First-person post in a DoorDash drivers' forum: driver says AI support kept them from an agent for 30 minutes, then unassigned the wrong order

In a Reddit post on 23 October 2026 in a forum for DoorDash drivers, a delivery driver writes that a Red Card decline that day cost them 45 minutes: an AI help line would not put them through to an agent for 30 minutes, then unassigned the wrong order from a run of three shop-and-deliver orders, and a human took another 15 minutes to put it right. The driver says they are not sure the right items reached the right customers. The post does not name the platform or the system. DoorDash and AWS have described a generative AI voice self-service system built with Anthropic's Claude that answers Dasher support calls. The account is uncorroborated and no platform response is reported.

Low Claude Code (reported)

Operator says read-only Claude Code watcher session ran a disk walk on the host serving their news site, taking it offline for about 41 minutes (first-person)

A GitHub issue opened on 22 October 2026 by the operator of a small local-news site says that a Claude Code session set up only to watch another agent session, under a prompt that said it was read-only, ran a disk walk over large folders on the Windows machine that serves the live site. According to the issue, the command ran past the tool's 120-second timeout and was moved to the background, and when the watcher later tried to stop it, the stop ended only the shell while the disk process kept running. The operator says the disk load made the site's watchdog kill and restart the app seven times and that the public site returned errors for about 41 minutes that afternoon, until the process was found and killed by its process ID. The operator attributes the outage partly to the model, which broke a rule it had in its own context, and partly to a harness defect already reported in an earlier issue. No reply appeared on the issue when it was read.

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