Skip to content

Coding in Marina

Run marina in a project folder, describe a task in plain words, and a coding agent does it: it reads the code, edits it, runs the tests, and hands you a change to review.

This guide takes you from nothing to a tested, reviewed change, then covers what people do next. Everything you look up rather than read (every option, setting and limit) is in the Coding reference.

A few words used throughout:

Word Meaning
World The Marina instance a session lives in. It keeps running, so sessions, notes and other agents persist.
Session One piece of coding work in one folder. It keeps its history, changes and checks.
Coder The agent doing the work. Also called the worker.
Task What you asked for. It is tracked from request to review.
Checks The project’s own tests, lint and type-check.
Verified The checks passed on a frozen snapshot of the change, not on files still being edited.
Review Your decision to approve or reject the submitted work.

A recorded coding session: the task typed in plain words, the coder’s edits and test run, verification passed on a frozen snapshot, task submitted for review

Run marina in a project and describe a task. The recording above is one such session, as it happened: “Add nextLowTide to src/tide.ts and a test for both functions, then run the tests.” The coder wrote the function and five tests, ran them, had the same tests re-run on a frozen snapshot of the code, submitted task #1 for review with that receipt, and noted one thing it left alone because it was outside the task.

You need one thing first: a model. The default coder is Marina’s own coding agent, using the provider key in ~/.marina/.env (marina init writes one), or per folder. If you already have a coding tool installed, Marina can run it with its existing sign-in instead, and then no Marina key is needed:

Terminal window
marina --agent claude
marina --agent codex
marina --agent pi

For a fullscreen workspace, run marina --tui (terminal workspace). More launch options: Launch options.

This path uses a disposable, intentionally broken TypeScript project included with Marina. It is the shortest way to see the coder inspect code, change it, run checks, and report evidence without risking one of your repositories.

From the Marina repository root:

Terminal window
rm -rf /tmp/marina-coding-agent-demo
cp -R examples/coding-agent-demo /tmp/marina-coding-agent-demo
cd /tmp/marina-coding-agent-demo
bun install
git init
git add .
git -c user.name="Marina Demo" -c user.email="demo@localhost" commit -m "demo baseline"
bun test

The last command should fail. That failure is the coder’s starting point.

The launcher reads provider keys from the shell that starts it, then from ~/.marina/.env. Choose one provider. Do not paste a real key into a command you intend to save or share:

Terminal window
export ANTHROPIC_API_KEY="your-key-here"

Automatic model selection also supports OPENAI_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, and OPENROUTER_API_KEY. For another provider or a local model, also export an explicit routable model such as MARINA_DEFAULT_MODEL=provider/model-id; see Configuration.

Return to the Marina repository and pass the demo path explicitly:

Terminal window
cd /path/to/marina
bun run code /tmp/marina-coding-agent-demo

Wait for the welcome card and the ❯ prompt, then paste this task exactly:

Fix the percentage-discount bug. Treat percent as a value from 0 through 100, reject invalid cents or percent inputs, add regression tests for boundaries and invalid inputs, then run the test and typecheck scripts. Do not change dependencies.

Marina starts a local world for that folder, binds one coder to it, and streams its progress. The expected lifecycle is received → inspect → plan → patch → apply → verify → complete.

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. When checks run they report in one line (✓ checks passed on a snapshot of the change). When it finishes, one block says how it ended:

──── Done · 2 files changed (+9 −1) · checks passed · 24s · $0.075 ────
2 files · +9 −1
paginate.js +1 −1
paginate.test.js +8 −0
The change is in your files now.
/diff see it again
/review approve task_run_… keep it and record your approval
/review reject task_run_… record that it is not right
undo it: git restore paginate.js paginate.test.js
Type a follow-up to keep going.

The time and cost are this task’s own. A blocked or stopped run says why in the same place.

At the same ❯ prompt, these are safe to paste:

status
diff
show last patch
focus on input validation before changing anything else

A plain sentence is steering or a new task; status, diff, and show are commands. Ctrl+C interrupts the coder; a second Ctrl+C, /quit or Ctrl+D exits.

Do not rely only on the coder’s summary:

Terminal window
cd /tmp/marina-coding-agent-demo
bun test
bun run typecheck
git diff --no-index \
/path/to/marina/examples/coding-agent-demo \
/tmp/marina-coding-agent-demo || true

Both checks should pass. The diff should show changes limited to the copied demo. Delete the copy when finished:

Terminal window
rm -rf /tmp/marina-coding-agent-demo
You see Do this
“No model provider is configured” Put a provider key in ~/.marina/.env (or run marina init), or export it in the same shell, then relaunch. Your project’s own .env is never read. 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.
Stale project database The failure hint prints the exact path (~/.marina/projects/<slug>/marina.db). Remove it, or relaunch with --fresh.
Wrong files appear Exit and relaunch with the explicit absolute path. /status shows the folder Marina is confined to. Check 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.

Type /help for one screen of essentials, /help all for every control. Tab completes names.

Type To
a plain sentence give a task, or steer the one in progress
/task <request> give a task that must pass checks on a snapshot before the coder can submit it
/plan <request> research and propose, write nothing
/project see the folder, model, Git state and which checks will run
/status see the task and any checks in progress
/diff see the working changes
/verify run the checks on a snapshot of the change
/checks list recorded check results
/review inspect the latest attempt and its evidence
/review approve <attempt-id> record your approval
/review reject <attempt-id> record that it is not right
/model <id> · /fast switch model · pick the cheapest reachable one
/cost see today’s model spend against the daily cap
/memory save <line> · /memory teach Marina about this folder · recall it
/dashboard open the same world in a browser, signed in
/stop or Ctrl+C interrupt the coder
/quit or Ctrl+D leave

A typical verified task:

/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.

Full list, keys and views: The coding terminal.

Two separate things happen after the coder finishes.

Checks. The coder submits its work with a summary and whatever checks it ran. 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
not_run nothing could be checked: no tests were found, the runner is missing, or the environment is not ready
error the infrastructure failed

not_run and error never count as a pass. /verify does not install dependencies automatically; a project whose environment is not ready reports not_run. If a file changes after the checks ran, the evidence is stale and the checks must run again.

Review. Submitted is not approved. You decide with /review approve or /review reject. Approval records your decision on the task. It does not commit, merge, or push files; do that with your own Git.

To undo, use the git restore line in the result block, or take a snapshot before risky work with code checkpoint before-refactor and go back with code revert last checkpoint (or code revert <id> for an earlier one).

Details: Tasks, submission and review and Verification.

By default the coder runs commands in your folder, on your machine, from a safe allowlist: the project’s test, lint, type-check and build commands, plus a constrained set of Git commands. Marina detects the project’s own test runner (JavaScript and TypeScript, Python, Rust, Go, Java).

Reading, searching and proposing changes are open to everyone. Running or applying code needs the code.exec safety gate. When you launch Marina in a folder you are the local operator, so it works. On a shared server a new agent’s run is held until a person approves it.

Three ways to isolate commands. A requested sandbox or container never falls back to your machine without saying so:

Option Start with What it does
Local sandbox marina --sandbox . Commands run in an OS sandbox (Linux, bubblewrap). Any command runs, with no network and your home directory hidden.
Container code workspace runner container image:<ref> Files stay on your machine; commands run inside a Podman or Docker image.
Sandbox provider code sandbox start Commands run in an isolated sandbox from a provider you already run.

Details: Where commands run.

marina -p "<task>" [dir] does one task without an interactive prompt, prints the changed files and the coder’s summary, then exits:

Terminal window
marina -p "fix the off-by-one in the tokenizer and add a regression test" ~/projects/acme
echo $?
Exit code Meaning
0 completed
1 failed, stopped or blocked; the reason is printed and any edits stay in the folder
2 timed out

By default Marina adds no verification of its own to a one-shot. Add --verify and exit 0 means completed and verified; exit 3 means completed but not verified. --json prints one JSON object as the last line of stdout:

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

Details: One-shot mode.

Each folder gets its own Marina database at ~/.marina/projects/<slug>/marina.db, so sessions, recorded results and agent memory build up across launches. Relaunching in the same folder shows Resuming on the welcome card and picks up where the last run left off. /continue resumes the most recent session in the folder.

Pass --fresh for a throwaway database, deleted on exit. Only that throwaway database is ever deleted; the per-folder one is yours to keep or remove.

The coder receives CLAUDE.md, AGENTS.md and .marina.md from the project root when it is given work, and the ones in deeper folders when it inspects files there. Put your conventions in one of them. Instructions guide the coder; they never grant permission to run anything.

Limits and details: Project instructions.

Start with one coder. Add others when the work calls for them.

You want Use
A second agent, such as a reviewer /spawn codex reviewer, then /use reviewer to talk to it. Each added agent works in its own Git worktree starting at committed HEAD; uncommitted edits are not copied.
Another participant to review a change code review request <name|auto>. Only that reviewer gives the verdict, and a person closes the review.
Several tries at one task code attempts 3 -- <task>. Each try has its own coder and worktree. Only a try whose checks passed can be selected; code attempts take brings it into your workspace.
One task split by files code lanes api=src/api web=web -- <task>. Each coder owns its paths; code lanes take brings every passing lane into your workspace.
A small team on one session code crew <goal> assembles an implementer, reviewer and tester.

Nothing is merged or approved for you in any of these. Inside the coding terminal, send commands like these to the world with /world <command>.

Details: Native agents, Peer review, Several attempts, Lanes and Crews.

If your Marina server already holds conversations, agents and ongoing work, code there instead of starting a new world. Sign in as yourself, choose a folder the server is configured for, 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

Describe a task in ordinary language. The files are on the server; files on your own machine are not synchronized. Closing with /quit or Ctrl+D disconnects this view and leaves the world, agents and tasks running.

Details: Code inside an existing world.

Every step the coder takes is a command you can run 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

Inside the folder launcher you are already in Code Mode, so you can omit the code prefix. code help lists everything; so does the command table.

A runnable, narrated session lives in examples/coding-quickstart/: copy and paste, or run the script to watch the whole loop end to end.