Source: CLI: make daemon_auto_start opt-in — a persistent, self-updating background daemon shouldn't be the default, by Yihua-Liu-1997
Since Codex CLI 0.157.0, opening an interactive session starts a background server that keeps running after you close every window. It runs from its own copy of the package and updates itself. Here is what it does and how to turn it off.
The issue report walks through four things that happen when you type codex, in this order.
It runs in its own session with no TTY. When the last window closes, it is reparented to PID 1 and keeps running until codex app-server daemon stop or a reboot.
About 374 MB, byte-identical to what npm just installed. The daemon runs from this copy, so its version no longer follows the CLI you installed.
It checks for updates 5 minutes after start, then hourly. It downloads new releases and restarts the backend, which can kill active turns.
The daemon keeps the environment of whichever session started it. Later sessions with a different proxy still go out through the first one.
Close the window: the daemon and its updater stay.
codex app-server daemon stop alone is not enough: it stops the server but leaves the updater running, still alive 70 seconds later in the report. The reporter's full workaround:
| Step | Command |
|---|---|
| Stop auto-start | codex features disable daemon_auto_start |
| Stop the server | codex app-server daemon stop |
| Kill the updater | pkill -f 'app-server daemon pid-update-loop' |
| Delete the copy | rm -rf ~/.codex/packages/app-server-daemon |
With the flag off, a new session no longer spawns a daemon. A commenter on Windows 10 confirms the same fix through daemon_auto_start = false in config.toml.
The report: issue #48195 in the openai/codex repository, “make daemon_auto_start opt-in”.
The Short on this topic walks through the same four steps.
Sources: every number comes from the issue body (CLI 0.157.0 via npm, ~374 MB copy, 5 min then hourly checks, updater alive 70 s after stop); the config.toml line from a commenter on the same issue.