Public Beta. This content is updated as features change.

Sessions

A session is one piece of work by an AI agent. Harnessforce rolls up token counts, cost, and API and tool failures for each session.

View as Markdownllms.txt
Claude Code install commands
/plugin marketplace add lambda-script/harnessforce-agent
/plugin install harnessforce@harnessforce-agent
/harnessforce:setup

A session is one piece of work by an AI agent. Harnessforce rolls up token counts, cost, API calls, tool calls, and their failures from the session's telemetry. On an issue, the sessions linked to it appear under "Sessions."

What counts as a session

A session's ID (session_id) is a UUID v5 derived from the workspace, the agent type, and the session ID. Whether telemetry, a plugin hook, the MCP server, or harnessforce import registers a session, Harnessforce treats it as the same session.

  • Sessions are built from Claude Code telemetry that carries a session ID. Telemetry without a session ID is still stored, but it isn't grouped into a session.
  • If the session ID in the telemetry differs from the one the hook received, Harnessforce still joins them into one session when the first prompt ID matches.
  • Sessions are assembled from log events and metrics. Claude Code traces are in beta, so they're added as span detail when they arrive.

What a session contains

FieldMeaning
ModelThe model used in the last API request
Start and endThe times of the first and last records in the session
Token countsTotals for input, output, cache read, and cache write
CostThe cost the agent reported. If the agent didn't report one, Harnessforce estimates it from per-model prices and token counts, and marks it as estimated
API requests and API errorsThe number of API requests and errors in the session
Tool calls and tool failuresThe number of tool results and how many of them failed
Active timeThe total of Claude Code's active time, in seconds
Repository and branchThe repository and branch when the session started

Values Harnessforce couldn't collect stay empty instead of showing 0. For example, if no API request events arrived for a session, its token counts are empty, not zero. If a session used a model that isn't in the price table, its cost stays empty instead of being estimated. Claude Haiku 5.5 is priced by the prompt length of each request, which a session's totals don't tell, so a session that used it also has an empty cost unless the agent reported one. A trace estimates each request at the price for its own prompt length.

Session status

A session's status is worked out from the time of its last record when you view it.

StatusCondition
RunningThe last record is within the last 30 minutes
CompletedMore than 30 minutes have passed, and the last API event wasn't an error
Ended with errorMore than 30 minutes have passed, and the last API event was an error

Imported sessions

Past sessions you bring in with harnessforce import are sessions too. Until telemetry for the same session arrives, they're labeled "Imported." Once telemetry arrives, the values built from telemetry take precedence and the session counts as a single session.

An imported session has the model, input and output token counts, and tool calls and failures. Its cost is estimated from the price table (a Claude Haiku 5.5 session's cost is empty). Cache read, cache write, API requests, API errors, and active time are empty. Imported sessions don't affect which developer seats are assigned.

Reading sessions through the Read API

Use GET /api/v1/sessions to read sessions. Filtering by issue identifier returns only sessions with a confirmed link to that issue.

For the returned fields and authentication, see Read API.