Codex Desktop on Linux consumes ~65k inotify watches and exhausts the system limit
Codex Desktop version
codex-desktop 2026.07.14.164133
The accompanying Codex app-server/CLI reports codex-cli 0.144.4.
Environment
- Debian GNU/Linux 13 (trixie), x86_64
- Kernel
6.12.95+deb13-amd64 - Workspace size: approximately 185,015 filesystem entries
- Kernel default:
fs.inotify.max_user_watches = 65536 fs.inotify.max_user_instances = 1024
What issue are you seeing?
After an extended Codex Desktop session, the main Codex Electron process owned 65,042 inotify watches across three inotify instances. This consumed nearly the entire default per-user Linux limit and prevented unrelated development tools from creating even one additional watch.
Measured process ownership:
Codex Desktop main Electron process: 65,042 watches / 3 instances
Codex app-server process: 32 watches / 3 instances
Kernel max_user_watches: 65,536
The main process had been running for about 11 hours when measured. Its command began with:
/opt/codex-desktop/electron --no-sandbox --class=codex-desktop ...
The user-visible failure appeared when starting an unrelated Tauri project:
failed to watch ~/Documents/swastalk/desktop-tauri/src-tauri/Cargo.toml:
OS file watch limit reached.
Error failed to watch ~/Documents/swastalk/desktop-tauri/src-tauri/Cargo.toml:
OS file watch limit reached.
Raising fs.inotify.max_user_watches from 65,536 to 524,288 immediately allowed npx tauri dev to start, confirming that desktop-wide inotify exhaustion was the blocker.
Steps to reproduce
- On Linux with the default
fs.inotify.max_user_watches=65536, open a moderately large workspace in Codex Desktop (this workspace has about 185k entries). - Use Codex Desktop normally for an extended session.
- Identify the main Electron PID and count watches:
pid=$(pgrep -f '/opt/codex-desktop/electron --no-sandbox --class=codex-desktop' | head -1)
for info in /proc/$pid/fdinfo/*; do
grep -c '^inotify ' "$info" 2>/dev/null || true
done | awk '{ total += $1 } END { print total }'
- Try to start another watcher-based development tool such as
npx tauri dev. - Observe
OS file watch limit reachedeven though the unrelated tool only needs to add its initial watches.
Expected behavior
- Codex Desktop should keep file watching bounded and avoid consuming nearly the entire per-user inotify allowance.
- Large generated/runtime directories and Git internals should be excluded where possible.
- Watches associated with inactive workspaces/tasks should be released.
- If a workspace would exceed a safe budget, Codex should degrade gracefully or show an actionable warning rather than causing desktop-wide
ENOSPCfailures.
Workaround
Increasing the system limit works around the problem:
fs.inotify.max_user_watches = 524288
This is only a mitigation; the Codex Desktop process still owns about 65k watches.
Related issues
- #23574 reports very similar excessive inotify allocation in the VS Code Codex extension, but the process owner here is the standalone Codex Desktop Electron process.
- #26904 is adjacent Desktop watcher behavior on WSL, but reports unbounded
gitprocess spawning rather than a measured 65k inotify allocation on native Linux.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗