{"slug": "opencode-2-0-background-service-and-the-codex-daemon-what-a-resident-coding-and", "title": "OpenCode 2.0 background service and the Codex daemon: what a resident coding agent changes and how to turn it off", "summary": "OpenCode 2.0 and Codex CLI 0.157.0 both now start a resident background server by default, with OpenCode's service listening on localhost port 49374 (45278 on Windows) and Codex's daemon auto-updating hourly, according to Anomaly's 12 October 2026 announcement and OpenAI's 25 September release. A GitHub issue asking OpenAI to make the Codex daemon opt-in reached 606 points on Hacker News by 15 October, and both tools can be disabled via `opencode --standalone` or `daemon_auto_start = false`.", "body_md": "# OpenCode 2.0 background service and the Codex daemon: what a resident coding agent changes and how to turn it off\n\nThe OpenCode 2.0 background service is one per-user server that every OpenCode client connects to, and it keeps running after you close the terminal. It owns your sessions, permissions and tool execution. [OpenCode](https://stackness.dev/tools/opencode) made it the default with the 2.0 upgrade that Anomaly announced on [12 October 2026](https://anoma.ly/notes/opencode-2-0/). [Codex CLI](https://stackness.dev/tools/codex-cli) did the same in version 0.157.0 on [25 September](https://github.com/openai/codex/releases/tag/rust-v0.157.0), and the issue asking OpenAI to make it opt-in reached 606 points on Hacker News by 15 October. Both can be turned off: `opencode --standalone` or `opencode service set disabled true` for OpenCode, `daemon_auto_start = false` or `--no-daemon` for Codex.\n\n## What is the OpenCode 2.0 background service?\n\nThe OpenCode 2.0 background service is a local HTTP server that the first OpenCode client starts and every later client reuses: the terminal UI, the web UI, the desktop app and scripts. The [docs](https://opencode.ai/v2/docs/cli/) say it \"owns sessions, configuration, integrations, permissions, and tool execution\". Your terminal window becomes one client among several, and closing it disconnects that client without stopping the work.\n\nOpenCode had a client and server from the start, but only power users ran the server on purpose. In 2.0, in Anomaly's words, \"this server now automatically runs as a single background process on your machine\". The 2.0.0 package appeared on npm on 11 September. The announcement and the `opencode upgrade --major` path from 1.x came a month later, and 2.0.29 was current on 14 October.\n\nThe details, from the [web docs](https://opencode.ai/v2/docs/cli/web/) and [troubleshooting page](https://opencode.ai/v2/docs/troubleshooting/):\n\n- It listens on localhost only, on port 49374 (45278 on Windows), behind a generated password.\n- It registers itself in `~/.local/state/opencode/service.json` , and keeps its sessions in`~/.local/share/opencode/opencode.db` .\n- Its docs describe no login item and its source has no launchd or systemd code, so it starts the first time a client needs it, not at boot.\n- It does not update itself by default: the `update` setting defaults to`\"notify\"` , and an installed update waits for a manual restart ([config docs](https://opencode.ai/v2/docs/config/) ).\n\n## One Service.ensure() call, every client on the same sessions\n\nAny program can attach to the service the same way OpenCode's own apps do. `Service.ensure()` from `@opencode/client` returns the running service, starting one if needed and replacing one from another version. This example, condensed from the announcement, starts a session from a script, and the session then shows up in the terminal and web UIs:\n\n``` js\nimport { OpenCode } from \"@opencode/client\"\nimport { Service } from \"@opencode/client/service\"\nconst endpoint = await Service.ensure()\nconst client = OpenCode.make({ baseUrl: endpoint.url, headers: Service.headers(endpoint) })\nconst session = await client.session.create({ location: { directory: process.cwd() } })\nawait client.session.prompt({ sessionID: session.id, text: \"Review the current changes\" })\n```\n\n`opencode pair` prints one-time links, valid for five minutes, that sign a browser or phone in to the same server. `opencode pair --remote` exposes it to the internet through a tunnel, after a confirmation prompt.\n\n## Codex CLI's daemon also updates itself every hour\n\nCodex CLI's daemon works the same way and adds an updater. OpenAI added `daemon_auto_start` as an opt-in experiment on 17 September ([#46117](https://github.com/openai/codex/pull/46117)), turned it on by default five days later ([#47179](https://github.com/openai/codex/pull/47179)) and shipped it in 0.157.0. It is still on by default in 0.162.1, released on 9 October and the current stable version on 15 October.\n\nAn OpenAI engineer [explained the change](https://github.com/openai/codex/issues/48043#issuecomment-5916303689) on 30 September: agents now start and manage other sessions, so all terminal sessions \"remote\" to one background app server, which \"gives them all a unified view of which threads are actively running\". The daemon's [README](https://github.com/openai/codex/blob/main/codex-rs/app-server-daemon/README.md) adds what [issue #48195](https://github.com/openai/codex/issues/48195) complained about:\n\n- It runs detached, tracked by a pidfile, until you stop it or reboot. There is no launchd or systemd unit.\n- Its updater checks five minutes after start and then hourly, downloads new releases and restarts the server, so active or queued work \"may be interrupted\" after a 60-second grace period.\n- It keeps the environment of whichever session started it: \"per-client environment isolation is not provided\".\n- It copies its own binaries, about 374 MB per release on the reporter's machine, into `~/.codex/packages/app-server-daemon/` , separate from the copy your package manager installed.\n\nAs of 15 October, no OpenAI employee had replied on #48195. A fix that prunes old daemon releases was merged on 14 October and is not in a stable release yet.\n\n## A resident service buys shared sessions and background work\n\nA resident agent service lets work continue when no window is open, and lets several clients see the same sessions. In OpenCode 2.0 that means background subagents and shell commands (Ctrl+B moves running work there), the web UI and desktop app on the same session, and scheduled scripts that find the service without configuration. For Codex, OpenAI names \"background work that continues after the CLI exits\" and the `codex agents` command center, which does not run with `--no-daemon`.\n\nI found no startup benchmark from either vendor. The one number I found is from the maintainer of [a permissions wrapper for OpenCode](https://github.com/steffenmaechtel/opencode-permissions-kit/issues/129), who measured 2 to 4 seconds per service boot when running OpenCode with `--standalone`. Their conclusion: the daemon's advantages \"are almost entirely multi-client and always-on features\", and for one terminal session per start, \"almost none of them apply\".\n\n## The daemon moves tool calls outside your sandbox\n\nThe main risk of a background coding agent is that your old boundaries stop applying. If you wrap the OpenCode terminal UI in a sandbox, tool calls now run in the service, outside it. One Hacker News user [found](https://news.ycombinator.com/item?id=50095629) web fetches they meant to block \"were succeeding\" for a day or two. The fix is `--standalone` inside the sandbox. The [agent sandbox comparison](https://stackness.dev/blog/agent-sandbox-comparison-microsoft-execution-containers-vs-docker-agent-vs-agent37-and-the-defaults) covers the sandboxes themselves.\n\nThree more trade-offs, each reported by users:\n\n- **Runs nobody watches.**[Issue #52206](https://github.com/anomalyco/opencode/issues/52206) on OpenCode 2.0.18 describes sessions that keep running and spending tokens after the window closes, and permission prompts that fire with no client attached to answer them.\n- **An update channel outside your package manager.** A Homebrew Codex 0.160.0 ran a daemon from a downloaded 0.161.0 ([#51961](https://github.com/openai/codex/issues/51961) ). One Windows user reports that McAfee blocks the hourly updater's PowerShell script as fileless malware ([#53778](https://github.com/openai/codex/issues/53778) ).\n- **A listening server for longer.** OpenCode's v2 server is password-protected and local-only. Its v1 server had two 2026 CVEs, an unauthenticated server that ran shell commands for any local process or website ([CVE-2026-22812](https://github.com/anomalyco/opencode/security/advisories/GHSA-vxw4-wv6m-9hhh) ) and a web UI XSS that led to command execution (CVE-2026-22813), both fixed. Codex's daemon listens on a Unix socket, not a TCP port.\n\nMemory is a smaller cost. One user measured an idle OpenCode v2 beta service at 700 to 780 MB ([#42271](https://github.com/anomalyco/opencode/issues/42271)), on a pre-release build.\n\n## Which coding agent harnesses still run only while the command runs?\n\nMost coding agent harnesses still exit with the command. Of the ones I checked on 15 October 2026, three start a resident service at every interactive launch: OpenCode 2.x, Codex and [Cline](https://stackness.dev/tools/cline). [Claude Code](https://stackness.dev/tools/claude-code) and [Kilo Code](https://stackness.dev/tools/kilo-code) have a daemon too, but start it only for specific features or when you ask.\n\n| Harness | Process model | Source | \n|---|---|---|\n| OpenCode 2.x | Resident by default; `--standalone` per run | [CLI docs](https://opencode.ai/v2/docs/cli/) | \n| Codex CLI 0.157.0+ | Resident by default, with an hourly updater; `--no-daemon` per run | [CLI reference](https://developers.openai.com/codex/cli/reference) | \n| Claude Code | Per command; a supervisor starts when you first background a session or open agent view | [Agent view docs](https://code.claude.com/docs/en/agent-view.md) | \n| Cline CLI 3.0 | Starts its hub daemon in the background at launch, except in yolo and sandbox modes; the first session runs in-process | [CLI reference](https://github.com/cline/cline/blob/main/docs/cli/cli-reference.mdx) ,[source](https://github.com/cline/cline/blob/main/apps/cli/src/runtime/interactive/session-runtime.ts) | \n| Kilo Code CLI | Attaches to a daemon if you started one | [Runtime docs](https://github.com/Kilo-Org/kilocode/blob/main/packages/kilo-docs/pages/contributing/architecture/cli-runtime.md) | \n| [Gemini CLI](https://stackness.dev/tools/gemini-cli) ,[Aider](https://stackness.dev/tools/aider) ,[Pi](https://stackness.dev/tools/pi) ,[GitHub Copilot](https://stackness.dev/tools/github-copilot) CLI | Per command | Vendor docs and source | \n| [Cursor](https://stackness.dev/tools/cursor) CLI | Per command; long work moves to a cloud agent | [Cursor CLI docs](https://cursor.com/docs/cli/overview) | \n| [Amp](https://stackness.dev/tools/amp) ,[Goose](https://stackness.dev/tools/goose) ,[Crush](https://stackness.dev/tools/crush) | Per command; a server or runner mode is opt-in | Vendor docs and source | \n\nClaude Code stops idle background sessions after about an hour, and `disableAgentView` or `CLAUDE_CODE_DISABLE_AGENT_VIEW` keeps the supervisor from starting at all. The [harness explainer](https://stackness.dev/blog/what-is-a-coding-agent-harness-and-which-parts-of-it-actually-change-the-output) covers what else differs between these [AI coding tools](https://stackness.dev/categories/ai-tools).\n\n## Who needs the daemon and who can skip it\n\nThe daemon pays off if you run agents from more than one place: a long task started in the terminal and checked from a phone, scheduled scripts that drive the agent, or several sessions you want in one list. It costs you if you run one session at a time, in a sandbox, on a machine where your company controls what updates and when.\n\nOn Stackness, as of 15 October 2026, 8 public profiles list Claude Code, 2 list OpenCode and 2 list OpenAI Codex, after removing bot accounts ([data sources](https://stackness.dev/about/data-sources)). The sample is too small to say how many of them now run a resident service.\n\n## Where to start with a background coding agent\n\nCheck what is running, then decide per tool:\n\n```\nopencode service status                   # OpenCode\nps aux | grep -i \"codex app-server\"       # Codex\nclaude daemon status                      # Claude Code\n```\n\nTo turn OpenCode's service off, run `opencode service set disabled true`, which also stops it (` opencode service unset disabled` reverses it), or pass `--standalone` for a single run. Always use `--standalone` inside a sandbox.\n\nTo turn Codex's daemon off, the reporter of #48195 used these four steps. `daemon stop` leaves the updater loop running, which is why the third line is there:\n\n```\ncodex features disable daemon_auto_start\ncodex app-server daemon stop\npkill -f 'app-server daemon pid-update-loop'\nrm -rf ~/.codex/packages/app-server-daemon\n```\n\nThe first line writes `daemon_auto_start = false` under `[features]` in `~/.codex/config.toml`. The setting does not detach a session from a daemon that is already running ([#48778](https://github.com/openai/codex/issues/48778)), so stop the daemon too. To keep the daemon and stop only the self-updates, set `\"updater\": { \"autoUpdateEnabled\": false }` in `~/.codex/app-server-daemon/settings.json`.\n\n## Coding agent daemons in brief\n\n- **Login items:** neither OpenCode nor Codex installs a launchd or systemd unit; both start again the next time a client needs them.\n- **Admin policy:** Codex documents pinning feature flags in`requirements.toml` , but its docs do not name`daemon_auto_start` . OpenCode's switch is per user.\n- **Environment:** both services keep the environment of the shell that started them, so an`export` in a new terminal does not reach a running service.\n\n## Which of these do you use?\n\nNobody on Stackness runs Cline yet. Tick what you use and be the first.\n\n[Play Lonny Eagle Amateur Skater 4A pixel art skateboarding game. Signing up opens it straight away.Sign up to play](https://stackness.dev/games/lonny-eagle)", "url": "https://wpnews.pro/news/opencode-2-0-background-service-and-the-codex-daemon-what-a-resident-coding-and", "canonical_source": "https://stackness.dev/blog/opencode-2-0-background-service-daemon-and-codex-daemon-auto-start", "published_at": "2026-10-15 08:26:19+00:00", "updated_at": "2026-10-15 09:22:18.977291+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["OpenCode", "Anomaly", "Codex CLI", "OpenAI", "Hacker News", "npm", "GitHub"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/opencode-2-0-background-service-and-the-codex-daemon-what-a-resident-coding-and", "markdown": "https://wpnews.pro/news/opencode-2-0-background-service-and-the-codex-daemon-what-a-resident-coding-and.md", "text": "https://wpnews.pro/news/opencode-2-0-background-service-and-the-codex-daemon-what-a-resident-coding-and.txt", "jsonld": "https://wpnews.pro/news/opencode-2-0-background-service-and-the-codex-daemon-what-a-resident-coding-and.jsonld"}}