Skip to content

Coding reference

Look things up here. To get a first change working, read Coding in Marina first.

A coding session in Marina lives inside a persistent world. Start with one coder and one task; add other participants when the work calls for them. People and agents can exchange messages, inspect recorded checks, review submitted work, and share what they learn while independent world activity continues. Verification and approval describe specific candidates, not a promise that every edit has already been checked or can automatically be reversed.

The default runtime is Marina’s coding agent, using your configured provider (~/.marina/.env, or per folder). You can also use an installed coding tool and its existing credentials through the same terminal:

Terminal window
marina --agent claude
marina --agent codex
marina --agent pi
marina --agent marina --model openrouter/<model-id> --profile claude

Runtime and command dialect are independent: --agent claude runs Claude Code’s native tools; --agent marina --profile claude uses Marina’s tools with its Claude-style command aliases. --model selects a model understood by the chosen runtime. --thinking <level> (off, minimal, low, medium, high, xhigh) sets reasoning depth for every runtime: Marina’s coder reads it directly, Claude Code gets the matching effort (off turns thinking off, minimal reads as low), Codex gets model_reasoning_effort (off is its none) and pi gets --thinking. Omitted, each native agent keeps its own default; a saved harness remembers the level with the agent and model, so the same model at the same depth can be compared across runtimes. Native agents keep their own configuration and permission systems; Marina’s --allow-exec flags apply only to Marina’s own Code Mode commands. There is no automatic provider failover.

Other launch flags, each described where it belongs:

Zero-config, in any folder — boots a folder-scoped Marina and drops you straight into agentic Code Mode (needs an LLM provider key in your env). In the current directory:

Terminal window
bun run code

…or in any directory:

Terminal window
bun run code ~/projects/acme

It evaluates the directory, then you say what you want, in plain English:

❯ fix the off-by-one in the tokenizer and add a regression test

Sessions persist per folder. Each directory gets its own Marina database at ~/.marina/projects/<slug>/marina.db (slug = folder basename + a short hash of the absolute path), so sessions, artifacts, and agent memory accrete across launches — relaunching in the same folder shows Resuming on the welcome card (the session’s title, when it started and, if different, its workspace) and picks up where the last run left off. Pass --fresh (or set MARINA_CODE_FRESH=1) for a throwaway database, deleted on exit. Only the ephemeral DB is ever deleted; the per-folder one is yours to keep or remove.

These go with the first-run walkthrough, in the order of its steps.

The folder-scoped launcher reads provider keys from the shell that starts it, then from ~/.marina/.env (marina init writes one). Choose one provider; do not paste a real key into a command you intend to save or share.

For another provider or a local model, also export an explicit routable model such as MARINA_DEFAULT_MODEL=provider/model-id; see Configuration. A key previously saved in a different Marina database is not copied into this disposable folder-scoped session.

Marina starts a folder-scoped local world, binds one coding agent to the demo directory, and streams its progress. The expected lifecycle is received → inspect → plan → patch → apply → verify → complete. The agent may phrase its messages differently, but a completion must identify changed paths and successful checks. It must not claim success from a proposed patch alone.

While the coder works you see one line per step in plain words (Read paginate.js, Run bun test), and every edit shows the change itself, removed lines red and added green. The input rule shows that it is working, for how long, and its latest step. When checks run they report in one line (✓ checks passed on a snapshot of the change). When it finishes, after its own explanation, one block says how it ended (shown in the walkthrough).

The time and cost are this task’s own; the checks ran on a frozen snapshot of the change, not on files still being edited. A blocked or stopped run says why in the same place.

Because this launcher is already in Code Mode, omit the code prefix. A plain sentence is steering or a new task; status, diff, and show are commands. Ctrl+C interrupts the worker; a second Ctrl+C, /quit or Ctrl+D exits. The session’s database persists per folder (see above), so relaunching resumes where you left off; edits in the demo folder remain available to inspect. Pass --fresh for a throwaway database instead.

  • “No model provider is configured”: the server found no provider key. Put one in ~/.marina/.env (or run marina init), or export it in the same shell, then relaunch. Your project’s own .env is never read; see where the CLI reads settings. A native agent (/use claude, /use codex, /use pi) needs no Marina key.
  • Server timeout: run bun install in the Marina repository, confirm Bun is at least 1.4.4, and retry.
  • “Marina is already open in this folder”: another terminal has this folder’s session open (the message names its process). Close it, or use --fresh for a separate disposable session. A leftover record from a crashed session is detected and cleared automatically.
  • Stale project database: a per-folder DB written by an older Marina version can block boot. The failure hint prints the exact path (~/.marina/projects/<slug>/marina.db) — remove it, or relaunch with --fresh to use a throwaway DB.
  • Agent cannot run checks: use the folder-scoped launcher above; it boots coder as the local operator. In a shared Marina, code.exec remains safety-gated.
  • Wrong files appear: exit immediately and relaunch with the explicit absolute demo path. The first screen names the folder (--verbose prints its full path); /status shows the workspace Marina is confined to. Verify it before sending the task.

Once this works, replace the demo path with a clean branch or disposable worktree of your own project. Keep the task bounded and name the checks that define completion.

/harness save daily
/harness list
/harness export

Saving makes this runtime/model/dialect selection the default for subsequent bare marina launches in the same folder. Preferences live beside the folder’s database in ~/.marina/projects/<slug>/harnesses.json. Explicit --agent overrides the saved default. Export prints a portable, versioned JSON definition, for example:

{"version":1,"agent":"marina","model":"openrouter/<model-id>","profile":"claude"}

Save that JSON to a file and use marina --harness ./daily.json, or select a personal definition with marina --harness daily. /harness use <name-or-path> selects one inside the terminal. Harness definitions in a repository are never loaded implicitly. These definitions select a runtime, model and dialect; they do not yet package teams, Scores, roles, credentials or approval policies. Changing a bound Marina worker’s model takes effect between tasks; stop or finish active work first.

Native runtimes also support marina --agent codex -p "<task>". A finished turn exits 0 with the files it changed, as the runtime’s own one-shot would; Marina does not verify it unless asked (--verify, see One-shot mode below). Neither means Marina approved the work. Missing terminal input denies native permission requests. Marina-native tasks retain the canonical task/submission/review workflow described below.

For the fullscreen workspace, run marina --tui (or add --tui to marina attach or a connected --url … --name … --session … invocation). It keeps the project location, active conversation, task status and unread counts visible around the transcript and composer. Coding remains a single session; World messages and independent agents continue alongside it. Omit --tui to use the scrollback terminal described below. The terminal workspace guide has the full layout, keys and slash commands in one place.

The workspace opens in coding mode: the coding conversation alone, with messages addressed to you on one line above the composer (see modes). /layout split puts Coding and World side by side from 80 columns. F6 changes which conversation receives your input; the marked pane header and composer label identify the destination. F7 opens Requests in the left pane while World stays visible; F8 does the same for your panel. Incoming requests never take over your draft. Each pane retains its scroll position, and each conversation retains its draft when focus or terminal size changes.

Use F2 to cycle layouts, or /layout auto, /layout focus, and /layout split to choose directly. Explicit split needs at least 80 columns and enough height for readable panes; smaller windows fall back to the focused view. Resizing back restores the selected arrangement. Unread counts track activity outside your focused conversation even when its pane is visible. These controls only arrange views; they do not spawn workers or change coding sessions.

In the workspace, type / for command suggestions with descriptions. Up/Down selects; Tab or Enter inserts the selection into your draft, and a separate Enter sends it. Argument hints follow the selected command. Paste inserts a multiline draft without sending; Shift+Enter (where supported) or a trailing \ adds another line. F1 opens help, F6 switches Coding/World, F7 opens pending requests, and F8 opens the published panel view. PageUp/PageDown scroll the focused pane; Alt+Up/Down or /view older and /view newer fetch another retained local page. /view latest jumps back to recent output and follows new updates in the focused conversation. Ctrl+D exits an empty composer. Each conversation retains its editor, cursor and history; cancelled requests discard their partial answers. The workspace restores the shell on exit without copying unsent drafts into scrollback. It requires interactive input and output; one-shot -p and redirected output keep their existing stream behavior. printf "…" | marina -p reads the one-shot task from stdin for shell composition. NO_COLOR=1 disables accents. A terminal that supports the Program Status Protocol shows whether a session is working, waiting on you or done (Status for your terminal).

The first page is a welcome card sized to the terminal: the Marina version, the agent and its model, the folder, tips, and whether the session is new or resumed. The input area sits below it: a rule naming the folder and status, the ❯ prompt, a rule, and a footer, the same layout as marina connect. One-shot -p, redirected output and --tui keep the plain lines. With no model connected, the card opens with Connect a model first and the rule reads no model (connect one). The folder session runs the whole Marina server, so the card’s Dashboard section links to it (http://localhost:<port>, a port chosen per launch): the same world, sessions and agents in a browser. /dashboard opens it signed in. --verbose adds the database, the server endpoints and the federation address; /status and /project show the rest whenever you want them.

Inside the terminal, /help shows one screen of essentials and /help all lists every control; Tab completes their names and the /verify and /review actions; when several match, the footer lists them. /quit, /exit and Ctrl+D leave. Streaming output preserves the current draft and cursor, including wrapped lines and terminal resizing. The rule above the ❯ prompt names the folder and what the agent is doing (myapp · working); what is waiting appears only when something is (1 request · World 3), on the rule and at the right of the footer. In a world or answer view the rule names that destination instead (world command, answer). Transcript labels distinguish world messages, check receipts, results, submitted work and review. Permission details appear above a short answer prompt. End a line with \ to continue a task on another line.

In an interactive terminal, Coding is the initial view. F6 switches between Coding and World, preserving each view’s draft, cursor, multiline input and command history. The input rule counts unread output in the other conversation (World 3, Coding 2). Use /view coding or /view world when function keys are unavailable. World input uses normal Marina commands; /world <command> also works from either conversation. Incoming world events and coding output continue to arrive while you focus elsewhere.

F7 or /view approvals opens pending permission questions deliberately; a new question does not replace your draft or turn a world message into an answer. /view older and /view newer browse bounded local transcript pages. Eviction and excerpt notices identify missing history; these pages are not a durable server transcript. Redirected output remains one continuous plain-text stream.

For a local Git project with a Marina worker, /task <request> requires current candidate verification before the worker can submit its result. Start with a small change, for example /task Fix the pagination boundary and add a regression test. Early summaries remain progress; blockers are reported explicitly. Ordinary freeform requests retain their existing behavior.

Interactive Marina sessions inspect the project at startup. /project repeats this inspection: workspace and execution location, selected model, root instruction sources, Git state, and the effective verification recipe (including a saved default recipe). It does not call the model, run the recipe, install dependencies, or recruit a worker. A whitespace-only recipe is flagged; configure meaningful checks with, for example, /world code recipe save default typecheck then test. The report is an observation, not proof that a provider is reachable or permission to execute. Connected mode inspects the server workspace; a sandbox report identifies host-only observations.

For the selected Marina session, /status shows the task, /diff shows working changes, /verify starts candidate checks, and /review inspects the latest attempt and its evidence. /checks lists recorded verification results; /status shows checks still in progress. /history lists recent task attempts, and /show <artifact-id> opens a recorded artifact. These are bounded server listings; local transcript pages are available through /view older.

The session’s day-to-day controls are one word away:

/model <id> switch Marina's model for this session
/fast cheapest reachable model across vendors
/plan <request> research and propose, write nothing
/compact compact the conversation now
/cost (or /usage) today's model spend against the daily cap
/continue resume the most recent session in this folder
/memory [save <line> | recall <query>] remember and recall the folder

/model switches the active session model (list every model you hold a provider key for with no argument); /fast picks the cheapest reachable one. /plan runs the worker read-only — it researches and emits a proposal without editing files. /compact compacts older conversation messages even below the automatic threshold, retaining the initial request and recent turns. It waits for durable archival before replacing history; if the agent is working or the conversation changes during compaction, it keeps the live history and asks you to retry. Short histories stay unchanged. Summary calls count toward agent usage and spend limits; a provider failure or reached cap uses the deterministic summary. /cost and /usage report today’s model spend against the daily cap. /continue resumes the most recent session whose workspace is this folder. /memory save <line> teaches the world about this folder (a note) and /memory recalls it; /memory recall <query> retrieves scored notes.

Diffs are rendered by the terminal from the structured result, not from the server’s text. A per-file stat comes first (3 files · +42 −7, then one line per file), followed by the hunks: added lines green, removed lines red, @@ hunk headers cyan and file headers bold. Colour is added only on an interactive terminal and never when NO_COLOR is set; redirected output stays plain.

Code Mode shares its palette with marina connect:

  • Themes. MARINA_THEME=harbor (the default), harbor-light or ansi, which uses your terminal’s own colours; see the interactive terminal.
  • Labels. Each kind of entry (error, approval requested, checks, worker, review, diff …) gets a glyph as well as a colour.
  • Commands. Help rows and /world … suggestions are drawn in the command colour.
  • Colour comes from structure. The colour comes from the entry’s label and structure, never from bytes in the text.
  • Live status. On a colour terminal, the footer under the prompt carries the same live segments as marina connect’s status bar (health, agents, tasks, approvals, held actions, spend, standing). MARINA_STATUSLINE changes it.
  • Live panels. /live [status|agents|spend|alerts|readiness|world|me] draws the dashboard’s views of the world in the transcript; your draft is kept.

A diff entry is kept whole in local history up to the server’s 64 KB limit. When the server cuts a larger diff, the terminal says so, with the bytes shown versus the total, and suggests code diff <path> to read one file in full. In marina --tui, /diff also opens a diff view: n/p jump between files, ]/[ between hunks, arrows and PageUp/PageDown scroll, and q (or Escape) returns to the conversation with your draft unchanged.

Complete an ordinary verified task from this terminal:

/project
/task Fix the pagination boundary and add a regression test
/status
/diff
/checks
/review
/review approve <attempt-id>

Copy the attempt ID from the review output. /review reject <attempt-id> rejects that submission; /review <attempt-id> inspects a historical attempt. Decisions require an explicit ID and use Marina’s existing ownership checks. Approval rechecks source freshness, so a direct filesystem edit after inspection can withhold approval. Approval records the canonical task decision; it does not commit, merge, or push files. The prompt distinguishes approval, rejection, and explicit unverified acceptance. Unverified acceptance remains the deliberate owner command /world code review accept-unverified <attempt-id> <reason> and never marks checks as passed.

/verify live starts background checks in the live workspace; those results remain unbound to an immutable candidate. For a Bun project needing dependencies, /verify candidate dependencies:bun explicitly prepares the captured lockfile inside the candidate with lifecycle scripts disabled. There is no automatic install; a project whose environment is not ready reports not_run. These shortcuts use the same server commands and permissions as other interfaces. Native runtimes retain their own tools. Redirected output stays plain text.

The prompt also shows worker pauses, budget exhaustion and upstream recovery when reported by the selected Marina worker. /status includes the reason; use the suggested agent status command to inspect its limits. A pause is not a completed task, and switching views does not raise budgets, resume workers or change task ownership.

Use /world <command> while a runtime is launching or a permission question is pending to send a message, inspect the world, or participate in another task. World input does not answer or dismiss a permission question, and your unfinished coding draft is kept. Coding input stays ordered behind setup. World commands still use normal server admission: a long synchronous command already running as your resident can delay subsequent commands. Use code verify start for finite local checks that return a receipt and leave your resident free to participate while they run. Approval prompts require both terminal input and visible terminal output; redirected or closed input/output never counts as consent.

/agents
/spawn codex reviewer
/use reviewer
Review the current implementation; send your findings to the other participant through Marina.
/use claude
/world task list
/dashboard

/use switches to a launched agent or starts an installed runtime. The first native worker uses your project folder. Additional workers use isolated Git worktrees starting at committed HEAD; uncommitted source edits are not copied. /spawn always requests a worktree and reports an error if it cannot create one. Agent output is labeled in the terminal and recorded through Marina’s existing participant routing. There is no fixed three-agent limit. /agents lists this terminal’s managed roster; independently joined participants remain discoverable through marina route and the browser Streams view.

When a native agent asks to change a file (Claude Edit, MultiEdit or Write, or a Codex or pi patch request), the terminal shows a unified diff against the current file, with its stat, before Allow? [y/N]. If the text to replace is not in the current file, it shows the requested replacement and says the file could not be compared. Other requests still show their JSON input. The answer means the same thing either way: only y or yes allows.

/dashboard opens an authenticated Streams workspace with output replay, agent controls, permissions and delivery history, without reconnecting the terminal’s chat session. The browser consumes the credential from the URL fragment into tab storage and removes the fragment immediately. “Disconnect this view” clears that tab’s credential. The normal dashboard remains available at the printed Dashboard URL.

Use /stop or Ctrl+C to interrupt the selected worker. A second Ctrl+C or /quit stops all native processes owned by this terminal and closes its local Marina. Worktrees and the output journal remain available for inspection. Restarting preserves history but does not replay uncertain work or resume a native process automatically. Run /agents to restore the recorded roster, inspect its history and workspace, then /resume <exact-name-or-id> to reconnect a stopped Claude, Codex or pi session. Recovery preserves its directory and model, refuses missing or changed identities, and sends no prior task again. The dashboard Streams controls offer the same action. Claude reports which conversation it opened only after it reads the first new prompt, so a Claude resume is confirmed in two steps: Marina refuses to start unless Claude has a recorded session with that id in that directory, and it denies every tool until Claude reports the recorded id. If Claude reports a different conversation, Marina interrupts it and marks the run failed with Claude did not resume the recorded session. The remaining risk is that this first prompt’s text reaches the opened conversation before confirmation; no tool can run on it.

After /world code files [directory], Tab suggests the displayed paths for /world code read <path> and code read <path> in the World pane. /checks and /history populate /show <artifact> and /review <attempt> hints. Observed native participants appear under /use and supported disconnected sessions under /resume. Both terminal renderers use these same local hints; the TUI shows a dropdown.

Suggestions only edit the draft. They do not scan the filesystem, fetch more data, run a command or approve work. File and artifact hints clear when you switch coding sessions; approval answers have no command completion. Refresh a listing if its contents changed.

In the dashboard, select an existing session in Work to open a personal desk. Its repository may be Marina itself or any external project. To publish a shared desk, choose Workspace → Canvas → Published panels → Create coding desk. Select an existing Marina coding session; optionally attach a task and a visible participant. Publish and open desk opens its activity, artifacts, recorded verification, request composer and world feed beside Chat. Each coding request is reviewed and targets that exact session, without changing Chat’s selected session. Native agents can be followed through participant resources and Streams; a native participant ID is not a Marina coding session ID.

The same publication is usable from the coding terminal:

/panel list
/panel desk
/panel views
/panel publish <canvas-id>
/view panel

/panel desk [session-id] opens a personal view of the current or explicit session without publishing it. /panel publish <canvas-id> [session-id] explicitly publishes a shared desk; /panel list supplies canvas IDs. Open a publication with /panel open <canvas-id> <node-id>. Up to four open views keep independent drafts and captured reviews. /panel use <number> or Alt+Left / Alt+Right in the TUI panel form switches views; /panel close closes only the current view.

In --tui, F8 focuses the panel. Tab/Shift+Tab selects fields and buttons; type into a field, use Space for a checkbox, and Enter to review an action. Review starts on Cancel; select Confirm to submit, or Escape to dismiss it. Scrollback mode uses /panel field, /panel act and /panel confirm; see Published panels.

Live updates, view switching and reconnects preserve drafts within the open application. Closing a panel only closes that view; it never stops the worker. Saved browser layouts restore references and geometry, not unsent drafts across reloads. Terminal exit still follows the process ownership rules above. Other conversations remain active throughout.

Marina workers receive CLAUDE.md, AGENTS.md and .marina.md from the effective workspace root when assigned work. code files <directory> and code read <path> refresh instructions along that path, from the root to the inspected directory. Deeper instructions apply within their subtree; same-directory documents retain their stated precedence. Workers are prompted to inspect a path before editing it. This is guidance, not an additional write permission gate.

Each delivery identifies its sources, scope, loaded byte count and any omissions or read errors. Assignment artifacts and inspection events record source metadata and SHA-256 hashes of the raw source excerpts. Automatic loading is bounded to 4 KiB per file, 16 KiB in total and 32 directory levels. Read truncated or omitted files explicitly before relying on them. Instructions are refreshed from disk on inspection, so subsequent edits can change the guidance. Symlinks and nonregular instruction files are refused.

For internal workers, exact repeated instruction excerpts are represented once in the retained conversation. Later reads keep a reference and their original source details. If compaction removes the full copy, a surviving reference restores it; changed or differently scoped rules are delivered in full. Raw inspections and the durable journal remain available. This avoids paying to resend the same conventions on every file read without treating old delivery as proof that the model still has them.

Use code search <query> path:<relative-path> to limit a search to one file or directory. The marina_code and typed search tools expose the same path field. For a path with spaces, use code search path:"src/my folder" -- <query>. Use -- before a query that contains a literal modifier, for example code search path:src -- path:literal.

Worktree sessions use the worktree’s instructions. Sandbox sessions report that host instructions were not loaded; inspect the actual execution workspace. Repository instructions never grant execution permission. Native external runtimes keep their own instruction loaders.

One-shot mode (marina -p "<task>" [dir], alias --print) dispatches a single task non-interactively: it boots (persistent DB by default, so -p runs accrete history), streams the agent’s work as usual, then waits for the structured completion signal. The coder does the task, runs whatever tests and checks it judges useful while working, and ends with its answer. On completion Marina prints the session diff and the agent’s summary. By default Marina adds no verification of its own: no snapshot, no repository gates, no requirement checklist, and it never reports the result as verified. The exit code:

Code Meaning
0 completed (status done): the changed files and the coder’s summary are printed
1 failed: the agent died mid-task, the run was stopped, or it ended blocked (the reason is printed; edits it made stay in the folder and are listed)
2 timed out after MARINA_CODE_TASK_TIMEOUT_MS (default 600000 ms); code stop was sent

Verified one-shots (--verify). --verify asks Marina to verify the result before it counts. The task is dispatched with a verification requirement it must pass to submit, and the exit code then says what you can rely on:

Code Meaning under --verify
0 completed and verified: the required verification passed (under candidate, the repository’s own gates and every listed requirement’s check; under delivery, every stated requirement observed by a passing check or declared not machine-checkable)
3 completed but not verified: no checks ran, they failed, the source changed after them, a stated requirement was left unobserved, or nothing changed (no_changes: nothing to verify). The reason is printed on stderr. --allow-unverified makes this 0 (the notice still prints).
1 failed, as above
2 timed out after MARINA_CODE_TASK_TIMEOUT_MS (default 600000 ms, 1200000 ms under candidate); code stop was sent

What verified means. --verification <mode> (or MARINA_CODE_VERIFICATION) sets what a one-shot task must verify before it can submit, and implies --verify. With --verify alone, a folder that is a Git repository’s root with a test runner Marina detects (a test script, pytest, cargo, go, Maven or Gradle) gets candidate; any other folder gets delivery.

  • candidate (the repository’s gates): the task is dispatched with code do verification:candidate gates:repository. Verification runs on a snapshot of the whole repository and runs every runner the repository configures, whatever language the change touched (a Python package with a JavaScript front end gets both suites): each one’s type-check (a configured mypy or pyright always runs over the whole project) and lint where it has them, tests relevant to the change, then the full suite under MARINA_CODE_VERIFY_FULL_BUDGET (scope changed+full). Dependencies are prepared in the snapshot (dependencies:auto) unless the coder names a manager. A saved recipe does not replace these gates, no other runner is substituted (pytest missing leaves the run not_run, never a unittest pass), a repository with no test command has no gates (lint alone never verifies), every gate must run and pass (a full suite that does not finish within its budget leaves the run not_run), and the snapshot must still match the folder.

    A failed gate runs once more on the task’s base commit (HEAD when the task started), checked out privately with the repository’s objects, under the same runner. A failure is labelled PRE-EXISTING only on positive evidence: every test failing with the change is identified by its repository-relative file and qualified name (two files’ same-named tests are different tests), fails on the base with the same error block (the error line and the expected and received values that follow it), and fails the same way on a second base run (the failing tests alone, bun test <files> or pytest <node ids>, else the whole step when it took at most 5 minutes). Then the coder is told at once that the failure exists without its change and to submit, noting it; the task completes but stays unverified (failed, reason “the repository’s gates already fail without this change: ”, exit 3). A test that fails with the change but not on the base is the change’s failure (CAUSED BY THIS CHANGE). Anything less is INCONCLUSIVE: any unnamed failure, even beside named ones (an “Unhandled error between tests”, an import error, a package that failed to build, a runner count above the failures it named), changed dependency manifests or lockfiles between the base and the change (the base would run with the change’s dependencies), more than 5000 failures, a cut output line, a base that could not be prepared or run, a different first error, or a failure that does not repeat. The coder is told to treat it as its own failure, investigate and fix it, or report it as blocked with the evidence, never to wait; the result stays unverified. Every failed step carries a digest built from its whole output (the stored excerpt is only the first 64 KB): the failing tests with file:line where the runner prints them (bun (fail), pytest FAILED/ERROR, go --- FAIL), the first assertion error, the last 40 lines (at most 4 KB), and for each failing test whether it also fails on the base. A coder maps each stated requirement to a check run in the snapshot before the gates: code verify candidate -- {"checks":["bun test test/paging.test.ts"],"requirements":[{"text":"the last page is kept","checks":[0]}]}. The run is verified only when the gates and every listed requirement’s check pass. With no list it is still verified on the gates, and the result says requirements not mapped.

    Each candidate snapshot is pinned under refs/marina/candidates/<uuid> so its evidence can be re-checked; capture refuses at 64 pins. Before each capture Marina retires the pins nobody needs (src/coding/candidate-retention.ts): those of attempts that ended (approved, rejected, cancelled, failed, interrupted) or were superseded by a newer candidate, any older than 14 days, and past 48, the oldest of the rest. It keeps, for an open task’s attempt, the candidate its evidence cites and its newest by Marina’s own capture order (never by commit time), never touches a pin younger than 10 minutes, and deletes only refs Marina created (the candidate name and Marina’s fixed commit identity and message), each by compare-and-swap.

  • delivery (default elsewhere, or --verification delivery): a JSON manifest of output files and checks, run alone in a clean directory with code verify delivery -- <manifest JSON>; every stated requirement mapped to a check that observes it, or the run is unverified.

  • checks: the project’s own checks in the live workspace.

The mode is the task’s code do verification:<mode> requirement; agents still choose the implementation and the checks. The coder’s deadline leaves room for the full suite: under candidate the one-shot timeout defaults to 20 minutes, and the coder is told to start the gates well before its deadline.

Native runtimes. marina -p --agent claude|codex|pi runs the native agent’s turn in the folder and, by default, exits 0 (status done) with the files it changed. Under --verify, when the turn finishes, Marina verifies its result the same way: if the folder changed, it runs code verify candidate gates:repository on a snapshot of the folder and reports verified only if every gate passed and the folder still matches the snapshot, re-checked when the result arrives. The turn and its verification share one deadline (MARINA_CODE_TASK_TIMEOUT_MS, 20 minutes by default when the folder has gates); past it the run is timeout (exit 2). Otherwise the run is unverified with the failing gate named (or the reason no gate could run, for example a folder that is not a Git repository), or no_changes when the turn changed nothing. A native turn maps no requirements, so the result always says the stated requirements were not mapped.

Questions and investigations without edits. A task whose right answer changes no files can submit its answer with code summary and no checks. Marina compares the workspace with its state observed just before the attempt was dispatched; if nothing changed, verification is not_applicable with a reason that starts nothing to verify: no files changed during this task. Status, review, the terminal result, task review and --json all show it as such: it is never passed and earns no verified-code credit. marina -p --verify reports status no_changes and exits 3 (completed but not verified, reason “nothing to verify”), like any other unverified completion; --allow-unverified makes it 0. Without --verify a no-change answer is an ordinary done (exit 0).

The baseline belongs to the attempt: steering keeps it, and a new attempt observes a new one. For a local workspace Marina records, without reading file contents or following links, each entry’s type, mode, size, inode, modification and change times (nanoseconds) and symlink target. Any write changes a file’s change time, so an edit later reverted to the same bytes still counts as a change (the conservative side). In a Git repository the source is what Git sees, tracked and untracked files, plus HEAD and the index, so a staged-only change or a commit is a change, and files marked assume-unchanged or skip-worktree are observed directly, so an edit Git does not report is still seen. Git-ignored entries (dependencies, build output, local data) are observed apart: when only they changed, the answer is still not_applicable and the reason names them, because no verification covers ignored files, except under delivery, where an ignored file can be a deliverable: there a changed (or unobserved) ignored file, or a delivery check the coder already ran, keeps the delivery verification. Changes already present when the attempt started are not the task’s: they stay out of the comparison, and the reason names them as not verified. In a plain folder without Git every entry is source. Git itself is asked only for metadata (the index and its recorded file stats, the diff of the index against HEAD, directory listings), with the repository’s content filters switched off, so observing never runs a filter or hashes contents; changes already present are found by comparing each file’s stat with the index’s. A repository with submodules, or a workspace holding a nested repository, is not observed (an edit inside one would escape), which keeps the normal verification.

Observation is bounded: 200000 entries in all, of which at most 10000 Git-ignored ones. Past the ignored budget (installed dependencies alone usually exceed it) the source is still compared and the reason says ignored files were not observed; a plain folder over the overall limit is not observed at all. On this repository a dispatch observes about 13500 entries, a fraction of a second. An unavailable baseline (including attempts from earlier versions), an observation error, a changed workspace binding, or an execution target other than the local host keeps the normal verification requirement. There is no fallback from a sandbox to observing the host. A task that changed files follows its verification contract.

Time budget. A one-shot hands its coder a budget slightly inside MARINA_CODE_TASK_TIMEOUT_MS (code do budget:<duration>, the shared duration grammar). The coder sees its deadline, is told to converge at 75 % of the time, and, a reserve before the deadline (a tenth of the budget, 15 s to 2 min), may only submit (marina_code summary) or report (blocked / assume). A submission after that point is the forced best effort: it is submitted with whatever verification it has and labelled budgetForced ({"reason":"deadline","used":…,"cap":…} in --json, and in the task’s evidence). It is never reported as verified unless its checks passed.

Spend stop. When the model budget runs out mid-task (the daily or scope spend cap, or an upstream refusing for money), no model can be asked to finish. The attempt ends anyway: if the coder changed the workspace, Marina submits that work for review. It uses a summary assembled without a model, keeps the recorded verification and adds the label budgetForced ({"reason":"spend",…}). If nothing changed, the attempt ends blocked with the same label. The submission verifier is not asked.

Driver. --driver crew runs the one-shot with the crew driver. A task with a contract (required verification, owner:unattended, a budget) stays ONE tracked attempt: a lead coder owns it, keeps the write lock and submits it under the contract, and a crew assembled around it reviews, tests and reports to the lead. The crew’s roster is recorded on the attempt, so when the lead cannot submit, a member may submit it for the crew with code summary submit:crew -- <summary>. That submission takes the same path as the lead’s: the same required checks and budget-forced label, the lead’s task claim, and still one attempt (a later summary from anyone does not submit again). It is attributed to the member (submittedBy on the attempt, a Submitted by: line in the task evidence, the member as actor of the submit event), and the lead is notified. Only a member on both the recorded roster and the live crew may do this: an outsider, a removed member or a dissolved crew is refused, and a member’s plain code summary stays progress. Without a contract, code do on a crew session still stores and dispatches a crew plan.

--json prints one JSON object as the last line of stdout and sends everything else to stderr: {"status":"done|failed|timeout","exitCode":…,"summary":…,"reason":…,"assumptions":[{"text":…,"source":"worker|block"}],"budgetForced":…,"taskId":…,"runId":…,"files":[{"path":…,"added":…,"removed":…}],"durationMs":…}. Under --verify the status is verified|unverified|no_changes|failed|timeout and the object also carries "verification", "verificationReason" and "requirements"; without it those fields are absent, because Marina verified nothing. summary is the coder’s summary (null when there is none, as for a native turn). files is what the run changed in the session, also when it failed or ended blocked; reason is the full reason a run failed (null otherwise); assumptions lists the interpretations made where no person could answer (below). The human-readable output prints the same assumptions after the summary. With --verification delivery or candidate (and for a native turn), requirements is {"listed":…,"optional":…,"verified":[…],"unverified":[…],"notCheckable":[{"text":…,"reason":…}]} (otherwise null); optional: true with listed: false means verified on the repository’s gates with requirements not mapped. A run whose checks passed but left a stated requirement unverified, recorded no checklist, or declared every requirement not machine-checkable is unverified (exit 3) and the notice names those requirements. A requirement declared not machine-checkable beside observed ones does not change the status: the run is verified (exit 0), the requirement stays under notCheckable (never verified) and stderr names it. status and exitCode in the object are always the process’s own.

Terminal window
marina -p "fix the off-by-one in the tokenizer and add a regression test" ~/projects/acme
echo $?

The exit code is 0 done · 1 failed · 2 timed out; with --verify, 0 verified · 3 completed, not verified (including nothing changed). To read the status from the JSON object instead:

Terminal window
marina -p "…" ~/projects/acme --json | tail -1 | jq .status

A task can also be given inside an already-running Marina. Start the server:

Terminal window
bun run start

Then, from another terminal, connect:

Terminal window
bun run scripts/connect.ts coder

Enter Code Mode with code — it evaluates the current directory and waits for a task. Then say what you want, in plain English:

code
fix the off-by-one in the tokenizer and add a regression test

Entering code binds a coding agent to your workspace. Type a natural-language task and it works autonomously — explores the repo, edits via reviewable patches, runs the test/lint chain, and iterates — streaming its progress back. Type again to steer it; code status to watch. This is the single-agent driver (the default).

The default coding agent follows an observable operating contract: received → inspect → plan → patch → apply → verify → submit → review. Dispatch through the single-agent driver or code assign creates a canonical Marina task and a durable attempt artifact. Follow-up instructions steer the same active attempt. Its tool events, changes, checks and summary carry the attempt and task IDs. A worker can hold one active coding attempt at a time.

code summary submits the worker’s task after storing its summary. Calling the tool or writing an operator note does not complete the task. Candidate verification is reported as passed, failed, missing, stale or unavailable. Submission and code review read actual included source bytes, so edits made outside Marina also make evidence stale. Live-workspace checks are reported as unbound: their output remains useful, but does not certify an immutable candidate. Only task review marks the canonical task completed:

code review # inspect the latest attempt, summary and verification
code review approve # accept its submitted task (task creator only)
code review reject # return its task to open work
code review <attempt-id> # inspect an older attempt

The dashboard renders the same task/evidence links and review actions. Ordinary task info, task approve and task reject still operate on the same task. A one-shot exit 0 means the worker stored and submitted its result; it does not mean the operator approved it or that every check passed. Check the reported verification and review evidence before accepting changes. code review approve withholds approval of candidate-bound work unless its checks still pass for the observed source. Inspect stale work and reverify in a new attempt. Ordinary task approve remains a manual task decision; it does not refresh evidence or mark changed source verified. Freshness is an observation at the displayed time, not a continuous lock on external writers.

For a task that must have current candidate evidence before submission, use:

/task Fix the pagination boundary and add a regression test
# Equivalent world commands:
code do verification:candidate -- Fix the pagination boundary and add a regression test
code assign alice verification:candidate -- Fix the pagination boundary

/task applies to Marina workers in local Git workspaces with the single-agent driver. Ordinary freeform dispatch retains its existing behavior. The owner sets the requirement when the attempt begins; steering preserves it. An early summary is saved as progress, keeps the same task active, and returns the missing step. Pending, failed, stale, unavailable, or live-workspace checks cannot satisfy the requirement. The worker inspects the candidate receipt/result, resolves failures, and submits another summary. The terminal shows server states: verification required, checks running, needs attention, or ready for review. Source freshness is reassessed at status, submission, and review; readiness is an observation. The configured check recipe determines what is tested: a whitespace-only fallback does not establish functional correctness. Use a project test recipe for a meaningful completion check.

Workers keep the completion requirement and a link to the full task artifact ahead of any abbreviated task reminder. Finish source and regression-test edits before verification; background completion reports the observed candidate state, and any later edit requires fresh checks. Coding note tools use single-line text; exact replacements use edit with oldText/newText, while a new file uses write with content.

If work cannot proceed, code blocked [kind:decision|impossible] <reason> saves a handoff, interrupts this attempt, and releases its claim (kind defaults to decision). It preserves edits and evidence. Configured worker budgets still apply; this requirement adds no retry scheduler or automatic dependency installation. An active task continues until it submits, reports a blocker, reaches its configured limits, or is stopped. An owner can deliberately accept a saved worker summary with code review accept-unverified <attempt-id> <reason>. This records who accepted the risk and why; it never changes missing or failed verification to passed. Normal approval still requires current evidence for a candidate-required task. World communication and other agents continue while background checks run.

For generated artifacts and service work, dispatch with code do verification:checks -- <task>. This requires passing checks from the same attempt and execution workspace, with no subsequent recorded file change or command. A whitespace-only receipt is insufficient. Use code recipe save default <validation command> to check the requested output or read back the service state, then code verify. Receipts distinguish tests, type checks and other checks. Passing live checks means those checks passed at the recorded time; it does not claim immutable source or complete coverage. Use verification:candidate when you require source-bound evidence.

For a package or set of files that must work away from the active workspace, use code do verification:delivery -- <task>. The worker can choose its implementation and checks; submission requires current delivery evidence. To verify manually, pass the manifest JSON inline to Marina; no bookkeeping file is needed in the project. The declaration has this shape:

{
"files": ["report.ts", "helper.ts", "report.test.ts", "order.test.ts"],
"checks": ["bun test report.test.ts", "bun test order.test.ts"],
"requirements": [
{ "text": "the report total is 11", "checks": [0] },
{ "text": "items are listed in input order", "checks": ["bun test order.test.ts"] },
{ "text": "the wording suits a non-technical reader", "notCheckable": "a judgement, not a property" }
]
}

requirements is the acceptance checklist: each explicit requirement of the task, in the worker’s words, mapped to the checks (by 0-based index or exact text) that observe it. Each check should measure the timing, ordering or output the requirement names, against the delivered files. Restating a requirement in prose does not count. Only a mapped check that ran and passed in the current delivery verification counts. Those checks are bound to the current files and the hashed manifest, so mapping a requirement after the checks ran makes the evidence stale. The receipt lists each requirement as verified, not machine-checkable (with its reason), or UNVERIFIED.

Enforcement under verification:delivery: a submission whose checks passed but which leaves a requirement unverified, or has no checklist at all, is refused once. The summary is kept as progress, and the reply lists exactly which requirements lack an observing check. The worker can add and map checks, or mark a requirement notCheckable with a reason; that marking is recorded and shown, never counted as verified. The next submission proceeds (bounded, never a loop). Any requirement still unverified is written into the submitted evidence and the terminal lifecycle requirements field. marina -p --verify reports such a run as unverified (exit 3). That still permits submission for owner review; --allow-unverified permits exit 0 while retaining the unverified status. A requirement explicitly marked not machine-checkable (a prohibition such as “do not read /tests”, which no check over delivered files can observe) is accepted by the same gate and does not by itself make a run unverified: when the checks passed and every other requirement was observed, marina -p --verify exits 0 and names the not-machine-checkable ones on stderr. A checklist with no observed requirement at all stays unverified. Other verification modes are unchanged.

Run code verify delivery -- <manifest JSON>, with the JSON after -- preserved as written. For example:

code verify delivery -- {"files":["report.ts","helper.ts","report.test.ts"],"checks":["bun test report.test.ts"],"requirements":[{"text":"the report total is 11","checks":[0]}]}

With marina_code (action verify) or marina_code_verify, set verificationMode: "delivery" and manifestJson to the JSON object or its encoded JSON string. Put verification options before --, for example code verify delivery dependencies:auto -- <manifest JSON>.

Inspect the returned receipt with code show <id>. The verification evidence saves the manifest content and its digest, and code show displays the declaration for review. Inline declarations stay in Marina’s evidence, leaving the project’s files and Git status untouched by bookkeeping. Existing callers can still use code verify delivery manifest:delivery.json (tool parameter manifest: "delivery.json") for a manifest already in the project. Supply exactly one source. The path form rereads the manifest during capture and submission to detect changes; a manifest file is copied into the clean directory only if explicitly included in files.

Marina copies only the listed regular files into a clean directory and runs those finite commands using the session’s configured host or mount-sync container runner. Missing companion files therefore cannot be supplied accidentally by the active workspace. Checks use the runner’s environment and the selected dependency preparation; this is file isolation, not a new security sandbox or a guarantee that every recipient has the same dependencies. Files changed by the checks or after verification require fresh evidence before submission. The manifest itself is also hashed.

Delivery mode supports local file workspaces, requires explicit relative file paths (no globs, directories, symlinks or .git). Include the files needed by both the deliverable and its checks, including dependency manifests and lockfiles. dependencies:check (the default) diagnoses a missing environment without installing; dependencies:auto prepares locked dependencies in the disposable snapshot. On the host, supported locks are Bun text locks and npm version 3 package-lock.json, using public-registry packages without install scripts or inherited registry credentials. Npm workspaces, local links, project .npmrc and shrinkwrap overrides are refused. Container preparation follows the existing mount-sync and network policy; no host fallback occurs.

A manifest may contain up to 128 files. Capture and freshness checks stream files in 64 KiB chunks, with default limits of 1 GiB per file and 4 GiB total. Operators can set positive byte limits with MARINA_CODE_DELIVERY_MAX_FILE_BYTES and MARINA_CODE_DELIVERY_MAX_TOTAL_BYTES. Background checks retain the normal execution gates and finite-command allowlist. Patch-sync and unsupported targets are refused without host fallback.

Personal and published coding desks offer Review delivery check for an existing manifest. Opening a desk or its evidence does not execute checks. Chat and canvas show the same recorded file inventory and digests. Passing checks establishes their recorded scope; owner acceptance and the adequacy of test coverage remain separate. Whitespace-only checks cannot satisfy a required task verification contract, including candidate mode.

Unattended blocks become assumptions. On an owner:unattended attempt nobody can answer a question, so a worker’s code blocked <reason> about a decision a person would normally make (ambiguity, conflicting requirements, missing sign-off for an in-scope choice) does not end the task. It is answered at once: the reply tells the worker to take the most defensible interpretation, record it with code assume <interpretation>, and continue to delivery. The block itself is recorded as an assumption too. Assumptions are assumption artifacts on the attempt; they appear in the submitted receipt, the terminal lifecycle event and the -p result. An answer is never authority: gates, permissions, dependency installation and the command policy are unchanged, so the worker proceeds without anything it was not allowed and records what it skipped. At most two blocks per attempt are answered this way; the next one ends the attempt with Blocked: <reason> (after 2 automatic answers). code blocked kind:impossible <reason> ends it at once, for what cannot be worked around (missing data or credentials, a broken environment). Either way the edits already made stay in the workspace. Only the attempt’s worker gets automatic answers; attended tasks keep the behavior above.

Marina’s one-shot -p path selects owner:unattended and a time budget, and exits 0 once a matching attempt submits. Under --verify it also selects the verification mode (above) and exits 0 only after a matching attempt submits with current verification; an observed no-change answer (no_changes, verification not_applicable) then exits 3. Submission remains separate from owner approval. Old completions from another attempt cannot finish the current task. The owner:unattended contract also lets the designated active worker run code writer <its-name> to reclaim a lock handed back to the owner. It cannot reclaim a collaborator’s lock, transfer the lock to somebody else, or revive a stopped or expired attempt. A handoff without to: remains a note. These are owner-selected contracts; agents choose their work and coordination methods.

code stop retains changes and ends the attempt as cancelled. Worker death records failure. On server restart, unfinished attempts become interrupted and their claims are released; Marina does not replay uncertain host actions. Inspect code review and artifacts before retrying. Closing a coding session with code done requires its active task to be submitted or stopped. The existing crew driver remains available; this task-attempt lifecycle currently covers the single Marina worker and explicit assignment paths.

Want a team instead of one agent? code driver crew (or code crew <goal>) fans the work out to an implementer / reviewer / tester. The driver is a seam — single today, multi-agent / multi-backend as it grows.

Any participant can ask another to review its changes, and only that reviewer gives the verdict:

code review request <name|auto> [author:<name>] [-- claims] # snapshot the changes, ask a reviewer
code review <review_id> # the snapshot, claims and verdicts
code review verdict <review_id> approve|rework [-- findings] # the reviewer only
code review request <review_id> [-- what changed] # the author's next round after rework
code review approve|reject <review_id> # a person closes it
code review request auto focus:security,edge-cases,simplicity # a panel: one reviewer per focus
code review request auto focus:panel # correctness, edge-cases, security, simplicity
code review <panel_id> # each focus, its reviewer and state
code review approve|reject <panel_id> # a person closes every member
code review request <review_id> reviewer:fresh [-- changes] # next round, a reviewer new to the work
  • Snapshot. Each round stores the author’s changes as a review_snapshot artifact: the diff of the requester’s coding session, or, for a supervised resident, the worktree diff its local supervisor captured (see participant routing). Over telnet the request is refused, like every host subprocess.
  • Reviewer. A named reviewer must be online. auto picks an online agent other than the author: a different vendor first, then a different model, then anyone, and the request records which tier it came from. The request reaches the reviewer as an ordinary tell, so it is owed until answered.
  • Focus and panels. focus:<name> tells the reviewer the one kind of problem to judge: correctness, edge-cases, security, simplicity, tests, performance, ux, or a short word of your own. Several focuses make a panel: one ordinary review per focus over the same snapshot, each with its own reviewer (auto picks a different one per focus; a,b names them in order). Reviewers told to look for different things overlap less than reviewers who all look for everything. When fewer reviewers are online than focuses, one takes a second focus and the request says so. Each member has its own verdict and rounds; the panel reports how many approve and tells the author when all do.
  • A fresh reviewer. The next round stays with the same reviewer unless you add reviewer:fresh (someone who has not reviewed this work; refused when no such reviewer is online; the earlier reviewers’ findings are withheld from it until it gives its own verdict) or reviewer:<name>. Earlier reviewers can still read the review.
  • Verdict. approve, or rework with findings. Rework reopens the work: the author gets the findings as a tell and requests the next round on the same review. The author never gives a verdict. An agent cannot close its own review; a person who wrote the change and asked for the review may close it, and the record says the author closed it.
  • Closing. A person closes the review: the author’s owner, the person who asked for it, or an operator. Merging against the reviewer’s verdict, or without one, is recorded as an override. The decision is recorded; the change itself is applied through its own path (git, code worktree merge).
  • Standing. A review earns standing only when it covers a Code Mode attempt whose recorded checks passed (the verified-code credit, once per attempt). A verdict with no passing checks behind it earns nothing.
  • Events. review_requested, review_verdict and review_closed carry names, ids and outcomes only; the diff, claims and findings stay in the review’s artifacts, readable by its author, reviewer, requester, the author’s owner and operators.

When a task has a check that can tell a right answer from a wrong one, run it several times and let the check choose:

code attempts 3 -- Fix the pagination boundary and add a regression test
code attempts 4 verification:candidate budget:20m -- <task>
code attempts 3 models:<a>,<b> -- <task> # rotate models across the attempts
code attempts # progress, and the selection once all have ended
code attempts stop # end the ones still working
code attempts take # bring the selected change into your workspace

Each attempt is an ordinary tracked task with its own coder, in its own session and its own worktree created from the same commit (uncommitted changes in your tree are not part of that base). When your checkout has node_modules and the worktree’s lockfile is identical, the worktree is linked to it, so its checks run without a full install per attempt (MARINA_CODE_WORKTREE_DEPS=off turns the link off). Every attempt must verify: verification:checks unless you name another mode. When the last attempt ends you are told which one was selected.

  • Only an attempt whose checks passed can be selected. If none passed, none is selected; Marina never votes or asks a model to choose among them.
  • When several pass, the checks do not rank them. They are listed by smaller change, then earlier finish, and the readout says that this order is a tie-break.
  • Nothing is merged or approved for you. Review the selected attempt with code use <session> then code review <attempt>; its change is in that session’s worktree, uncommitted (the readout names the path; the marina/session-* branch has no commit yet). The other attempts keep their sessions and worktrees.
  • An attempt’s coder stops when its attempt ends (so does a lane’s): the worktree stays as it was judged, and nothing keeps spending on it. The session stays; code do in it starts a coder again.
  • code attempts take applies the selected attempt’s change to the workspace of the session that started the attempts, uncommitted, where code diff, code verify and code ship work as for any change. It is refused, and nothing is applied, when your tree has changed the same files since. code lanes take does the same for every lane that passed inside its paths; run code verify afterwards, because no lane’s checks saw the others’ changes.
  • Gates, the runner, budgets and the daily spend cap apply to each attempt, so N attempts cost about N times one. A sandbox or container runner set on your session is carried to each attempt. MARINA_CODE_ATTEMPTS_MAX bounds N (8 on shared and public servers).

Use it for work with a real automatic check. Without one there is nothing to select by; ask for a review or a formation instead.

When a task has parts that touch different files, give each part its own coder:

code lanes api=src/api web=web,docs/web.md -- Add the export endpoint and its page
code lanes # each lane's state, and whether it stayed in its paths
code lanes stop # end the lanes still working
code lanes take # bring every passing lane into your workspace

Each lane is <name>=<path>[,<path>]: the files that coder owns. A directory owns everything under it. Every lane gets its own coder, session and worktree from the same commit, and is told its paths, the other lanes and who owns them.

  • A split whose lanes share a path is refused before anything starts. Coders that change the same files get in each other’s way; give a shared part to one coder with code do.
  • A lane cannot submit while its worktree has changes outside its paths: its summary is kept as progress and it is told which files to revert. A lane that ends another way (stopped, out of budget) with such changes is named in the readout.
  • Every lane must verify (verification:checks unless you name another mode).
  • When all lanes have ended you are told which passed inside their own paths. Their changes touch disjoint files, so they combine without conflicts, but each stays uncommitted in its own worktree (the readout names the paths), nothing is merged for you, and each lane’s checks ran without the other lanes’ changes: run the checks once more on the combined result.

Use lanes only for work that splits cleanly. Steps that depend on each other, and small fixes, go better to one coder.

A human in WebChat and an autonomous agent issue the same commands. You can pull a team together:

> code roles # see suggested roles (implementer, reviewer, tester…)
> code crew Refactor the auth module # auto-assembles a crew and dispatches the goal
> code crew Refactor auth with alice,bob # …or name the members yourself

When a crew shares a session, a write lock keeps changes coherent — one writer at a time, with explicit handoff — so a reviewer testing the code never clobbers the implementer’s work:

> code writer # who currently holds the write lock
> code handoff ready for review to:alice # hand the lock to alice (a session participant)

The recipient must be a session participant: the creator, the bound agent, a dispatched crew member, or anyone who has acted in the session. Only the current holder or the creator can pass a held lock on. An unknown to: recipient refuses the handoff and keeps the lock. The older spelling code handoff <notes> to alice still works when to alice ends the notes and names a participant. Otherwise the notes are stored as written and the lock is left alone, so a “to” in the prose never moves it.

Approvals are first-class, auditable artifacts. Risky actions can be surfaced as approvals — request/approve/deny artifacts that leave a visible decision trail and render as cards with Approve/Deny buttons in the dashboard. (These records are advisory: they record the decision, and any session participant, the requester included, can decide one. Only code service publish requires a matching approved network request. Commands held by a safety gate are approved by a person through a challenge, not through these records.) From any surface:

> code approvals # pending requests
> code approve <id> / code deny <id>

Switch the profile to use another tool’s vocabulary; it maps onto Marina’s primitives:

> code profile use claude # accept→apply, bash→run, compact→summary, …
> code profile help codex

Sessions, patches, checkpoints, and summaries don’t vanish when you disconnect. code list shows your sessions; code resume <id> picks one back up; code history replays what happened. Summaries deposit into the project’s shared pools; skills learned during a session (code skill add …) outlive it.

Do this Command
Start / resume / finish code start [title] · code resume <id> · code done [summary] · code list
Look around code files [path] · code read <path> [offset:<line>] [limit:<lines>] [column:<character>] · code search <query> [path:<relative-path>] · code diff
Run things code run <cmd> · code verify · code test / lint / typecheck · code recipe run <name>
Change code code patch <title> → code apply last patch · code checkpoint [title] · code revert <id>
Review code approvals · code approve|deny <id>
Team up code roles · code crew <goal> [with a,b] · code attempts <n> -- <task> · code lanes <name>=<paths> … -- <task> · code writer [agent] · code handoff <notes> [to:agent]
Capture code summary <notes> · code skill add <name> <text> · code task <title>
Orient code doctor · code onboard · code status · code history

Full reference any time: code help.

Every step the agent takes is a command you can drive yourself:

code start Fix the parser # open a coding session
code doctor # check the workspace is ready
code files # look around
code read src/parser.ts # read a file
code run test # run the test suite (allowlisted)
code patch Fix off-by-one # propose a diff (paste it on the next line)
code apply last patch # apply the proposed patch
code checkpoint before-refactor # snapshot you can revert to
code done Fixed the parser # close the session with a summary

1. Connect. Any surface works — the dashboard at http://localhost:3300, the compact web chat at http://localhost:3300/chat, telnet, the SDK, or the marina CLI:

Terminal window
bun run scripts/connect.ts coder

2. Start a session. Code Mode opens against your workspace:

> code start Fix the parser
Coding session started: code_8f3a1c2b-7de
Title: Fix the parser
Workspace: /home/you/projects/acme
Try: code files | code search <query> | code read <path> | code diff

When the server has several code roots, the reply also lists the others. A session edits only its own workspace: a title that names a root (or a path under one) starts the session there, and code workspace use <path> chooses one for the sessions that follow.

(Tip: bare code enters Code Mode, where you can drop the prefix — files, read <path>, run test, exit. The explicit code <verb> form always works too.)

3. Check readiness. code doctor tells you exactly what’s available and what to fix:

> code doctor
Workspace: /home/you/projects/acme (git repo, clean)
git: ok ripgrep: ok package manager: bun
Verification: typecheck, lint, test detected
Ready.

4. Explore. Read-only and fast:

> code files src
> code read src/parser.ts
> code read src/parser.ts offset:2001 limit:200
> code search off by one
> code diff

code read <path> still starts at line 1. Reads return numbered lines; offset:<line> selects a one-based starting line and limit:<lines> requests a page (default and maximum 2000 lines). A page also stops at 50 KiB of numbered text. Whenever more content remains, the reply gives the exact code read command that continues it, and includes it in the structured response’s commands and metadata.continuation. The line range and next position are in metadata too. An empty file or an offset past EOF returns no lines and no continuation.

For a single line larger than a page, the continuation adds column:<character>: a one-based Unicode character column within that line. This keeps every part readable without splitting a Unicode character. Line numbers stay the file’s original line numbers; remove the N: prefixes when copying source text into an edit.

Modifiers use key:value; key=value, --key value and --key=value work too. To read a path that looks like a modifier, put it after --, for example code read offset:2001 limit:200 -- limit:notes.txt. marina_code_read_file and marina_code with action=read accept the same optional numeric offset, limit and column fields alongside path. Local, worktree, and container workspaces share this file-reading surface. A sandbox execution target continues to read the session’s host workspace files; it does not imply guest-file synchronization.

5. Run a check. In the default local target, allowlisted commands run in the host workspace. In an explicitly selected Flywheel target, finite guest commands run in the active sandbox project. Either way, normalized output and execution evidence are stored on the session:

> code run test
$ bun test
412 pass 0 fail
exit 0 · 8.1s

code verify runs the detected chain in one go; see Verification.

6. Propose a change. You (or an agent) propose a unified diff as a reviewable patch, rather than editing blindly:

> code patch Fix off-by-one in tokenizer
diff --git a/src/parser.ts b/src/parser.ts
@@ -42,1 +42,1 @@
- for (let i = 0; i <= tokens.length; i++) {
+ for (let i = 0; i < tokens.length; i++) {

Marina checks it applies cleanly and stores it as a pending patch. The reply shows the patch’s stat and its first hunk; code show <patch-id> prints the whole diff. Apply it when you’re happy:

> code apply last patch
Patch applied: patch_2a9f…
1 file · +1 −1
src/parser.ts +1 −1

The apply reply lists what that patch changed, not the whole workspace; code diff shows all working changes.

7. Stay safe. Snapshot before risky work and reverse it instantly if needed:

> code checkpoint before-refactor
> code revert last checkpoint

8. Close the loop. Finishing a session leaves a durable trail — a summary that becomes part of the project’s memory:

> code done Fixed the off-by-one; added a regression test.

code run groups single- or double-quoted arguments without invoking a shell: code run python -c 'import json; print(json.load(open("result.json")))'. For literal arguments, including nested quotes, use code run --argv ["python", "-c", "print(1 + 2)"]. Both forms use the same execution permissions, allowlist and approval audit as other workspace commands. Variables, pipes, substitutions and globs are not expanded.

Use marina_see with source: "workspace:images/diagram.png", or code see images/diagram.png What labels are visible?. PNG, JPEG, GIF and WebP files are read through the active session’s workspace and explicit task input grants. Absolute paths inside that workspace are accepted. Files outside those grants and sandbox-only paths are refused; no copying into internal scratch storage is needed.

The result is a saved visual_evidence artifact with the question, model, source path and SHA-256 of the observed bytes. It is model output, not independently verified fact. After a context reset, use code artifacts kind visual_evidence and code show <id> to recover the complete observation without another vision request. A changed image requires another inspection; the saved observation identifies the bytes seen earlier.

The file list offers Inspect image. A canvas coding desk offers Review image inspection and displays the same saved evidence under Artifacts & verification. Opening a desk or reopening evidence does not start a model call. Canvas readers use their existing session permissions; publishing a desk never copies private image bytes.

Verification receipts cover only the checks shown. A successful workspace test does not establish that a separately collected deliverable works: include its dependencies in the delivery contract and check the collected files in the intended environment. Task review remains a separate decision.

Plan mode can inspect original task and verification artifacts with marina_code_show, using IDs from its artifact list. For exact constraints and identifiers, reopen the original request: a saved proposal or context summary may paraphrase or miscopy it. This read path uses the same session permissions as code show and does not grant file writes or command execution.

code verify runs the detected chain in one go, where the session runs (the host, or its container runner):

  1. Prepare for the detected project type. A probe checks that the environment has what the checks need (python -m pytest --version, go version, node_modules for a package with dependencies or workspace links, and so on). A JavaScript installer never runs on a Python project, and the reverse. When the detected runner is pytest and the probe shows pytest is not importable (and nothing could install it), the tests run instead with the project’s own test script (tests/run_tests.py, tests/run_all.py, tests/run.py, test/run_tests.py, test/run_all.py, unless it imports pytest itself) or python -m unittest (discovery, or the relevant test modules by dotted name). The report says so — runner: unittest (pytest unavailable), and testRunner in the artifact metadata — and such a run passes only when it reports tests ran (Ran N tests, N passed); zero tests or silence is not_run. code test follows the same switch. The fallback command runs through the same allowlist and approval as any other check.
  2. Type-check, when the project configures it and the chain does not already run it: tsc --noEmit for a tsconfig.json, mypy or pyright on the changed Python files.
  3. Checks and tests: typecheck → lint → test → build for JavaScript, the project’s test runner otherwise. Tests relevant to the change run first (see below).

Every verification ends in one of four states:

State Meaning
passed the checks ran and passed
failed the checks ran and at least one failed (a timed-out check counts as failed)
not_run nothing could be checked: no tests were found, the runner is missing, or the environment is not ready. The reason is recorded.
error the infrastructure failed: the container runtime could not start, or the pending diff did not apply

not_run and error are never counted as a pass or a failure: not by task submission, not in lessons, and not by the SWE-bench adapter’s counts. A task that requires candidate verification stays active on not_run; report it with code blocked <reason>, or the owner may accept the work unverified.

Changing source or tests invalidates earlier candidate verification. The submission feedback includes a retry command preserving the recorded verification options; finish your edits, review the options, rerun checks and inspect the completed receipt before submitting again.

Options (each also has an operator default, MARINA_CODE_VERIFY_*):

code verify scope:auto # default: relevant tests, else the full suite
code verify scope:changed # relevant tests only (not_run when there are none)
code verify scope:full # the whole suite
code verify scope:changed+full budget:10m # relevant tests, then the full suite within 10 minutes
code verify dependencies:check # default: probe the environment, never install
code verify dependencies:none # skip the probe
code verify dependencies:auto # also install locked dependencies where that is isolated
code verify typecheck:off # skip the configured type-check

Workspace roots require preparation even when dependencies are declared only in child packages. dependencies:check still never installs; dependencies:bun uses the locked, isolated candidate installer with lifecycle scripts disabled. One default differs: inside a tracked task that must verify, a code verify candidate that names no mode (and no operator setting does) prepares dependencies itself, because the snapshot holds none and the task cannot submit on checks that did not run. It first uses what the workspace already has installed, when the snapshot’s lockfiles are byte-identical to the workspace’s: nothing is downloaded, installed or run, so this works with no network. Only when there is nothing to use does it fall back to the locked install dependencies:auto performs, which needs the package registry. The result says which of the two happened. The repository’s gates (gates:repository) take the two in the other order: the locked install first, and the workspace’s installed dependencies only when that install cannot complete, as on a machine with no network. The gate result then records linked-from-workspace, because those files are the workspace’s own and not a fresh install. Before any locked install starts, Marina asks the registry one question with a 5-second limit, so a network that silently drops outbound traffic fails in seconds instead of waiting out the installer’s time limit. An operator can set MARINA_CODE_VERIFY_DEPENDENCIES for a deployment’s normal policy; explicit command modifiers override it. Use none only for checks known to need no installed dependencies.

Verification receipt IDs are artifacts, not files. Inspect them with code show <id>, or marina_code with action=show and artifactId=<id>. A completed request displays its linked result, including failed-check output and the full-output artifact pointer.

Relevant tests are the test files you changed, tests named after the files you changed (test_parser.py, parser.test.ts, ParserTest.java), and tests that import them. Go runs the packages you changed. JavaScript is scoped only when the test script’s runner accepts file paths (Jest, Vitest, Mocha, bun test, node --test). Rust runs the whole suite. At most 25 test targets are selected.

Installing dependencies. dependencies:auto, or the project’s own manager (dependencies:npm, uv, …), installs locked dependencies only where the install is isolated and persists: a candidate or delivery snapshot with a Bun text lockfile or npm v3 lockfile on the host (below), or a container runner with sync:mount and network:on (npm ci --ignore-scripts, pnpm/yarn/bun install --frozen-lockfile --ignore-scripts, uv sync --frozen). Elsewhere, a missing environment is reported as not_run with the reason. A sync:patch runner starts every command from its image, so the image must already hold the environment. Python projects with requirements.txt can use dependencies:pip: the container installs hash-locked binary wheels into .venv/marina-site-packages, and checks use env PYTHONPATH=.venv/marina-site-packages python …. Unhashed or source-only requirements fail preparation instead of falling back to unrestricted installation. UV checks use the declared UV environment. Explicit installation modes reconcile locked dependencies even if a test-runner probe succeeds; dependencies:check only probes. Commands use argv, so a bare PYTHONPATH=… python … is not shell assignment syntax.

For a local workspace, code verify start starts that same chain and returns a durable verification_request artifact immediately. Its command completion acknowledges admission; it does not mean checks passed. Continue chatting or inspecting other sessions. Completion arrives as a later world event; code show <receipt_id> displays the status, any error, and the result artifact. Target the original session when inspecting it from another session. The existing code verify and code recipe run still wait for their results.

Background verification is bounded to four workspaces per engine, one request per real workspace path, and at most eight commands per recipe. It accepts only the existing local command allowlist and requires unattended code.exec competence (or the local trust profile). Interactive shell approvals, supervised checks, and Flywheel checks use foreground verification. Session access, writer authority, execution target, transport, and the current coding attempt are rechecked before each check process starts, including after waiting for the workspace lock. Revocation stops subsequent processes; it does not undo or cancel one already executing.

Results remain attached to the original session and attempt. code verify and code verify start use the live workspace and existing per-command workspace lock; they are unbound checks. Graceful shutdown drains admitted checks before closing persistence, subject to the server’s existing 30-second forced-shutdown watchdog. After an interrupted process, unfinished receipts are marked interrupted with an unknown execution outcome and are never replayed automatically. Inspect the workspace before retrying.

For immutable source evidence in a supported local Git repository, use code verify candidate. This uses the same background admission and authority checks, with a separate source directory and Git index. It captures actual tracked and untracked, non-ignored files into a Git tree using an alternate index, without changing your index, staging choices, branch or HEAD. Tracked deletions, executable modes, binary files and internal relative symlinks are represented. Git stat caches and assume-unchanged flags cannot hide source edits. The Git working-tree root must be the session root; sparse checkouts, unresolved merges, submodules, filters/LFS, encoding or ident attributes, escaping symlinks and non-UTF-8/newline paths are refused explicitly. In the bubblewrap sandbox runner, a repository with content filters is supported: git inside the sandbox stages the files, so the tree holds the filtered blobs your git would commit, while the copy the checks run on and the source hash keep the raw bytes.

The candidate artifact records the tree, base commit, repository, capture policy, source hash and retained ref. Each command receipt names the candidate and temporary execution directory; the verification artifact records commands, exit status, runtime, final source hash and freshness. The directory is disposed after checking. If checks modify included source, Marina captures a successor candidate and withholds evidence for it until it is separately verified. Those changes are never copied back automatically. The fallback whitespace check compares the candidate index with its base (git diff --cached --check); it is labeled whitespace-only, not a test suite.

Capture is bounded to 8,192 paths, 16 MiB per file and 128 MiB total. Ignored untracked files (including node_modules, generated files and ignored secrets) are excluded. Included credential-shaped files such as .env.local, .npmrc and private-key files cause refusal; this filename rule is not a content secret scanner. External dependencies are excluded by default. When the checks need dependencies the snapshot lacks, verification reports not_run.

Candidate checks run where the session runs: with a container runner, the snapshot is mounted (sync:mount) or its diff applied (sync:patch) inside the same image, under the same allowlist, approvals and gates. They never fall back to the host. The verification artifact records the runner (executionRunner).

For a Bun project on the host, opt into preparation with:

code verify candidate dependencies:auto # or dependencies:bun
# From the terminal:
/world code verify candidate dependencies:bun

Marina requires a captured bun.lock, installs into the disposable snapshot with --frozen-lockfile --ignore-scripts, and records preparation separately from checks. It uses an isolated cache and copied packages; it never copies or links the writer’s node_modules. The supported dependency sources are integrity-locked public npm packages and captured workspaces. Repository/global install settings and credentials are not inherited; custom registries, Git/URL/file dependencies, uncaptured workspaces, unsafe patch paths and captured node_modules are refused. Native packages that need install scripts may therefore fail their checks. Preparation has a 120-second deadline and the existing background admission limits. A preparation failure stops the check chain and produces not_run evidence, with an inspectable output artifact. Successful evidence records the preparation policy and lockfile SHA-256; generated dependencies are excluded from source freshness only inside the private copy.

Npm projects can use dependencies:npm or dependencies:auto with a captured version 3 package-lock.json. The snapshot runs npm ci --ignore-scripts --no-audit --no-fund, including development dependencies, with private user/global config and a disposable cache. Only integrity-locked public npm packages are supported. Workspace links, project .npmrc, shrinkwrap overrides and captured node_modules are refused. The same preparation and failure reporting apply to code verify delivery dependencies:auto -- <manifest JSON>.

The source tree does not certify the external environment, services or dependencies, and the temporary directory is not a security sandbox. Host-local checks retain their existing trust model; Flywheel remains a separate execution target with no host fallback.

Git refs under refs/marina/candidates/ retain each snapshot and its base ancestry across Git GC. At 64 retained candidates, further captures refuse instead of deleting review evidence. Inspect the exact ref in code show <candidate-id> with git show <ref>:<path> or git diff <base-commit> <ref>. An operator may retire a finished candidate with git update-ref -d <ref> <recorded-commit> (the commit is in the artifact metadata). Retire only after its review/evidence retention needs end; later freshness checks report retired evidence unavailable. Refs are local Git metadata and are not pushed automatically.

Agents can use marina_code with action: "verify", verificationMode: "candidate", or the same optional verificationMode on marina_code_verify. The default remains live verification. Both tools also take dependencies (none, check, auto or a manager) and scope; ask for user authorization before installing dependencies. For either background mode, inspect the receipt’s result before writing the final summary.

By default a session uses the server’s working directory. For real projects, configure roots in the environment (for example in docker-compose or your shell):

MARINA_CODE_ROOTS=/srv/repos/acme,/srv/repos/widgets
MARINA_CODE_DEFAULT_ROOT=/srv/repos/acme

Then code workspace list, code workspace discover (find likely projects), and code workspace use <path> choose where new sessions open. code doctor confirms git + ripgrep are present (they power diff/checkpoint/revert and fast search).

Separate task data from source with operator-configured roots:

Terminal window
MARINA_CODE_INPUT_ROOTS=/srv/task-inputs
MARINA_CODE_OUTPUT_ROOTS=/srv/task-outputs

These existing directories must be separate from the workspace and from one another. File tools use their absolute paths; inputs are read-only, outputs support normal writer-authorized write and edit. They do not become selectable executable workspace roots. Git patches and candidate snapshots still belong to the primary workspace. Symlinks cannot escape a granted root.

With container sync:mount, input directories map read-only to /marina-task/inputs/0, /1, etc.; outputs map to /marina-task/outputs/0, /1, etc. code status and assignment context show the mapping. Container commands use guest paths; file tools use server paths. sync:patch refuses extra roots because it mounts no host files. Host processes retain their existing execution permissions; file-tool grants alone are not an OS sandbox. Use a container runner to enforce read-only inputs for executed programs.

code test, code verify and code recipe run detected follow the project’s language rather than assuming JavaScript. Detection reads root markers (pyproject.toml, setup.py, setup.cfg, tox.ini, pytest.ini, manage.py, tests/runtests.py, Cargo.toml, go.mod, pom.xml, build.gradle, package.json) and prefers the language of the files you changed, so a Python repository that also carries a package.json for tooling is tested with its Python runner. Lockfiles name the dependency manager (bun.lock, pnpm-lock.yaml, yarn.lock, package-lock.json, uv.lock, poetry.lock):

Project Runner
Django’s own repository (tests/runtests.py) python tests/runtests.py [labels]
Django project (manage.py) python manage.py test [labels]
Other Python python -m pytest [paths or node ids] [-q -x -v]; without pytest, the project’s test script or python -m unittest (see step 1 above)
Rust cargo test [filter]
Go go test ./... [-count=N -short -v]
Java (Maven / Gradle) mvn -B -q test [-Dtest=Class,…] / gradle test -q [--tests Class]
JavaScript / TypeScript the typecheck / lint / test / build package scripts, run with the lockfile’s manager (bun run, npm run, pnpm run, yarn run)

These join the code run allowlist only in those fixed shapes: relative selectors that stay inside the workspace and a few inert flags, never an arbitrary script or interpreter. code doctor shows the detected runner and why. A saved default recipe (code recipe save default …) overrides detection for a workspace.

Where it runs today: every coding session has an explicit execution target. The default is a real host workspace behind a safe allowlist (bun scripts such as test/lint/typecheck/build, plus a constrained git subset). When the operator configures Flywheel, an entity can create one durable isolated sandbox, materialize guest projects, run open finite commands there, and manage guest services. Selection is per session and never falls back silently to the host. See Optional isolated execution with Flywheel.

Running or applying code is an earned capability. Reading, searching, diffing, and proposing patches are open to everyone, but code run/verify/test and code apply/revert require the code.exec safety gate (low bar — standing 3; operators are granted it) so a freshly-spawned, untrusted agent can’t execute arbitrary host code. If code run is refused, you haven’t earned code.exec yet: the run is held, and once your owner or an operator approves it, it runs — three approvals from outside your own lineage make the gate yours — or an operator grants it. Under MARINA_AUTONOMY=earned supervised attempts run freely pending an operator’s count; under open this gate auto-passes (only the operator-grant core stays gated).

code workspace runner container image:<ref> keeps the session’s files on the host but runs its finite commands (tests, scripts, code verify) inside a container image: a project’s CI image, a language toolchain, or a benchmark environment. Podman or Docker is required.

code workspace runner # where commands run now
code workspace runner container image:python:3.12 workdir:/work
code workspace runner container image:<ref> sync:patch workdir:/testbed shell:bash
code workspace runner local # back to the host (if the operator allows)
  • sync:mount (default) binds the worktree at workdir read-write on a read-only container root, with the repository’s .git bound read-only so code in the container cannot change git metadata that Marina’s host git reads. The workspace root must be a repository root. The process runs as your user.
  • sync:patch mounts nothing from the host. The image already holds the project at workdir; Marina applies the session’s pending diff (tracked changes and new files) inside a throwaway container before each command.
  • An environment preamble (for example activating a conda env) is operator configuration: MARINA_CODE_CONTAINER_INIT. Text after -- is refused in-world, because a preamble would run outside the allowlist and approvals.

The same code.exec gate, allowlist and exec approvals apply as for host runs; configuring a runner is itself gated. Choosing an image yourself, or adding network:on, also needs the code.exec.unrestricted gate (a refusal asks your creator or an admin). All capabilities are dropped, CPU, memory and process limits apply (cpus:, memory: in MB, timeout:), and every container is removed after its command. If the runtime or image is missing, commands fail. Marina never quietly runs them on the host instead. code test, code verify and code verify start|candidate all use the session’s runner; a verification dependency install runs only in a mount-sync container with network, otherwise it is reported as not run.

Operators set the container for every local session with MARINA_CODE_CONTAINER_IMAGE (and _SYNC, _WORKDIR, _INIT, _SHELL, _NETWORK, _EGRESS, _RUNTIME). That is policy, not a default: code workspace runner local is refused and sessions may change only cpus:, memory: and timeout:. MARINA_CODE_CONTAINER_REQUIRED=false makes the image a default a session may leave for the host; MARINA_CODE_CONTAINER_REQUIRED=true requires a container even without an operator image. Neither can be changed in-world.

Instead of all-or-nothing network, podman runners can allow only named destinations: MARINA_CODE_CONTAINER_EGRESS="registry.npmjs.org,pypi.org,*.pythonhosted.org". Each command’s container then reaches nothing but a proxy inside the Marina process, which admits the listed hosts (on public addresses only) and refuses everything else; a refusal shows up in the command output as [marina egress] blocked <host>:<port>: …, and code run asks a person through a challenge: approving it allows that destination for the session and re-runs the command (nothing waits meanwhile). Nothing extra runs alongside Marina.

With MARINA_CODE_CONTAINER_MODEL_API=on as well, code in those containers can use Marina’s models through http://marina.model/v1 (OPENAI_BASE_URL and ANTHROPIC_BASE_URL are set for you). The container never holds a key: Marina’s proxy adds a short-lived, spend-capped key for each command and only /v1/ requests get through.

The container runtime uses your own container setup: the images you have already pulled, your containers.conf/storage.conf (or Docker context), and your registry logins, taken from the server’s environment at startup. The command inside the container gets none of that environment. To keep images elsewhere with Podman, set MARINA_CODE_CONTAINER_STORAGE (and optionally MARINA_CODE_CONTAINER_RUNROOT) to absolute paths. code doctor shows where images are stored and warns if that is on tmpfs or under /tmp, where images would fill memory.

code workspace runner sandbox runs the session’s commands in a local OS sandbox (bubblewrap 0.10 or newer, plus prlimit from util-linux; Linux) instead of on the host. Inside it there is no allowlist: any command runs, including shell lines.

code workspace runner sandbox # this session's commands run in the sandbox
code run rg -n TODO src
code run sh -c "grep -rn fixme src | sort | head -20"
code workspace runner local # back to the host allowlist (if allowed)
  • What the sandbox allows: any program installed on the system, pipes, &&, redirects (sh -c '<line>' or bash -c '<line>'), Bun (bun test, bun run typecheck), and writes anywhere in the workspace. code verify checks (candidate and delivery checks included) accept the same commands and run in the same sandbox, and so do the repository’s gates: the snapshot’s steps, a failed gate’s re-run on the base, and the gates after a native one-shot. With no network the snapshot cannot install dependencies, and the sandbox refuses a host install, so the JavaScript dependency trees the workspace already installed (every Git-ignored node_modules) are copied into the snapshot as files (nothing runs); with none installed the gates are not_run and say to install them in the workspace. Interactive session commands get a private /tmp on a size-capped RAM tmpfs (MARINA_CODE_SANDBOX_TMPFS_MB, 1024 by default); a gate or base run on a snapshot (finite and Marina-owned) gets a fresh host directory beside the snapshot bound at /tmp instead, removed with it, so a large suite cannot outgrow the tmpfs. Tests that need the network or the real home are skipped there or fail as pre-existing. When the sandbox refuses a snapshot or base checkout (no bubblewrap, untrusted launcher, server state inside it, …) the verification states the sandbox’s own reason.
  • What it hides or blocks: the network (none at all), your home directory (only the Bun executable is visible; HOME is an empty scratch directory), the server’s environment (API keys, tokens, MARINA_* settings), /run, /var and other users’ files. The system directories are read-only, /tmp is private and size-capped, and the repository’s .git is read-only, so git commands that write (commit, checkout, stash) fail inside. Commit with your own git outside.
  • Limits: every tmpfs is capped (/tmp and the hidden home MARINA_CODE_SANDBOX_TMPFS_MB, 1024 MiB each; /dev/shm MARINA_CODE_SANDBOX_SHM_MB, 64 MiB; /dev is read-only), and every command runs under prlimit: 4096 processes, 16 GiB of address space per process, 4 GiB per file, no core dumps (MARINA_CODE_SANDBOX_NPROC, _AS_MB, _FSIZE_MB).
  • No host fallback: if bwrap or prlimit is missing or untrusted, or the kernel refuses the user namespaces bubblewrap needs, commands fail with the reason.
  • What a sandbox workspace must be: a git repository root with its own .git. It may not contain your home directory or Marina’s own state (its database, spend ledger, ~/.marina, or the server’s .env), so the Marina checkout you run the server from cannot be sandboxed. Task input folders are bound read-only; task output folders are not supported in the sandbox yet. A git config that includes a file from inside the work tree is refused.
  • Held in place: each submodule’s .git (nested and uninitialised ones too) and anything your git config runs from inside the tree — a hooks directory such as husky’s .husky/, an fsmonitor, filter, diff or merge drivers, ! aliases — are read-only inside the sandbox and cannot be moved. Every key of every git config file is checked. A setting that reaches into the tree through shell syntax, a symlink, or a path that does not exist yet is refused; the message names the key and the file, never the value. A server PATH with a relative entry (such as node_modules/.bin) is refused too; this checks the server’s PATH, not your shell’s.
  • Content drivers and settings with shell expansion are supported. A repository that uses nbstripout (or any clean/smudge filter, diff textconv or external command, or merge driver) and settings that build a path at run time ($, backticks: a mergetool.<x>.cmd, a credential helper, core.editor, a ! alias) work in the sandbox. Marina’s own git work that needs a filter — the session diff, the list of changed files, code verify candidate’s tree, and the snapshot code trial and code ship commit — runs git inside the sandbox with the repository’s drivers and your own driver definitions and attributes, so a notebook is diffed and committed exactly as your git would (outputs stripped). Git on the host never runs a driver, a configured hook or a shell-expanded setting. Your own git does run them later, on your computer, with the work tree as their directory, and such a program can read files it does not name (as python -m nbstripout imports from the current directory). So code workspace runner and the start line name those settings, and when the session ends (code done, the end of marina --sandbox) and in code ship Marina lists every file the session created or changed — ignored files too — for you to review before you run git in that folder. code ship will not push for a sandboxed session when the push itself would use a credential helper, SSH or askpass command with shell expansion; push it yourself. git-lfs’s own filters are neither reported nor run in the sandbox (an LFS file is staged as stored, as before). Still refused: ext:: remote URLs (they run a command on your fetch or push) and a git config that includes a file from the tree.
  • Projects with git hooks: if the repository already has hooks (pre-commit, husky, hook.<name>.command), Marina says so at start and with every result. Those hooks run code from the work tree on your next commit, so review the changes before committing. If a command still changed a submodule’s .git, it fails, nothing is restored, and every command on that folder (any session) stays held until you have looked at the repository and run code workspace runner release (a person only); the owner and operators get an ops-inbox item. Your own plain git status would otherwise run whatever a planted submodule config names.
  • No dependency installs: there is no network, so code verify dependencies:auto reports an install as not run. Install dependencies before you start.
  • Toolchains in your home directory (~/.cargo, ~/.nvm, ~/.local/bin, pyenv) are hidden with it; tools from the system packages and Bun work.

Choosing the sandbox needs the same code.exec gate as code run; it is stricter than the host, so no other approval is involved. Operators set MARINA_CODE_SANDBOX: available (default) lets sessions choose it; default makes it the runner for every local session without its own setting, and only a person can move a session back to the host; required makes it the only runner (no in-world command leaves it, and a local setting stored earlier makes commands fail rather than run on the host); off refuses it. These are protected settings the dashboard cannot change. An operator-required container (MARINA_CODE_CONTAINER_REQUIRED, or MARINA_CODE_CONTAINER_IMAGE) still wins. code start says which runner is in effect.

From the terminal, marina --sandbox . (or marina --sandbox -p "<task>" .) starts the folder session with the sandbox required. It applies to Marina’s own coder; with --agent claude|codex|pi Marina prints a notice that the native agent runs commands in its own sandbox.

What stays yours: like any coding agent’s output, files it writes (scripts, package.json, build configuration) run with your full rights when you later run them.

What it does not protect: everything in the workspace is readable, including a project .env or credentials in .git/config, and what a command prints goes to the model. /etc and /opt are readable. The kernel is shared with the host, and there is no seccomp filter yet and no CPU limit beyond the command timeout.

Sandbox providers: use the sandbox you already have

Section titled “Sandbox providers: use the sandbox you already have”

Besides the host and a container image, a coding session can run its commands in an isolated sandbox from a provider you already run. Every provider plugs into one seam and declares what it can do; Marina keeps identity, approvals and audit, and a requested sandbox never falls back to the host.

code sandbox providers # what is configured, and what each can do
code sandbox start [image] # one provider configured: no need to name it
code sandbox start provider:openshell
code sandbox use openshell # this session's commands now run there
code sandbox local # back to the host

With several providers configured, name one (use <id>, or provider:<id> on any code sandbox command). Two providers ship today:

  • Flywheel (FLYWHEEL_TOKEN), described in the next section.

  • NVIDIA OpenShell (experimental). Run an OpenShell gateway yourself — on loopback, with mutual TLS and OPENSHELL_TELEMETRY_ENABLED=false — then point Marina at it:

    Terminal window
    MARINA_OPENSHELL_URL=https://127.0.0.1:17670
    MARINA_OPENSHELL_CA=/path/to/ca.crt
    MARINA_OPENSHELL_CERT=/path/to/client/tls.crt
    MARINA_OPENSHELL_KEY=/path/to/client/tls.key
    MARINA_OPENSHELL_IMAGE=docker.io/library/python:3.13-slim

    MARINA_OPENSHELL_IMAGE is optional.

    OpenShell enforces network rules per program inside each sandbox. When it holds a request, Marina turns it into a challenge for a person; approving it approves that rule in OpenShell, and the agent retries. Marina never installs OpenShell. Details: OpenShell sandboxes.

When the Marina server has FLYWHEEL_TOKEN, each entity can create one durable isolated workspace. This is shipped functionality; “optional” means Marina and local Code Mode do not require Flywheel:

code sandbox start
code sandbox use # active session now runs finite commands in Flywheel
# (several providers: code sandbox providers, then use <id>)
code project init demo # /workspace/projects/demo becomes the durable guest cwd
# or: code project clone https://github.com/example/project.git
code run bun test
code project status
code project diff # inspect tracked changes without marking them exported
code project export # bounded Git patch artifact for tracked work
code project export archive # complete bounded archive, including binary/untracked files
# code project import <project_archive_artifact> restored
code project delete restored confirm # refuses unexported work without `discard confirm`
code project reconcile # remove metadata belonging to a replaced sandbox
code service start web --port 3000 -- bun run dev
code service logs web
code service probe web /health
code service probes web # durable health history
code service screenshot web / # PNG evidence when Chromium is present in the image
code approval request network publish:<service-id>
# approve the returned artifact before publishing
code service publish web
code service revoke web
code service stop web
code sandbox local # explicitly return this session to host-safe local mode
# steward operations:
code sandbox ops inventory
code sandbox ops reclaim # dry run
code sandbox ops reclaim confirm # recoverable idle hibernation

Selection is stored per coding session. Sessions default to local, configuration alone never changes the target, and a Flywheel error never retries on the host. Use code sandbox status, hibernate, resume, and stop confirm for lifecycle management. code project list|diff|switch selects among durable guest projects and refuses to leave unexported dirty work. Public clone URLs must be credential-free HTTPS. Patch export remains the compact tracked-work path; bounded archive export/import preserves complete project content through Flywheel’s typed byte stream, stages and validates imports with digest, byte, expansion, member, path, and file-type limits, then atomically promotes them. Private Git remains a broker extension. Local and guest files are distinct and must not be treated as synchronized. Managed services run only in Flywheel, keep durable restart recipes and bounded guest logs, and stop across hibernation until explicitly restarted. PID plus process birth identity prevents a reused guest PID from being signaled as the original service. Localhost HTTP probes store response status, latency, and a bounded redacted body as verification evidence, with history available through code service probes. Publishing requires a matching one-use network approval and is automatically leased (one hour by default); stop, hibernate, explicit revoke, or lease expiry removes exposure. code sandbox network status reports whether policy is provider-owned or verified. Credential-like command arguments are refused; code sandbox credentials exposes only logical, secret-free binding state, and binding fails closed until Flywheel exposes its direct-sandbox broker contract. Screenshot capture runs a guest-local Chromium browser, transfers a size-bounded PNG, verifies its signature, and removes the guest temporary file. It fails closed when the sandbox image has no supported Chromium binary.

Use connected coding when your Marina already contains conversations, agents and ongoing work. Authenticate as your own resident, select a workspace configured on that server, and start a session:

Terminal window
marina connect Owner --url ws://localhost:3300
code workspace use /srv/projects/my-project
code start Repair the application

Disconnect that terminal with Ctrl+D, then attach the coding terminal:

Terminal window
marina attach ws://localhost:3300

marina attach [url] [--name <account>] [--session <id>] [--tui] [--mode <name>] [--verbose] fills in what you leave out (--verbose says on stderr where each piece came from):

Piece Resolution
Server The argument, then MARINA_URL, then the server of your only cached identity.
Account --name, then MARINA_ENTITY when the server came from MARINA_URL, then the only identity cached for that server in ~/.marina/sessions/. Several: a numbered choice in a terminal, otherwise an error that names them.
Credential MARINA_TOKEN, then the cached credential. None: in a terminal, the marina connect <name> login runs first; otherwise attach stops and asks you to authenticate.
Session --session, then MARINA_CODE_SESSION when the server came from MARINA_URL and no --name was given, then your active coding sessions on that server (code list). One is attached directly; several give a numbered choice in a terminal, otherwise an error listing them.

With no active session, attach stops with No active coding sessions for <name> on <url>. Start one there with: marina <folder>. Attach only chooses among identities and sessions you already have. It never creates one.

The explicit form still works, and MARINA_URL stands in for --url:

Terminal window
marina --url ws://localhost:3300 --name Owner --session code_<id>

If a piece is missing, the error names exactly what is missing and suggests marina attach.

Attaching reconnects the same resident using its cached credential for that server; an explicit MARINA_TOKEN also works. An invalid credential or inaccessible session is refused. It does not create a replacement identity or world. Reconnection rotates and privately saves the credential, including when a later session check refuses the attach. A resident can have one controlling connection: disconnect its existing chat/CLI before attaching.

Describe a task in ordinary language. The server’s coding agent uses the session’s existing model, dialect, permissions and workspace. The printed Server workspace path belongs to that server; files on your terminal’s machine are not synchronized. Configure provider credentials and allowed workspace roots on the server. Task dispatch still requires code.exec, and launching a new worker requires agent.spawn.

Fix the failing parser test, run the checks, and summarize the changes.
/world tell Reviewer I am working on the parser
/world channel send project Verification is running
/world task list
verify start

World messages and worker output continue while you work. /world uses normal command admission; background verification releases the command slot while finite checks run. Closing with /quit or Ctrl+D disconnects this view and leaves the world, agents and tasks running. /stop explicitly interrupts the selected coding worker. Reattaching restores its output stream and task indicator without replaying work. After a network failure, inspect status, history and artifacts before retrying an uncertain command.

Automatic recruitment only considers idle coding agents without a goal, focus, pending perceptions, task claim, active coding run or crew membership. An existing bound worker continues to receive its session’s steering; other autonomous workers keep their work. Additional workers remain an explicit or permission-gated choice.

Connected coding currently supports Marina’s server-side worker in an interactive terminal. Local native runtimes (/use codex, /spawn claude, etc.) require a separate workspace bridge and are refused here. Use the folder launcher for those runtimes. Simultaneous controlling views of one resident and connected one-shot mode are not yet supported.

SDK clients can direct an operation to an existing coding session without changing the resident’s selected session, modal input mode, or saved coding context:

await client.command("code status", { codingTarget: { sessionId } });
await client.command("code observe reproduced the failure", {
codingTarget: { sessionId, runId },
signal: controller.signal,
});

sessionId is required. The caller must be the session creator or its bound coding agent, matching code resume authority; holding its writer lock alone does not grant access. Existing write locks, competence gates, workspace boundaries and transport restrictions still apply. An optional runId is an execution precondition: it must still identify that session’s active attempt when the command starts. It is not a historical query selector. A rejected or uncertain request must be inspected before retrying.

Targeting currently supports session inspection (status, history, artifacts, show, thread, patches, review), owner dispatch (do, assign), evidence (plan, decision, observe, summary, blocked, assume), and workspace operations (files, read, search, diff, patch, propose, apply, reject, edit, write, checkpoint, revert, verify, run, test, lint, typecheck, build, dashboard:build, recipe). Use explicit code … input. Conflicting session IDs, selection changes, settings, separate recruitment/lifecycle operations, macros and room overrides are refused when a target is supplied. Commands without a target keep their existing behavior.

The WebSocket envelope carries coding_target: { sessionId, runId? }; successful login and authentication advertise codingTargetProtocol: "session-run-v1". The SDK refuses to send a targeted command if that support is absent, even on a server that supports correlated command completion. Gate challenges and held shell-execution approvals retain the target for replay through the normal bounded command queue. A shell approval for one execution cannot authorize another request or survive a stale/rejected replay. Explicit session-wide shell approvals retain their broader scope. Late results and approval audit records retain the attempt captured when execution began; replay output arrives as a world event, separate from the command that granted approval. code exec-mode off revokes pending shell approvals and enforces allowlist-only execution, including under the local profile. Session exec-mode overrides last until server restart.

This adds addressing to the existing command path. Commands from one participant still execute in FIFO order; it does not add a second execution lane or change world lifetime. Other participants and incoming world perceptions remain independent.

When a session’s folder is the checkout the running Marina server was started from, Code Mode never edits that tree in place. Before the session’s first edit, run or dispatched task, Marina binds it to an isolated Git worktree on its own marina/session-* branch and says so. The running server keeps serving its own code; the change is a branch you verify, try and merge like any other. Reading (code read, code search, code diff) stays on the checkout until then. A fork, a second clone or a linked worktree is an ordinary repository and is not isolated automatically. If the worktree cannot be created, the command is refused and nothing changes.

code trial benchmark:<name> cap:<usd> [limit:<n>] [replicates:<n>] [model:<id>] [upstream:<provider/model>] [seed:<n>]

code trial measures the session’s change against the build it branched from:

  1. It snapshots the session’s worktree, uncommitted changes included, without moving the branch.
  2. It starts the base build and the candidate build as two child Marinas, each on its own port and database, from temporary trees.
  3. This Marina’s harness sends both the same benchmark items, in paired replicates (default 2 of 50 items). Each run is filed in the ledger with the commit it measured.
  4. The verdict uses the rule that changes any default: the paired interval above zero and the gain past the margin for the number of trials already tried. It is one of candidate-wins, candidate-regresses, no-measurable-difference or incomplete.

The trial runs in the background and reports here; code show <artifact> has the numbers. The builds run someone’s unreviewed code, so they get no provider key and no path into this Marina’s data. Their only model access is this Marina’s /v1, through a key minted for the trial that adds no instruments of its own, stops at cap: and is revoked when the trial ends. Their default model is the provider model this Marina’s default resolves to; upstream:<provider/model> names another. Both builds are stopped and their trees removed when the trial ends. The benchmark’s dataset must be downloaded first (benchmark fetch <name>). A trial runs the session’s code, so it takes the code.exec capability.

code ship [merge] [-- <title>]

code ship opens a pull request for the session’s change to Marina’s own source:

  1. The latest trial must have measured exactly this change: the worktree now has the same Git tree as the trial’s candidate. A trial that found a regression, or did not complete, ships nothing; neither does a change that moved after its trial.
  2. The repository’s own gates must have verified exactly this change: the session’s latest verification is a passed code verify candidate gates:repository whose snapshot has the change’s tree, read through the latest verification attempt (a newer request that is still running, or ended without a result, is not hidden behind an older pass), with the snapshot’s source left intact by the checks and still current when they finished (the evidence rule a task submission uses). Anything else (no verification, another kind, failed, pre-existing failures, stale or altered source, or a change that moved since) is refused with the label and the command to run. A pull request opened by Marina never carries a change its repository’s checks fail.
  3. The worktree is committed on its own marina/session-* branch under the operator’s Git identity, with no hooks and no repository-supplied drivers.
  4. The branch is pushed and a pull request is opened against the repository’s default branch. Its description states the trial: verdict, both builds’ scores, the paired interval and the margin. merge also queues it for merge.

The repository’s own checks and merge queue still decide whether the change lands. Publishing uses the server’s gh sign-in. A person ships; an agent ships only under MARINA_AUTONOMY=sovereign.

Some files decide what Marina may do or how it judges itself:

  • the gates, trust and authority checks, and the as-of fence;
  • the promotion and statistics rules;
  • the trial and ship steps themselves;
  • CI, the package scripts and configuration.

When an agent ships a change to any of them, the pull request lists those files and Marina does not queue it, even with merge; a person reads it and queues it. MARINA_SELF_IMPROVE_PROTECTED=off lifts this hold. The result arrives here, and code show <artifact> has the link.

code improve shows what Marina’s own log says needs fixing. Every hour the work finder reads this server’s warnings and errors from the last 24 hours and groups them by signature: level, category and message, with names, numbers and quoted values masked, so one bug reported for many residents counts once. A signature seen 20 or more times is a candidate. Lines in the sandbox category are left out: a room a resident built that the sandbox refuses or disables is that room’s fault, and no change to Marina’s code fixes it.

Outcomes are candidates too. Every 6 hours the arena-outcome-review job scores the resolved arena rounds against the leading entrants and, for each family where Marina trails by 0.3 skill points or more over the last 35 days, publishes one finding: the losing rounds, Marina’s filing and the leader’s, and Marina’s own attribution (which pipeline stage lost skill, how old the reading it anchored on was, when it filed). It asks for a general fix measured walk-forward on the archived history before it ships. A family gets no new task while its last one is still open.

With MARINA_SELF_IMPROVE=on, each candidate becomes one task, at most 3 a day, outcome findings first. The task names the signature, its count and the latest error text, and says how to fix it on Marina’s own source: a Code Mode session, code trial, then code ship. The default, observe, only lists candidates; off reads nothing.

Every process Marina starts on someone’s behalf learns where it is: a Code Mode command (code run, checks, verification), a code service process, and a supervised native agent (Claude Code, Codex, pi). The variables are identity hints, never a credential: no token, key or password is exported, and a child still logs in by the normal rules (a supervised agent through its relay socket).

Variable Value Host Container, sandbox, provider
MARINA_URL this world’s WebSocket URL (ws://localhost:<port>) yes no
MARINA_ENDPOINT this world’s HTTP base (http://localhost:<port>) yes no
MARINA_WORLD_NAME the instance name (MARINA_NAME, else the world’s) yes yes
MARINA_ENTITY the entity the process acts for yes yes
MARINA_CODE_SESSION the Code Mode session id yes yes
MARINA_TASK the task bound to the session’s active attempt yes yes
MARINA_BIN_DIR the folder holding this Marina’s marina command yes no

A container, the bubblewrap sandbox and a sandbox provider’s guest have no route to this server and none of its files, so they get the identity hints only. On the host, MARINA_BIN_DIR is put on PATH: first when it is Marina’s own ~/.marina/bin, last when it is a shared folder such as ~/.bun/bin (so it never changes which bun runs). The URL is exported only once the server has bound its port. A supervised agent gets MARINA_ENTITY set to its own resident name and no inherited session or task.

The marina command reads them as defaults; an explicit flag or argument always wins:

Terminal window
marina -c "look" # = marina connect $MARINA_ENTITY -c "look"
marina -c "task submit Fixed it" # = task submit $MARINA_TASK Fixed it
marina -c "code resume" # = code resume $MARINA_CODE_SESSION
marina --verbose -c "task info" # stderr says where the server, name and id came from
marina attach # = marina attach $MARINA_URL --name $MARINA_ENTITY --session $MARINA_CODE_SESSION

Only forms that name no id are filled: task submit|heartbeat|info|progress|work|children and a bare code resume. Outside a Marina-started process marina -c asks for a name.