# Is Codex CLI still running after you close it? A 5-minute check

URL: https://systemdesignsimple.com/codex-cli-background-server-check/
Published: 2026-11-08
Category: AI Tools
Publisher: System Design Simple (https://systemdesignsimple.com)

## Short answer

Since Codex CLI 0.157.0 (September 25, 2026), eligible interactive sessions start a shared background server automatically. The feature flag daemon_auto_start controls it and is on by default. You can check it with codex features list and turn it off with codex features disable daemon_auto_start.

## Key facts

- **Automatic background server since:** Codex CLI 0.157.0, September 25, 2026
- **Feature flag:** daemon_auto_start, on by default
- **Turn it off:** codex features disable daemon_auto_start
- **Its files on our Mac:** 338 MB for version 0.164.0, measured November 7, 2026
- **One-view option:** codex agents --no-daemon (0.167.0)

Yes, Codex CLI can keep a process running after you close the terminal. Since version 0.157.0, an eligible interactive session starts a shared background server automatically, and one command turns that off: `codex features disable daemon_auto_start`.

This article is for anyone who uses Codex CLI in the terminal most days, especially on a shared build machine or a laptop where background processes and disk space matter. The everyday problem is simple: you close the terminal and assume everything stopped. Since September 25, 2026, the CLI can leave a server running and its package on your disk (338 MB on our Mac) without asking. These three checks show you what your machine is doing, and one command lets you choose the behaviour you want.

Nothing here is broken. Starting the server is the intended behaviour; the only question is whether you want it on your machine. A background server lets several sessions share one connection and recover faster. Still, it starts without asking you. We spent five minutes on our Mac checking what it does, how much disk it takes and how to switch it off. The steps are below.

## What changed in Codex CLI 0.157.0

The 0.157.0 release notes, published on September 25, 2026, list it plainly: "Enabled automatic background-server startup for eligible interactive sessions, with recovery choices when server settings are incompatible." The pull request behind it is titled "Enable automatic daemon startup by default".

Before 0.157.0 the CLI stopped when you closed the terminal. From 0.157.0, an interactive session can start a small server in the background, and later sessions talk to that server.

Non-interactive runs such as `codex exec` are a different path. Our automation calls `codex exec` many times a day, and on this Mac we found no background server running between those calls.

[Image: The Codex CLI 0.157.0 release note that turned on automatic background-server startup (GitHub, captured 2026-11-07). | The Codex CLI 0.157.0 release note that turned on automatic background-server startup (GitHub, captured 2026-11-07).]

## Check 1: is the feature on?

```sh
codex features list | grep daemon_auto_start
```

On our Mac, on November 7, 2026, with Codex CLI 0.164.0, this printed:

```text
daemon_auto_start                        stable             true
```

`stable` is the feature's stage, `true` is its effective state. So the automatic start is on, which is the default.

## Check 2: how much disk does it use?

The server ships as its own package inside your Codex folder:

```sh
du -sh ~/.codex/packages/app-server-daemon/releases
```

Our result: **338 MB**, one folder named `0.164.0-aarch64-apple-darwin`. On our Mac there was one folder, for 0.164.0. Your number depends on your version and on how many old versions have piled up in that folder.

## Check 3: is it running right now?

```sh
pgrep -fl codex
```

If this prints nothing, no Codex process is running. If you see a server process after you closed every terminal, the background server is still alive. You can close it from your process manager, or turn the feature off below and open a fresh terminal.

## How do I turn off the Codex CLI background server?

```sh
codex features disable daemon_auto_start
codex features list | grep daemon_auto_start
```

`codex features disable` writes the change to `~/.codex/config.toml`, so it applies to every new session. To undo it later, run `codex features enable daemon_auto_start`.

If you only want to skip the server for one view, Codex CLI 0.167.0 (November 6, 2026) adds `codex agents --no-daemon`, which opens the agent command center with an embedded server instead. That does not change the default for normal sessions.

## Why it works this way (the system design view)

This is the shared service pattern you already know from other tools: instead of every terminal opening its own connections and state, one long lived process holds them and short lived clients attach to it.

| | One process per terminal | Shared background server |
|---|---|---|
| Start time for the next session | Full start every time | Faster, the server is already up |
| State across sessions | Lost when the window closes | Kept by the server |
| What runs when you are not using it | Nothing | The server |
| Disk | The CLI only | The CLI plus the server package (338 MB here) |

Neither choice is wrong; it depends on the machine. A laptop on battery and a shared build machine usually want the left column. If you open many sessions a day, you will probably prefer the right one.

It is the same one door thinking as in our explainer on [which server gets your request](/which-server-gets-your-request/): many clients, one place that holds the state.

We use the same one process stays up idea in our [server failover](/main-server-dies-at-3am/) piece, where something is always running so the client never waits for a cold start.

## Our take

Most write ups of this change just repeat the release note. What they skip is the team question: a default like this should be a decision you write down once. A shared build machine, a laptop and a CI runner want different answers, and "it was on by default" is not a reason for any of them.

## Honest verdict

Good: the background server is documented, the flag has a clear name, and one command switches it off or on. The new `--no-daemon` option shows the team is giving people more control.

Worth knowing: the automatic start is on by default, the server package takes real disk space (338 MB on our Mac), and the setting lives in `~/.codex/config.toml`, where a new teammate will not look first.

## What it means for you

- **Solo developer, one or two sessions a day**: run the three checks once. Keep the default if faster starts matter to you; turn it off if you prefer nothing running in the background.
- **Shared or CI machines**: decide the default for the machine, set it with `codex features disable daemon_auto_start` (or `enable`) in your setup script, and document it.
- **Low on disk**: look at `~/.codex/packages/app-server-daemon/releases` after upgrades; old version folders add up.

If you run both agents, see [how we use Claude Code and Codex CLI together](/claude-code-vs-codex-cli/) before you settle the defaults for each.

## Frequently asked questions

**Does Codex CLI keep running after I close the terminal?**
It can. Since 0.157.0, eligible interactive sessions start a shared background server that can outlive the terminal window. The daemon_auto_start feature flag controls this and is on by default.

**How do I turn off the Codex background server?**
Run codex features disable daemon_auto_start. It writes the setting to ~/.codex/config.toml, so new sessions stop starting the server automatically. Check the result with codex features list.

**Is the background server a security problem?**
Not by itself. It is a documented feature. The point of this check is control: know which processes run on your machine, how much disk they use, and choose the default that fits your team.

**Does turning off daemon_auto_start delete the 338 MB server package?**
No. The command only writes the setting to ~/.codex/config.toml, so new sessions stop starting the server. The package files stay in ~/.codex/packages/app-server-daemon/releases, which is why the disk check in this article is worth running after upgrades.

## Sources

- [Codex CLI 0.157.0 release notes (automatic background server)](https://github.com/openai/codex/releases/tag/rust-v0.157.0)
- [Codex CLI 0.167.0 release notes (codex agents --no-daemon)](https://github.com/openai/codex/releases/tag/rust-v0.167.0)
- [@openai/codex on npm](https://www.npmjs.com/package/@openai/codex)
