Skip to main content
You talk to an agent in a session: one conversation with one harness on one machine. You send it messages. Each message the agent works on is a turn: it takes the message, works, replies and stops. run waits for the agent’s reply, and send doesn’t. That decides which one you use: On the CLI, send --watch waits too. In the examples, agents is boxd.machines.agents, as in the overview.
An agent that boxd runs doesn’t stop to ask for permission. It can do whatever the machine’s user can. See What the agent can do.

One task

run does a whole task in one call. It starts a session, sends the task, waits until the agent is done, returns the reply, and closes the session.
reason says how the turn ended: The CLI prints the reply to stdout and progress to stderr. It exits 0 when the turn ended done, and 1 otherwise. If the agent leaves a long command running when it ends its turn, such as a build, run still returns and nothing is killed. The session closes by itself once the command is done.

Several messages

For a conversation, start the session yourself. run with session then sends a message into it and waits for the reply. The session remembers what was said, so each message can build on the ones before it.
Sessions covers a session’s settings, its states and closing it.

Send without waiting

send hands the agent a message and returns at once. The agent does the work in the machine, with or without you.
To see the work, follow the session’s events.

Step in while the agent works

You don’t have to wait until a turn is done. While it runs, you can correct the agent, line up more work, or stop it.
  • A message with when: "now" is taken into account before the turn ends. Both Claude Code and Codex can do this. If no turn is running, it starts one.
  • A plain message leaves the running turn alone. send returns a delivery that says what became of it: started, queued or joined.
  • An interrupt ends the turn as interrupted. The session stays open, and a message that was waiting starts the next turn. An interrupt can also drop the waiting messages, or stop one turn by its number. See the reference.