TechBroz · techbroz.com70 incidents on record · updated as they happen
← Today in agent chaos

Agent chaosAs reported·26 Nov 2026

If a Codex session's project folder disappears, some of its commands quietly run in your home folder instead

As reported One person’s public account. We couldn’t independently confirm it, and we’ll update this if the facts change.

A developer found that when the folder a Codex session works in is deleted, its terminal-style commands quietly run in the user's home folder instead, while Codex still shows the old folder. Another developer reproduced it. No damage is reported, but an agent that thinks it is in a project could run project commands on your home folder.

This is one person's account on GitHub, not independently confirmed by OpenAI. A second developer says they reproduced it. No damage has been reported: this is a bug that could cause some.

What they found

Coding agents often work inside folders that get cleaned up, such as a removed Git worktree or a temp folder. The developer, using Codex CLI 0.170.0 on a Mac, tested what happens when a session's folder no longer exists.

Codex can run commands two ways. In the plain way, a command in a missing folder fails with a clear error. In the interactive terminal way, the same command succeeds and runs in the user's home folder. Codex's own record still lists the deleted folder as where it ran, so neither the user nor the AI can tell anything changed.

Why it matters

The reporter's worry is that the agent believes it is still in the project and carries on, so status checks, builds, edits and deletes land on the home folder instead. They traced the fallback to a helper library that picks the home folder when the requested folder is missing, and say Codex keeps that behaviour on purpose. They say Windows falls back to the user profile in the same way.

A second developer, who maintains a safety scanner for Codex settings, reproduced it on Codex 0.169.0. In the default sandbox, creating a new file in the home folder was blocked. With full access it worked, with no prompt.

The reporter replied that the sandbox does not cover everything. Commands the user has already approved with an always-allow rule skip the sandbox, and those rules match the command text, not the folder. So a rule approved for a project, such as deleting a build folder or resetting files with Git, would apply in the home folder too. No reply from OpenAI is shown yet.

Our take

"Folder missing" should be a hard stop for an agent, never "run it somewhere else". Until this is fixed, be careful with always-allow rules for anything that deletes or resets, and do not delete a worktree while a session is still using it.

Lesson for builders

If an agent's folder vanishes, its next command should fail, not move. Keep always-allow rules away from deletes and resets.

Fail card: If a Codex session's project folder disappears, some of its commands quietly run in your home folder instead
The fail card

This story in one shareable card. Tap to open it full size.

Share on X All fail cards →

More agent chaos

Every day of agent chaos →

More fails

Get TechBroz Weekly free → All 70 fails