# codex vs opencode

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

Page: https://ai-agents-review.com/compare/codex-vs-opencode

## Programmable capabilities

| Column | codex | opencode | Marks differ |
|---|---|---|---|
| [Capability interface](https://ai-agents-review.com/column/capability-interface.md) | [4 s](https://ai-agents-review.com/cell/codex/capability-interface.md) | [4 s](https://ai-agents-review.com/cell/opencode/capability-interface.md) | no |
| [Reusable computation](https://ai-agents-review.com/column/reusable-computation.md) | [2 s](https://ai-agents-review.com/cell/codex/reusable-computation.md) | [3 s](https://ai-agents-review.com/cell/opencode/reusable-computation.md) | yes |
| [Capability transfer](https://ai-agents-review.com/column/capability-transfer.md) | [3 s](https://ai-agents-review.com/cell/codex/capability-transfer.md) | [2 s](https://ai-agents-review.com/cell/opencode/capability-transfer.md) | yes |

## Evidence and memory

| Column | codex | opencode | Marks differ |
|---|---|---|---|
| [Durable evidence](https://ai-agents-review.com/column/durable-evidence.md) | [2 s](https://ai-agents-review.com/cell/codex/durable-evidence.md) | [2 s](https://ai-agents-review.com/cell/opencode/durable-evidence.md) | no |
| [Context recovery](https://ai-agents-review.com/column/context-recovery.md) | [2→3 [opt: memories feature] s](https://ai-agents-review.com/cell/codex/context-recovery.md) | [2→3 [dev-only: sqlite_fts flag] s](https://ai-agents-review.com/cell/opencode/context-recovery.md) | no |
| [Memory maintenance](https://ai-agents-review.com/column/memory-maintenance.md) | [0→3 [opt: memories feature] s](https://ai-agents-review.com/cell/codex/memory-maintenance.md) | [0→1 [dev-only: home_memory] s](https://ai-agents-review.com/cell/opencode/memory-maintenance.md) | yes |

## Specialist collaboration

| Column | codex | opencode | Marks differ |
|---|---|---|---|
| [Specialist definition](https://ai-agents-review.com/column/specialist-definition.md) | [4 s](https://ai-agents-review.com/cell/codex/specialist-definition.md) | [3 s](https://ai-agents-review.com/cell/opencode/specialist-definition.md) | yes |
| [Continuation](https://ai-agents-review.com/column/continuation.md) | [3 s](https://ai-agents-review.com/cell/codex/continuation.md) | [4 s](https://ai-agents-review.com/cell/opencode/continuation.md) | yes |
| [Coordination](https://ai-agents-review.com/column/coordination.md) | [2 s](https://ai-agents-review.com/cell/codex/coordination.md) | [2 s](https://ai-agents-review.com/cell/opencode/coordination.md) | no |

## Execution controls

| Column | codex | opencode | Marks differ |
|---|---|---|---|
| [Confinement](https://ai-agents-review.com/column/confinement.md) | [3 s](https://ai-agents-review.com/cell/codex/confinement.md) | [1 s](https://ai-agents-review.com/cell/opencode/confinement.md) | yes |
| [Credential handling](https://ai-agents-review.com/column/credential-handling.md) | [2→3 [opt: shell_environment_policy inherit=core/none] s](https://ai-agents-review.com/cell/codex/credential-handling.md) | [1 s](https://ai-agents-review.com/cell/opencode/credential-handling.md) | yes |
| [Budget enforcement](https://ai-agents-review.com/column/budget-enforcement.md) | [1→4 [opt: rollout_budget (under development)] s](https://ai-agents-review.com/cell/codex/budget-enforcement.md) | [1→2 [opt: per-agent steps] s](https://ai-agents-review.com/cell/opencode/budget-enforcement.md) | yes |

## Product integration

| Column | codex | opencode | Marks differ |
|---|---|---|---|
| [Embedding interfaces](https://ai-agents-review.com/column/embedding-interfaces.md) | [2 s](https://ai-agents-review.com/cell/codex/embedding-interfaces.md) | [4 s](https://ai-agents-review.com/cell/opencode/embedding-interfaces.md) | yes |
| [Declarative configuration](https://ai-agents-review.com/column/declarative-configuration.md) | [3 s](https://ai-agents-review.com/cell/codex/declarative-configuration.md) | [2 s](https://ai-agents-review.com/cell/opencode/declarative-configuration.md) | yes |
| [Durable execution](https://ai-agents-review.com/column/durable-execution.md) | [2→3 [opt: app-server daemon recovery] s](https://ai-agents-review.com/cell/codex/durable-execution.md) | [4 s](https://ai-agents-review.com/cell/opencode/durable-execution.md) | yes |

## Operations and verification

| Column | codex | opencode | Marks differ |
|---|---|---|---|
| [Service dependencies](https://ai-agents-review.com/column/service-dependencies.md) | [E (+R opt: app-server daemon) s](https://ai-agents-review.com/cell/codex/service-dependencies.md) | [R (+E alt: in-process SDK) s](https://ai-agents-review.com/cell/opencode/service-dependencies.md) | yes |
| [Execution records](https://ai-agents-review.com/column/execution-records.md) | [2 s](https://ai-agents-review.com/cell/codex/execution-records.md) | [3 s](https://ai-agents-review.com/cell/opencode/execution-records.md) | yes |
| [Result checks](https://ai-agents-review.com/column/result-checks.md) | [2 s](https://ai-agents-review.com/cell/codex/result-checks.md) | [3 s](https://ai-agents-review.com/cell/opencode/result-checks.md) | yes |

## Rationales

### Capability interface

- codex: Two or more mechanisms with policy filtering; host-executed dynamicTools (experimental API counts per R8); tool_search deferral
- opencode: Plugins (npm/local/SDK) plus MCP; denied/hidden filtering; SDK plugins host-executed in-process; Code Mode defers catalog by default

### Reusable computation

- codex: Skills with scripts and rules rediscovered; no unit re-run with inputs; code-mode store/load in memory only
- opencode: Default-on automations re-run code/shell on triggers with runCount/lastOutput; args untyped JSON (level 4 unmet)

### Capability transfer

- codex: Skill MCP dependencies checked with install offer; thread/fork and fork_context give fork-vs-fresh choice; no closure-packaging operation
- opencode: Skills from dirs/paths/URLs; session fork exists; plugin/MCP executables not dependency-checked (level 3 unmet)

### Durable evidence

- codex: Full JSONL rollouts kept, revert writes new file; no explicit rollout retention policy (logs only) (level 3 unmet)
- opencode: Messages with tool parts in SQLite; revert deletes rows; no message retention policy (level 3 unmet)

### Context recovery

- codex: Rollout stored, default reachable only by file re-read; memories tools list/read/search when enabled
- opencode: Release: summary plus re-reading saved tool-output paths; session search/read only under sqlite_fts

### Memory maintenance

- codex: memories off by default; when on, phase-2 consolidation agent runs; retry/leases only [D] (level 4 unmet)
- opencode: Release: none. Dev home_memory uses plain dirs edited with file tools (L2 unmet), so its daily merge job cannot lift it past 1 (rule 3)

### Specialist definition

- codex: Roles set prompt/model and can only disable tools; approval, permission profile copied from parent turn (inherit-only); no widening path
- opencode: Config/.md agents set model, prompt, permission rules; L4 unmet: parent agent denies not intersected (plan→general edits)

### Continuation

- codex: Child rollout reloaded by resume_agent after restart; L4 unmet: v2 mailbox off by default; unresolved: mailbox durability across crash
- opencode: Durable child session resumed at boot; follow-ups to running child go through SQLite session_inbox (read in code)

### Coordination

- codex: Depth 1, 6 concurrent, close_agent cascades below a closed child; no evidence that interrupting the parent stops running children (R5, unresolved)
- opencode: Depth 1 enforced, per-job cancel; L3 unmet: no subagent concurrency cap found (Code Mode caps dev-only, codemode only)

### Confinement

- codex: Default-on bwrap/seccomp/Seatbelt for shell and apply-patch, network denied; L4 unmet: MCP stdio servers unsandboxed
- opencode: Allow/ask/deny ruleset (allow *, *.env ask); no OS sandbox in release or dev builds

### Credential handling

- codex: Default denylist *KEY*/*SECRET*/*TOKEN*; a named config key gives an allowlisted env (R1); auth.json likely readable
- opencode: Full env inherited, plaintext credential DB; only *.env read-tool ask and host per-session env replacement

### Budget enforcement

- codex: Default token_budget only steers, cost display only; rollout_budget is pre-call tree-wide admission, in-flight calls billed
- opencode: steps unset by default, cost reporting only; setting the named per-agent steps key gives a level-2 work limit (R3)

### Embedding interfaces

- codex: Full lifecycle, approvals and several transports exist, but app-server is labelled [experimental] (codex-rs/cli/src/main.rs:177), which the L2 anchor names
- opencode: In-process SDK plus HTTP API with typed events, prompt/interrupt/fork/inbox, permission replies and an ACP agent, all in release

### Declarative configuration

- codex: Unknown keys only warn by default, but a documented `--strict-config` meets level 3. Level 4 not met because strictness is not the default
- opencode: Effect Schema type decode, but `onExcessProperty: "ignore"`; a malformed document is dropped with a warning

### Durable execution

- codex: Steer and writer lock serialize input. A crash cold-resumes without closing out the turn; only the opt daemon resumes eligible turns, with no idempotency rule
- opencode: Durable inbox outlives disconnect; one execution per session; boot sweep resumes claims, documented as at-least-once

### Service dependencies

- codex: Single local process with embedded SQLite; MCP children; nothing idle. The daemon is optional
- opencode: Clients ensure a local `opencode serve --service` process that stays resident when idle

### Execution records

- codex: Rollout JSONL persists TurnAborted, but rollout policy marks Error events transient, so failures are not structured records. Level 3 unmet; mutable
- opencode: Typed step/tool/execution failure events, optional OTLP. Revert and delete remove rows, so not protected

### Result checks

- codex: Owner Stop hooks re-prompt with no stated cap. The schema is enforced provider-side only, so level 3's stated-cap/block condition is unmet
- opencode: Built-in `/goal` judge re-prompts with stated caps (50 rounds, 3 stalls) and pauses; the caps are constants, not configurable per check
