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

# Agent runs

> Inspect agent sessions, conversations, and traces.

An agent run is a recorded agent session. It captures the prompt conversation, tool calls, model activity, status, usage, and trace data for one session.

Use agent run history when you want to understand how an agent responded, why a tool was called, where a session failed, or what a running session is doing.

## Where to find agent runs

Open **History** in the web app, then filter **Type** to **Agent**. Select a run to inspect its details.

The History page is shared across agent and workflow runs. See [Run history](/learn/logs/overview) for the full table, filters, statuses, and detail tabs.

## What starts an agent run

Agent sessions can start from several places:

| Source                | Example                                                       |
| --------------------- | ------------------------------------------------------------- |
| **API or CLI prompt** | `keystroke agents prompt support --message "Help me"`         |
| **Gateway**           | A Slack thread routed to an agent                             |
| **Trigger**           | A webhook, schedule, or poll attachment that invokes an agent |
| **Workflow**          | A workflow step that calls `Agent.prompt()`                   |
| **Another agent**     | A subagent tool call                                          |

Follow-up prompts with the same `sessionId` continue the same session instead of creating a separate one.

## Inspect the conversation

For agent runs, the detail panel's **Overview** tab shows the recorded conversation. User and assistant messages are shown in order, and assistant messages can include collapsed details for:

| Detail        | What it helps with                                 |
| ------------- | -------------------------------------------------- |
| **Thought**   | Reasoning or thinking output recorded by the model |
| **Tool call** | Tool name, arguments, and result or error          |
| **Error**     | Session error payload for failed runs              |

The **Metadata** tab shows run identity, actor, project, trigger, timing, models used, services used, and cost. The **Trace** tab shows raw spans and logs when trace data is available.

<Note>
  Conversation history depends on what the runtime recorded for that session. If no messages were recorded, the detail panel shows an empty conversation state.
</Note>

## Use the CLI

Use `keystroke agents sessions` when you know which agent you want to inspect:

```bash theme={null}
keystroke agents sessions list support --status failed
keystroke agents sessions get support <session-id> --include messages,trace
```

Use `keystroke history` when you want cloud history across agents and projects:

```bash theme={null}
keystroke history list --kind agent
keystroke history get <run-id>
```

`agents sessions` follows the resolved CLI target, so it can inspect local sessions while you are developing and cloud sessions after deploy. `history` is for platform run history in the active organization. See the [CLI reference](/cli#agents) for command details.

## Next steps

<CardGroup cols={2}>
  <Card title="Run history" href="/learn/logs/overview">
    Learn the shared History table and detail panel.
  </Card>

  <Card title="Run agents" href="/learn/agents/run-agents">
    Start and inspect agent sessions.
  </Card>

  <Card title="Build agents" href="/learn/agents/build-agents">
    Define agents, tools, models, and runtime behavior.
  </Card>

  <Card title="Workflow runs" href="/learn/logs/workflow-runs">
    Compare agent sessions with workflow executions.
  </Card>
</CardGroup>
