Codex App ghost snapshot runs git add -A on trusted home directory and fills disk with tmp_pack files

Open 💬 3 comments Opened Apr 25, 2026 by bi-boo

Summary

Codex App appears to run an internal repository / ghost snapshot mechanism that invokes git add -A for a trusted workspace. When the trusted workspace is the macOS home directory (/Users/ravenliu), Codex attempted to index the entire home directory and repeatedly created huge Git temporary pack files under ~/.git/objects/pack/tmp_pack_*.

This filled more than 200GB of disk space and made Codex itself unable to respond. I had to switch to Claude to diagnose and recover.

Environment

  • Product: Codex App
  • App version observed in process args: 26.422.30944
  • Platform: macOS
  • Workspace / cwd: /Users/ravenliu
  • Codex config previously contained a trusted home workspace:
[projects."/Users/ravenliu"]
trust_level = "trusted"

This home workspace is intentional for my workflow: I use Codex for cross-directory local automation and file operations across Documents, Projects, agent settings, Feishu/Lark tools, and other local directories. So the issue is not simply that the home directory was trusted; the issue is that the snapshot mechanism did not guard against this workspace shape.

What happened

Codex App spawned a Git process like this:

/Library/Developer/CommandLineTools/usr/bin/git add -A

The parent process was Codex App:

/Applications/Codex.app/Contents/MacOS/Codex

Git then wrote large temporary pack files such as:

/Users/ravenliu/.git/objects/pack/tmp_pack_*

At one point there were many multi-GB tmp_pack_* files. Cleanup recovered more than 200GB. After partial cleanup, ~/.git was still tens of GB, and new tmp_pack_* files kept appearing while Codex was running.

A later direct check from Codex also caught a live process:

/Library/Developer/CommandLineTools/usr/bin/git add -A

with Codex App as its parent.

Important detail: ghost_snapshot = false was not a sufficient recovery path

During recovery, we tried adding this to ~/.codex/config.toml:

ghost_snapshot = false

However, this did not immediately stop the running Codex App from continuing to create new tmp_pack_* files. My interpretation is that the running app/server had already loaded config or already had snapshot jobs in flight. In practice, Codex was unresponsive at that stage, so I could not rely on Codex itself to fix the problem.

The effective recovery steps were:

  1. Use another assistant/tooling path because Codex was not responding.
  2. Kill the Codex-spawned git add -A process.
  3. Remove the accidental home-level ~/.git repository.
  4. Remove the trusted home project entry from ~/.codex/config.toml.
  5. Verify no git add -A process or tmp_pack_* files remained.

Why this is severe

Using Git internally for snapshot / undo / diff is understandable for normal code repositories. But applying git add -A to a trusted home directory is unsafe.

A home directory can include:

  • Documents/
  • Downloads/
  • Library/
  • app data
  • caches
  • videos and large binaries
  • private files
  • cloud sync folders

The result was unbounded disk growth, failed Git pack creation, and repeated tmp_pack_* leftovers.

Expected behavior

Codex should add guardrails around repository / ghost snapshot:

  • Detect home directories such as /Users/<name> and skip snapshots by default.
  • Detect very large workspaces and disable snapshots automatically.
  • Avoid running git add -A over user home, root directories, external volume roots, or other broad filesystem roots.
  • Exclude obvious non-project directories by default, such as Library/, Downloads/, .Trash/, caches, app data, and large media files.
  • Stop retrying after snapshot failure.
  • Clean up failed tmp_pack_* files.
  • Surface a clear warning in the UI: snapshot / undo disabled because this workspace is too large or looks like a home directory.
  • Provide a documented, reliable per-workspace config option to disable ghost snapshot / undo that takes effect predictably, or requires/recommends restart explicitly.

Actual behavior

Codex continued attempting snapshot/index operations against the home directory and repeatedly wrote large .git/objects/pack/tmp_pack_* files until manually stopped.

Workaround

The current workaround is to avoid having /Users/ravenliu as a Git repository and to remove the trusted home project entry. But this is not ideal because there are legitimate workflows where Codex needs broad read/write access across a user's home directory.

The product should support broad local workspaces while disabling Git snapshot behavior for them.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗