# letta-code 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/letta-code-vs-opencode

## Programmable capabilities

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

## Evidence and memory

| Column | letta-code | opencode | Marks differ |
|---|---|---|---|
| [Durable evidence](https://ai-agents-review.com/column/durable-evidence.md) | [2 d](https://ai-agents-review.com/cell/letta-code/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: experimental local backend] d](https://ai-agents-review.com/cell/letta-code/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) | [4 s](https://ai-agents-review.com/cell/letta-code/memory-maintenance.md) | [0→1 [dev-only: home_memory] s](https://ai-agents-review.com/cell/opencode/memory-maintenance.md) | yes |

## Specialist collaboration

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

## Execution controls

| Column | letta-code | opencode | Marks differ |
|---|---|---|---|
| [Confinement](https://ai-agents-review.com/column/confinement.md) | [2 s](https://ai-agents-review.com/cell/letta-code/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) | [1 s](https://ai-agents-review.com/cell/letta-code/credential-handling.md) | [1 s](https://ai-agents-review.com/cell/opencode/credential-handling.md) | no |
| [Budget enforcement](https://ai-agents-review.com/column/budget-enforcement.md) | [2 s](https://ai-agents-review.com/cell/letta-code/budget-enforcement.md) | [1→2 [opt: per-agent steps] s](https://ai-agents-review.com/cell/opencode/budget-enforcement.md) | yes |

## Product integration

| Column | letta-code | opencode | Marks differ |
|---|---|---|---|
| [Embedding interfaces](https://ai-agents-review.com/column/embedding-interfaces.md) | [4 s](https://ai-agents-review.com/cell/letta-code/embedding-interfaces.md) | [4 s](https://ai-agents-review.com/cell/opencode/embedding-interfaces.md) | no |
| [Declarative configuration](https://ai-agents-review.com/column/declarative-configuration.md) | [1 s](https://ai-agents-review.com/cell/letta-code/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 d](https://ai-agents-review.com/cell/letta-code/durable-execution.md) | [4 s](https://ai-agents-review.com/cell/opencode/durable-execution.md) | yes |

## Operations and verification

| Column | letta-code | opencode | Marks differ |
|---|---|---|---|
| [Service dependencies](https://ai-agents-review.com/column/service-dependencies.md) | [X (+E alt: local backend) s](https://ai-agents-review.com/cell/letta-code/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) | [1 d](https://ai-agents-review.com/cell/letta-code/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/letta-code/result-checks.md) | [3 s](https://ai-agents-review.com/cell/opencode/result-checks.md) | yes |

## Rationales

### Capability interface

- letta-code: Mods and host-injected external tools; per-subagent tool lists; MCP not native; no deferral/search (level 4 unmet)
- opencode: Plugins (npm/local/SDK) plus MCP; denied/hidden filtering; SDK plugins host-executed in-process; Code Mode defers catalog by default

### Reusable computation

- letta-code: Workflow script, args and journal saved, re-run by scriptPath; crons hold prompts, no scheduled workflow or typed params
- opencode: Default-on automations re-run code/shell on triggers with runCount/lastOutput; args untyped JSON (level 4 unmet)

### Capability transfer

- letta-code: Skill install and MemFS restore are [D]; fork type carries conversation; no dependency checking (level 3 unmet)
- opencode: Skills from dirs/paths/URLs; session fork exists; plugin/MCP executables not dependency-checked (level 3 unmet)

### Durable evidence

- letta-code: Cloud messages server-side [D] plus client transcript copy; no retention policy; local file rewritten on fork
- opencode: Messages with tool parts in SQLite; revert deletes rows; no message retention policy (level 3 unmet)

### Context recovery

- letta-code: Cloud compaction/search [D] caps D; local mode keeps rows with default BM25 search and recall subagent
- opencode: Release: summary plus re-reading saved tool-output paths; session search/read only under sqlite_fts

### Memory maintenance

- letta-code: MemFS auto-enabled on Cloud (index.ts:1808); reflection every 25 steps; rebase-retry/backoff; git versioning (not Windows/detached headless)
- 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

- letta-code: Markdown frontmatter sets tools, model, prompt; L4 unmet: child forced --permission-mode unrestricted, widening when parent interactive
- opencode: Config/.md agents set model, prompt, permission rules; L4 unmet: parent agent denies not intersected (plan→general edits)

### Continuation

- letta-code: Follow-ups via agent_id reuse child conversation; live state in memory; unresolved: resume of ephemeral API children after restart
- opencode: Durable child session resumed at boot; follow-ups to running child go through SQLite session_inbox (read in code)

### Coordination

- letta-code: Depth 2, 32 concurrent tasks, process-group cancel; L4 unmet: no tree-wide budget for Task children (messaging server-side [D])
- opencode: Depth 1 enforced, per-job cancel; L3 unmet: no subagent concurrency cap found (Code Mode caps dev-only, codemode only)

### Confinement

- letta-code: OS sandbox default-on only for memory subagents; main shell unconfined under unrestricted mode; network never isolated
- opencode: Allow/ask/deny ruleset (allow *, *.env ask); no OS sandbox in release or dev builds

### Credential handling

- letta-code: Full env inherited plus injected LETTA_API_KEY; only exact-match redaction and Bun keychain; L2 unmet: no denylist
- opencode: Full env inherited, plaintext credential DB; only *.env read-tool ask and host per-session env replacement

### Budget enforcement

- letta-code: Workflow maxCostUsd is a per-call parameter of a default tool (R1); post-step, per run; main agent reporting only
- opencode: steps unset by default, cost reporting only; setting the named per-agent steps key gives a level-2 work limit (R3)

### Embedding interfaces

- letta-code: Headless stream-json plus a WebSocket app server with typed protocol, abort, `can_use_tool` control requests and an external-tool-call handler
- 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

- letta-code: JSON spread over defaults; no schema; unknown keys pass through
- opencode: Effect Schema type decode, but `onExcessProperty: "ignore"`; a malformed document is dropped with a warning

### Durable execution

- letta-code: Cloud background runs and busy handling are server-side [D], so the evidence cap is 2. Local mode loses runs on a crash
- opencode: Durable inbox outlives disconnect; one execution per session; boot sweep resumes claims, documented as at-least-once

### Service dependencies

- letta-code: Default API mode needs a reachable Letta server every turn; the local backend uses provider endpoints only
- opencode: Clients ensure a local `opencode serve --service` process that stays resident when idle

### Execution records

- letta-code: Local transcript/debug files; background failures often only in the debug log; tool-error recording unresolved; server records [D]
- opencode: Typed step/tool/execution failure events, optional OTLP. Revert and delete remove rows, so not protected

### Result checks

- letta-code: Hooks: exit 2 blocks, but errors and timeouts fail open; Stop-hook re-prompts have no stated cap
- opencode: Built-in `/goal` judge re-prompts with stated caps (50 rounds, 3 stalls) and pauses; the caps are constants, not configurable per check
