Codex macOS app runs git add on entire home directory, 100% CPU

Open 💬 2 comments Opened Apr 28, 2026 by iamtoruk
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Codex.app (macOS) spawns git add processes that attempt to index the entire home directory, including .claude/, Chrome cache files, and other unrelated data. The git process consistently hits 98-100% CPU and respawns after being killed.

Process trace:

Parent: /Applications/Codex.app/Contents/MacOS/Codex (PID 64263)
Child:  git add -- .claude/skills/ .chrome_profile_instance_1/Default/Cache/ ...
CPU:    98.7%

Expected: Codex should only track files within the active project directory.
Actual: Codex runs git add across ~/, indexing Chrome cache, Claude config, telemetry files, and other unrelated directories.

macOS, April 2026.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #19588
  • #18641

Powered by Codex Action

IgorGanapolsky · 3 months ago

This pattern is worth treating as a workspace-boundary bug, not just a CPU bug. If the active project root resolves to ~/, then any automated "stage changed files" behavior becomes dangerous because it can traverse browser profiles, agent configs, caches, and local secrets-adjacent directories.

For anyone trying to recover or collect evidence, these checks helped me isolate similar runaway local-agent behavior on macOS:

# Find the hot git process and parent
ps -axo pid,ppid,%cpu,rss,command | grep -E 'Codex|git add' | grep -v grep

# Confirm cwd/root of the git process
lsof -p <git_pid> | grep cwd

# Check whether Codex is touching home-level agent/browser folders
lsof -p <git_pid> | grep -E '\.claude|\.codex|\.openclaw|Chrome|Comet|Library/Caches' | head -50

# Check whether a repo root accidentally resolves to home
git -C ~ rev-parse --show-toplevel 2>/dev/null

Short-term mitigation I would use until fixed: never open the desktop app against $HOME; keep a dedicated workspace folder, add a repo-level .gitignore for generated/cache folders, and avoid granting broad automation/plugins access to home-level browser or agent config paths.

Longer-term, Codex should probably hard-fail or warn when a project root resolves to $HOME, and any auto-stage operation should be scoped to the selected project root with an explicit denylist for browser caches, agent auth/profile dirs, and Library/.

Disclosure: I packaged a small public sample checklist for local-agent permission/workspace boundaries after hitting similar Mac agent runaway issues. It may be useful for people debugging this class of problem: https://igorganapolsky.github.io/AI_OpenClaw_Setup_Kits/kits/openclaw-safe-agent-ops-kit/SAMPLE.md