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. |
Start in your project folder
Section titled “Start in your project folder”
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:
marina --agent claudemarina --agent codexmarina --agent piFor a fullscreen workspace, run marina --tui
(terminal workspace). More launch options:
Launch options.
First autonomous fix (copy and paste)
Section titled “First autonomous fix (copy and paste)”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.
1. Prepare the demo
Section titled “1. Prepare the demo”From the Marina repository root:
rm -rf /tmp/marina-coding-agent-democp -R examples/coding-agent-demo /tmp/marina-coding-agent-democd /tmp/marina-coding-agent-demobun installgit initgit add .git -c user.name="Marina Demo" -c user.email="demo@localhost" commit -m "demo baseline"bun testThe last command should fail. That failure is the coder’s starting point.
2. Provide one model key
Section titled “2. Provide one model key”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:
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.
3. Launch Marina against only that folder
Section titled “3. Launch Marina against only that folder”Return to the Marina repository and pass the demo path explicitly:
cd /path/to/marinabun run code /tmp/marina-coding-agent-demoWait 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.
4. Watch, steer, and read the result
Section titled “4. Watch, steer, and read the result”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.jsType 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:
statusdiffshow last patchfocus on input validation before changing anything elseA 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.
5. Verify independently
Section titled “5. Verify independently”Do not rely only on the coder’s summary:
cd /tmp/marina-coding-agent-demobun testbun run typecheckgit diff --no-index \ /path/to/marina/examples/coding-agent-demo \ /tmp/marina-coding-agent-demo || trueBoth checks should pass. The diff should show changes limited to the copied demo. Delete the copy when finished:
rm -rf /tmp/marina-coding-agent-demoIf it does not start
Section titled “If it does not start”| 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.
Everyday controls
Section titled “Everyday controls”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.
Checks and review
Section titled “Checks and review”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.
Where commands run
Section titled “Where commands run”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.
One-shot runs for scripts
Section titled “One-shot runs for scripts”marina -p "<task>" [dir] does one task without an interactive prompt, prints the changed files
and the coder’s summary, then exits:
marina -p "fix the off-by-one in the tokenizer and add a regression test" ~/projects/acmeecho $?| 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:
marina -p "…" ~/projects/acme --json | tail -1 | jq .statusDetails: One-shot mode.
Sessions persist
Section titled “Sessions persist”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.
Project instructions
Section titled “Project instructions”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.
More than one agent
Section titled “More than one agent”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.
Code inside a running world
Section titled “Code inside a running world”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:
marina connect Owner --url ws://localhost:3300code workspace use /srv/projects/my-projectcode start Repair the applicationDisconnect that terminal with Ctrl+D, then attach the coding terminal:
marina attach ws://localhost:3300Describe 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.
Drive every step yourself
Section titled “Drive every step yourself”Every step the coder takes is a command you can run yourself:
code start Fix the parser # open a coding sessioncode doctor # check the workspace is readycode files # look aroundcode read src/parser.ts # read a filecode 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 patchcode checkpoint before-refactor # snapshot you can revert tocode done Fixed the parser # close the session with a summaryInside 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.
Try it now
Section titled “Try it now”A runnable, narrated session lives in examples/coding-quickstart/:
copy and paste, or run the script to watch the whole loop end to end.
Where to go next
Section titled “Where to go next”- Coding reference: every option, setting, limit and edge case
- Commands Quick Reference: every Marina command by category
- Agent Development: drive coding sessions from the TypeScript SDK
- Coordination: crews, roles, projects, and tasks in depth
- Connecting: WebChat, WebSocket, Telnet, MCP, SDK, and the ACP editor bridge
