Browse the docs · Harnesses
docs / agents

Harnesses

A harness is the agent program a session runs: Claude Code, Codex, Cursor or Pi. Mod finds the harnesses installed on a machine, drives them, and gives each one the same session and the same tools. How a harness pays for its turns is covered in models.

How it works

Mod checks each machine for the harnesses it knows. It looks for the program on the path and for its sign-in, and records what it finds in the World's presence, so every device knows what every other device can run. A session is only offered the harnesses that can run where it is placed. When a harness is missing or out of date, Mod offers the vendor's own install or update command. It never invents an install path for someone else's tool.

The harness runs its own tool loop. Mod transcribes what it does onto the session's log: each tool call and its result become entries, the same as any other session. Every surface that reads the log, including the window, the phone and the CLI, sees the harness's work the same way.

Every harness writes to the same session log, and the harness is chosen per turn. Switching harness keeps the history and the holdings, because they are on the log, not in the harness. A harness's own conversation files are only a cache for resuming. If they are lost, the log supplies the context.

Each harness gets Mod's tools the way it expects them. Claude Code mounts them as an MCP server inside its process. Codex receives them natively, as dynamic tools on its own protocol. Cursor starts Mod's MCP server from a plugin folder Mod points it at, so nothing is written to your checkout or your Cursor settings. Pi loads an extension Mod ships, with every other extension turned off for driven turns. All four see one catalogue of tools, so they cannot drift into different ideas of what a Mod tool is.

When a session runs in a VM, the VM image already includes all four harnesses. The harness runs inside the VM and reaches Mod's tools through a bridge on the host.

Using it as you build

Install the harnesses you want on your machine and sign in to each one with its own login. Mod picks them up on its next check. You choose the harness and the model for a session from the model picker in the composer, and you can change it between turns.

A harness signed in with a subscription, such as a Claude or ChatGPT login, runs on your own machines. A harness on an API key can run anywhere a session can be placed. See models for the ways to pay.

Agents do not need to know which harness they are in. The same tool names work everywhere: read_document, patch_document, start_session, send_message and the rest.

Limits

  • Mod drives Codex from version 0.136.0, the first with the protocol Mod uses. The other harnesses have no minimum version.
  • Codex on an API key held at Mod's edge, inside a VM, is not finished. soon
  • Your own harness, or packages that change how Mod's own agent loop builds prompts, picks models and compacts long sessions, is designed but not built (RFC 0352). soon