> ## Documentation Index
> Fetch the complete documentation index at: https://claw-lens.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Sessions

> The Sessions browser lists every recorded agent session with token counts, costs, errors, and context health, and lets you drill into per-session details including model breakdown, tool usage, and message-level charts.

The Sessions page is a searchable, sortable table of every agent session Claw Lens has recorded. You can filter by agent, time range, and session type, then click any row to expand a full detail panel for that session.

<Note>
  Session data is read from the OpenClaw agent session files stored under `~/.openclaw/agents/{agent}/sessions/`.
</Note>

***

## KPI strip

The five KPIs at the top of the page summarize the currently visible session set:

| Metric             | Description                                                    |
| ------------------ | -------------------------------------------------------------- |
| **Total sessions** | Number of sessions matching the current filters                |
| **Active now**     | Sessions with a message in the last 10 minutes                 |
| **Errors today**   | Sessions started today that contain at least one error message |
| **Errors 7d**      | Error-containing sessions in the last 7 days                   |
| **Errors 30d**     | Error-containing sessions in the last 30 days                  |

Error counts are shown in red when non-zero.

***

## Filtering and sorting

Use the controls above the table to narrow down the session list:

<Steps>
  <Step title="Search by session ID">
    Type any part of a session UUID into the search box. This filter bypasses all other filters and matches across all loaded sessions.
  </Step>

  <Step title="Filter by agent">
    Select an agent from the dropdown to show only sessions for that agent.
  </Step>

  <Step title="Filter by time range">
    Choose **Today**, **Last 7 days**, **Last 30 days**, or **All time**. When a time filter is active, token counts and costs are recalculated to include only messages within that window.
  </Step>

  <Step title="Filter by session type">
    Choose **All sessions**, **Cron only**, or **Non-cron** to isolate scheduled vs. interactive sessions.
  </Step>

  <Step title="Sort">
    Sort by **Newest** (last activity), **Tokens**, **Cost**, **Errors**, or **Cache hit (ascending)**.
  </Step>
</Steps>

Click **Clear** to reset all filters at once.

***

## Sessions table

<Frame>
  <img src="https://mintcdn.com/matrix-45c0bb95/Ifk4PXR-QAPh3krg/images/session_table-1.png?fit=max&auto=format&n=Ifk4PXR-QAPh3krg&q=85&s=70a56498fa3f67280ec156eb048101ae" alt="Session Table 1" width="1525" height="314" data-path="images/session_table-1.png" />
</Frame>

Each row in the table represents one session. The columns are:

| Column               | Description                                                                                                           |
| -------------------- | --------------------------------------------------------------------------------------------------------------------- |
| **Session**          | First 12 characters of the session UUID, in blue monospace                                                            |
| **Agent**            | Name of the OpenClaw agent                                                                                            |
| **Live status**      | `running` (message in last 30 min) or `idle`                                                                          |
| **Model**            | Primary model used in the session                                                                                     |
| **Tokens**           | Total tokens across all messages                                                                                      |
| **Cost**             | Total cost for the session                                                                                            |
| **Cache hit**        | `cache_read / (cache_read + input_tokens)` — colored green ≥ 80 %, amber ≥ 50 %, red below 50 %                       |
| **Context pressure** | How full the context window was in the last assistant message: healthy (0–69 %), warning (70–89 %), critical (≥ 90 %) |
| **Burn rate**        | Direction of context growth across the last 3 messages: `rising` (red), `stable` (amber), `cooling` (green)           |
| **Last signal**      | The last `stop_reason` from the final assistant message                                                               |
| **Errors**           | Number of error messages in the session; shown in red when non-zero                                                   |
| **Duration**         | Wall-clock time from session start to last message                                                                    |
| **Avg per msg**      | Average tokens per assistant message                                                                                  |
| **Last active**      | Timestamp of the most recent message                                                                                  |
| **Started**          | Session start timestamp                                                                                               |

### Last signal values

| Signal     | Meaning                                                       |
| ---------- | ------------------------------------------------------------- |
| Normal     | `stop` or `end_turn` — session completed normally             |
| Error      | `error` — the agent encountered an unrecoverable error        |
| Aborted    | `aborted` — the run was cancelled                             |
| Max tokens | `max_tokens` — the context window was exhausted               |
| Active     | `tool_use` — the agent is mid-turn, waiting for a tool result |

***

## Cron vs manual sessions

<Frame>
  <img src="https://mintcdn.com/matrix-45c0bb95/Ifk4PXR-QAPh3krg/images/session_cron-1.png?fit=max&auto=format&n=Ifk4PXR-QAPh3krg&q=85&s=c3e27a3a4122f43c6828f81a9ecb3bd1" alt="Session Cron 1" width="1063" height="154" data-path="images/session_cron-1.png" />
</Frame>

Sessions triggered by a cron schedule are automatically tagged. You can distinguish them using:

* The **Cron only** filter in the filter bar
* The **Cron** field in the detail panel, which shows the cron task name when applicable

Scheduled sessions appear in the Cron Jobs panel on the Overview page and in the Token Usage cron vs manual breakdown.

***

## Session detail panel

Click any row to expand an inline detail panel for that session. The panel has two tabs.

<Frame>
  <img src="https://mintcdn.com/matrix-45c0bb95/Ifk4PXR-QAPh3krg/images/session_details.png?fit=max&auto=format&n=Ifk4PXR-QAPh3krg&q=85&s=dce145d5caa4d2ad2d104c100bbd8912" alt="Session Details" width="1549" height="924" data-path="images/session_details.png" />
</Frame>

### Overview tab

The Overview tab is divided into three columns:

**Column 1 — Session stats**

* Agent name, duration, start time, last updated
* Message count, error count, total cost, total tokens
* Whether the session is a cron session (and which cron task, if applicable)

**Column 2 — Cache breakdown**

A horizontal bar showing the proportion of token types: input (blue), cache read (green), cache write (purple). Below the bar:

* Cache hit rate as a large percentage (green ≥ 80 %, amber ≥ 50 %, red below 50 %)
* Exact token counts for each type

**Column 3 — Models and tools**

* Per-model message count and cost
* Per-tool call count and average duration

**Charts**

Below the three-column section, three stacked charts provide a per-step view of the session:

<CardGroup cols={3}>
  <Card title="Cost per step">
    A bar chart of cost per assistant message, ordered by sequence number. Useful for spotting expensive individual turns.
  </Card>

  <Card title="Tokens per step">
    A bar chart of total tokens per assistant message. Rising bars indicate the context window is filling up.
  </Card>

  <Card title="Context pressure">
    A line chart of context window usage over time, with reference lines at 70 % (amber) and 100 % (red). Error steps are marked with red dots.
  </Card>
</CardGroup>

### Messages tab

<Frame>
  <img src="https://mintcdn.com/matrix-45c0bb95/Ifk4PXR-QAPh3krg/images/session_messages.png?fit=max&auto=format&n=Ifk4PXR-QAPh3krg&q=85&s=23e9801305757ae894abf3ef1bc83a66" alt="Session Messages" width="1257" height="406" data-path="images/session_messages.png" />
</Frame>

The Messages tab lists every message in the session in a table with:

* Sequence number, model, role
* Input, output, cache read, cache write, and total tokens
* Cost per message
* Error flag and error message
* Latency (time since previous message)

Click any row to expand the raw message content, including tool call inputs, tool results, and text blocks.

***

## Navigating to the Session Timeline

From the detail panel header, click **View in Timeline** to open the [Session Timeline](/debugging/session-timeline) for a full message-by-message visual breakdown of that session.

<Frame>
  <img src="https://mintcdn.com/matrix-45c0bb95/Ifk4PXR-QAPh3krg/images/sessions_navigate_to_timeline.png?fit=max&auto=format&n=Ifk4PXR-QAPh3krg&q=85&s=9c4158b3359b2d79756281eb146f70cc" alt="Sessions Navigate To Timeline" width="576" height="209" data-path="images/sessions_navigate_to_timeline.png" />
</Frame>

You can also navigate to a specific session directly via URL:

```text theme={null}
/sessions?q={session_id}
```

The page will auto-scroll to the matching row and open the detail panel.
