OpenCode 2.0 background service and the Codex daemon: what a resident coding agent changes and how to turn it off 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`. OpenCode 2.0 background service and the Codex daemon: what a resident coding agent changes and how to turn it off The 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. What is the OpenCode 2.0 background service? The 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. OpenCode 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. The details, from the web docs https://opencode.ai/v2/docs/cli/web/ and troubleshooting page https://opencode.ai/v2/docs/troubleshooting/ : - It listens on localhost only, on port 49374 45278 on Windows , behind a generated password. - It registers itself in ~/.local/state/opencode/service.json , and keeps its sessions in ~/.local/share/opencode/opencode.db . - 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. - 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/ . One Service.ensure call, every client on the same sessions Any 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: js import { OpenCode } from "@opencode/client" import { Service } from "@opencode/client/service" const endpoint = await Service.ensure const client = OpenCode.make { baseUrl: endpoint.url, headers: Service.headers endpoint } const session = await client.session.create { location: { directory: process.cwd } } await client.session.prompt { sessionID: session.id, text: "Review the current changes" } 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. Codex CLI's daemon also updates itself every hour Codex 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. An 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: - It runs detached, tracked by a pidfile, until you stop it or reboot. There is no launchd or systemd unit. - 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. - It keeps the environment of whichever session started it: "per-client environment isolation is not provided". - 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. As 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. A resident service buys shared sessions and background work A 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 . I 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". The daemon moves tool calls outside your sandbox The 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. Three more trade-offs, each reported by users: - 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. - 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 . - 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. Memory 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. Which coding agent harnesses still run only while the command runs? Most 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. | Harness | Process model | Source | |---|---|---| | OpenCode 2.x | Resident by default; --standalone per run | CLI docs https://opencode.ai/v2/docs/cli/ | | 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 | | 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 | | 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 | | 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 | | 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 | | 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 | | 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 | Claude 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 . Who needs the daemon and who can skip it The 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. On 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. Where to start with a background coding agent Check what is running, then decide per tool: opencode service status OpenCode ps aux | grep -i "codex app-server" Codex claude daemon status Claude Code To 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. To 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: codex features disable daemon auto start codex app-server daemon stop pkill -f 'app-server daemon pid-update-loop' rm -rf ~/.codex/packages/app-server-daemon The 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 . Coding agent daemons in brief - Login items: neither OpenCode nor Codex installs a launchd or systemd unit; both start again the next time a client needs them. - 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. - 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. Which of these do you use? Nobody on Stackness runs Cline yet. Tick what you use and be the first. 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