> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boxd.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Reference

> Every SDK method and CLI command for agents, with its options, and the limits.

The SDK methods are on `boxd.machines.agents`, in [TypeScript](https://docs.boxd.sh/reference/typescript-sdk.md) and [Python](https://docs.boxd.sh/reference/python-sdk.md). `boxd agent` is short for `boxd machine agent`, and works the same on your laptop and inside a machine. Every CLI command takes `--json`.

## Methods and commands

A machine is given by its name or ID, and a harness by its name: `claude-code` or `codex`.

| What it does | SDK method | CLI command |
| - | - | - |
| [Run one task](https://docs.boxd.sh/guides/agents/conversations.md#one-task) and return the reply | `run` | `boxd agent run MACHINE HARNESS "task"` |
| [Start a session](https://docs.boxd.sh/guides/agents/sessions.md#start-a-session) | `start` | `boxd agent start MACHINE HARNESS` |
| [Send a message](https://docs.boxd.sh/guides/agents/conversations.md#send-without-waiting) to a session | `send` | `boxd agent send MACHINE SESSION "message"` |
| [Follow a session's events](https://docs.boxd.sh/guides/agents/history.md#follow-a-session) | `events` | `boxd agent watch MACHINE SESSION` |
| [Stop the running turn](https://docs.boxd.sh/guides/agents/conversations.md#step-in-while-the-agent-works) | `interrupt` | `boxd agent interrupt MACHINE SESSION` |
| [End a session](https://docs.boxd.sh/guides/agents/sessions.md#close-a-session) | `close` | `boxd agent close MACHINE SESSION` |
| [List a machine's sessions](https://docs.boxd.sh/guides/agents/sessions.md#check-on-your-sessions) | `list` | `boxd agent list MACHINE` |
| Show one session | `get` | `boxd agent get MACHINE SESSION` |
| List finished turns from the [run history](https://docs.boxd.sh/guides/agents/history.md#run-history) | `runs` | `boxd agent runs [MACHINE]` |
| List the [harnesses](https://docs.boxd.sh/guides/agents/harnesses.md) on a machine, with their models and effort levels | `harnesses` | `boxd agent harnesses MACHINE` |

## Options

Option names are the same in both SDKs, in the style of the language: `timeoutSecs` in TypeScript is `timeout_secs` in Python.

| For | SDK option | CLI flag | What it does |
| - | - | - | - |
| `start`, `run` | `model` | `--model NAME` | The [model](https://docs.boxd.sh/guides/agents/harnesses.md#models-and-effort). Default: the harness's own. |
| `start`, `run` | `effort` | `--effort LEVEL` | How hard the agent thinks. Default: the harness's own. |
| `start`, `run` | `cwd` | `--cwd DIR` | The directory the agent works in. Default: the home directory of the machine's user. |
| `start`, `run` | `instructions` | `--instructions TEXT` | Instructions of your own. They are added to the harness's own and never replace them. |
| `start`, `run` | `env` | `-e KEY=VALUE` | Environment variables for the agent, on top of the machine's env vars and secrets. |
| `run`, `send` | `timeoutSecs` | `--timeout SECS` | Interrupt the turn after this many seconds. |
| `run`, `send` | `maxSteps` | `--max-steps N` | Interrupt the turn after this many steps. A step is a call to the model for Claude Code, and a tool call for Codex. |
| `run` | `keep` | `--keep` | Leave the session open afterwards. |
| `run` | `session` | `--session ID` | Send the task to an open session instead of starting one. The session stays open. Not with `model`, `effort`, `cwd`, `instructions` or `env`. |
| `run` | `onEvent` | | Called for every event of the turn. The CLI prints progress to stderr. |
| `send` | `when: "now"` | `--now` | Join the running turn instead of waiting in the queue. |
| `send` | | `--watch` | Stay until the turn ends. In the SDKs, use `run` with `session`, or `events`. |
| `send`, `run` | | `-` as the message or task | Read it from stdin. |
| `events` | `afterSeq` | `--after SEQ` | Start after the event with this number. |
| `events` | `follow` | `--no-follow` | Stay open for new events. The SDKs don't follow unless you ask. The CLI follows unless you pass `--no-follow`. |
| `interrupt` | `clearQueue` | `--clear-queue` | Also drop the messages that are waiting. |
| `interrupt` | `turn` | `--turn N` | Only this turn: stopped if it runs, dropped if it still waits. Not with `clearQueue`. |
| `close` | `whenDone` | `--when-done` | Close once the session has nothing left to do, instead of now. |
| `list` | `all` | `--all` | Include closed and failed sessions. |
| `runs` | `machine` | `[MACHINE]` | Only this machine's turns. Default: every machine you can see. |
| `runs` | `session` | `--session ID` | Only this session's turns. |
| `runs` | `since` | `--since AGE` | Only turns since this moment. The SDKs take a date. The CLI takes an age: `90s`, `30m`, `24h`, `7d`. |
| `runs` | `limit` | `--limit N` | At most this many. Default 50, at most 500. |
| `runs` | `pageToken` | `--page-token TOKEN` | Go on from where an earlier page stopped. |

## Limits

| | |
| - | - |
| Harnesses | Claude Code and Codex. For another one, write to [contact@boxd.sh](mailto:contact@boxd.sh). |
| Agents you start by hand in a terminal | Not tracked: they aren't sessions, in the SDKs, the CLI or the console. |
| Run history | Kept for 30 days. |
| An idle session | The harness's process is stopped after 60 seconds, and starts again on the next message. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.