codex - 💡(How to fix) Fix Codex App ghost snapshot runs git add -A on trusted home directory and fills disk with tmp_pack files [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19588Fetched 2026-04-26 05:14:19
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×4commented ×1

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.

Root Cause

  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.

Fix Action

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.

Code Example

[projects."/Users/ravenliu"]
trust_level = "trusted"

---

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

---

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

---

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

---

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

---

ghost_snapshot = false
RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

To prevent Codex from filling disk space with large Git temporary pack files, avoid setting the home directory as a trusted workspace or disable the ghost snapshot mechanism for such workspaces.

Guidance

  • Remove the trusted home project entry from ~/.codex/config.toml to prevent Codex from attempting to index the entire home directory.
  • Consider setting ghost_snapshot = false in ~/.codex/config.toml, but be aware that this may not take effect immediately for a running Codex App instance.
  • Manually kill any running git add -A processes spawned by Codex and remove any existing tmp_pack_* files to recover disk space.
  • Be cautious when setting up trusted workspaces, especially for broad filesystem roots like the home directory, to avoid unintended disk usage.

Example

No specific code snippet is applicable here, but ensuring that ~/.codex/config.toml does not contain entries that could lead to indexing large directories is crucial.

Notes

The current workaround may not be ideal for all workflows, especially those requiring broad access across the user's home directory. A more robust solution would involve Codex implementing guardrails around its repository and ghost snapshot mechanisms to detect and handle large workspaces or home directories appropriately.

Recommendation

Apply the workaround by removing the trusted home project entry and consider setting ghost_snapshot = false, as this provides an immediate, albeit temporary, solution to prevent further disk space issues. This recommendation is chosen because it directly addresses the problem described, even though it may not be a perfect solution for all use cases.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex App ghost snapshot runs git add -A on trusted home directory and fills disk with tmp_pack files [1 comments, 2 participants]