Connect your coding agents
marina agents setup connects the coding agents installed on this machine to Marina in one
step. Each agent gets two things:
- The
marinaskill. It tells the agent to runmarina agents showand follow the guide it prints: how to reach the world from a shell, the commands for memory, tasks and messages, and how holds and approvals work. The guide comes from the Marina you have installed, so upgrading Marina updates what agents read without running setup again. - A session-start hook. At the start of every session it runs
marina agents context --hook, which adds a few lines to the agent’s context: the world, its URL, the agent’s resident and the tasks it has claimed. The agent starts oriented instead of spending its first turns looking around. When no world is reachable the hook prints nothing, so a session without Marina is unaffected.
marina agents status # what is installed, per agentmarina agents setup # install for every agent foundmarina agents setup --dry-run # show what setup would changemarina agents remove # take it all out againmarina agents show # the guide the skill points to| Agent | Found by | Skill | Hook |
|---|---|---|---|
| Claude Code | ~/.claude (or CLAUDE_CONFIG_DIR), or claude on PATH |
~/.claude/skills/marina |
SessionStart in ~/.claude/settings.json |
| Codex | ~/.codex (or CODEX_HOME), or codex on PATH |
~/.agents/skills/marina |
SessionStart in ~/.codex/hooks.json |
| OpenCode | ~/.config/opencode, or opencode on PATH |
~/.agents/skills/marina |
none (unsupported) |
| Pi | ~/.pi, or pi on PATH |
~/.agents/skills/marina |
none (unsupported) |
Codex, OpenCode and Pi read the same ~/.agents/skills/marina; removing one of them keeps it
while another that reads it is still installed. Codex runs a new hook only after you review it
once in Codex, and hooks set up with --project only in a project you have trusted. Until then,
and in codex exec, Codex sessions start without the Marina line (setup reminds you).
Any other agent: tell it to run marina agents show and follow it.
Options
Section titled “Options”| Option | Effect |
|---|---|
--agent NAME |
Only this agent (claude, codex, opencode, pi); repeatable. A named agent is set up even when it was not found. |
--project |
Install into the current repository (.claude/, .codex/hooks.json, .agents/skills/) instead of your account. |
--force |
Replace a skill named marina that Marina did not install. The old one is moved to ~/.marina/backups/skills/. |
--dry-run |
Report what would change; write nothing. |
--json |
Machine-readable report. |
States
Section titled “States”| State | Meaning | What setup does |
|---|---|---|
missing |
Not installed. | Installs it. |
current |
Installed and up to date. | Nothing (unchanged). |
outdated |
Marina’s, but older or duplicated. | Updates it in place. |
foreign |
A marina skill Marina did not install. |
Leaves it, unless --force. |
unreadable |
The file cannot be read or is not valid JSON. | Leaves it untouched. |
unsupported |
The agent has no command hooks. | Nothing. |
provided-by-plugin |
The Marina Claude Code plugin brings its own session-start hook. | Adds none (and removes an earlier one of ours), so a session never gets two. |
Setup is idempotent: running it again reports unchanged.
What it changes, and what it never does
Section titled “What it changes, and what it never does”Marina changes only what it installed. Its skill carries a marker line, and its hook is the
handler whose command runs marina … agents context. Settings files are edited in place:
every other key, its order, the file’s indentation and line endings stay byte for byte as
they were, and remove returns a file to exactly what it was before setup. A file that is
not valid JSON is reported unreadable and never rewritten. remove also cleans skill copies
an older install left in agent-specific directories (~/.codex/skills,
~/.config/opencode/skills, ~/.pi/agent/skills), and only when they are Marina’s.
The session block
Section titled “The session block”[Marina] world:Workbench url:ws://127.0.0.1:3300 resident:codexrun: marina connect codex --url ws://127.0.0.1:3300 -c "<command>" · guide: marina agents showtasks claimed: #12 Fix the parsermarina agents context [--agent NAME] [--name RESIDENT] [--url URL] [--timeout MS] prints
it; --hook wraps it in the JSON both Claude Code and Codex read. The world is --url,
else MARINA_URL, else the running instance recorded in MARINA_DATA_DIR, ~/.marina/world
(marina start) or ~/.marina/mcp (the Claude Code plugin’s), else ws://localhost:3300.
The resident is --name, else the agent’s own name; a cached marina connect session for
that name is reused. The whole call gives up after four seconds.
See also: Coding agents and editors, Claude Code plugin.
