> ## 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.

# Watch and history

> See what an agent is doing right now and what it did earlier: a session's live events, the run history, and the console.

There are three places to look. A session's **events** show the work as it happens. The **run history** lists the turns that have finished. The **console** shows both.

## Follow a session

`events` gives you a session's events in order, from the first one. With `follow`, it stays open and carries new events as they happen:

```typescript TypeScript theme={"theme":"github-dark"}
const events = agents.events("myapp", session.id, { follow: true });

for await (const event of events) {
  if (event.type === "tool.started") console.log("tool:", event.name);
  if (event.type === "message") console.log(event.text);
  if (event.type === "turn.finished") {
    console.log("turn", event.turn, event.reason);
  }
}
```

```python Python theme={"theme":"github-dark"}
for event in agents.events("myapp", session.id, follow=True):
    if event.type == "tool.started":
        print("tool:", event.name)
    if event.type == "message":
        print(event.text)
    if event.type == "turn.finished":
        print("turn", event.turn, event.reason)
```

```bash CLI theme={"theme":"github-dark"}
boxd agent watch myapp $SESSION
```

The loop runs until you leave it. Leaving it doesn't stop the agent. Without `follow`, you get the events there are now, and the loop ends.

These are the events a session has:

| Event | What it is |
| - | - |
| `turn.started`, `turn.finished` | The start and the end of a turn. The end carries the [`reason`](https://docs.boxd.sh/guides/agents/conversations#one-task). |
| `user.message` | A message the turn received. |
| `message.delta`, `message` | The agent's reply as it is written, and the whole reply once it is. |
| `tool.started`, `tool.output`, `tool.finished` | A tool call, such as a shell command: its input, its output and its result. |
| `thinking.delta` | The agent's reasoning as it is written, for harnesses that show it. |
| `plan` | The agent's to-do list for the turn. |
| `usage` | The tokens the turn has used so far. |

Every event has a number, `seq`. To pick up where you left off, pass the last one you saw as `afterSeq` (`after_seq` in Python, `--after` in the CLI).

## Run history

`runs` lists finished turns, newest first.

```typescript TypeScript theme={"theme":"github-dark"}
const page = await agents.runs({ machine: "myapp", limit: 10 });

for (const run of page.runs) {
  console.log(run.sessionId, run.turn, run.reason, run.steps);
}
```

```python Python theme={"theme":"github-dark"}
page = agents.runs(machine="myapp", limit=10)

for run in page.runs:
    print(run.session_id, run.turn, run.reason, run.steps)
```

```bash CLI theme={"theme":"github-dark"}
boxd agent runs myapp --limit 10
```

Each turn has its harness, model, status, duration and tokens, but no messages or replies. The history is boxd's own record and is kept for 30 days, so reading it doesn't wake the machine, and it outlives the machine.

## In the console

A machine's **Agents** tab lists its sessions and their turns, and **Open transcript** shows a session's events. The **Agents** page lists recent turns across the organization. The console only shows: you start and drive sessions from the SDKs and the CLI.


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