Skip to content
Development
Agent

sessions

A session groups the traces of one multi-turn conversation.

From plugin
phoenix
11k7 skills7 agents
Install
$ npx -y skills add arize-ai/phoenix --agent claude-code

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

A session groups the traces of one multi-turn conversation.

Agent definition

sessions.md

ProjectSession

A session groups the traces of one multi-turn conversation.

Reaching a session

  • `Project.sessions(timeRange, first, after, sort, sessionFilterCondition)` → connection of `ProjectSession`. `sessionFilterCondition` is a session filter expression; discover its bindable names via `Project.sessionFilterVocabulary` and check one with `Project.validateSessionFilterCondition`.
  • `getProjectSessionById(sessionId: String!)` → `ProjectSession` — `sessionId` is the raw session string, not a global id.

Fields

  • `sessionId`, `startTime`, `endTime`, `project`
  • `numTraces`, `numTracesWithError`
  • `firstInput { value }`, `lastOutput { value }`
  • `tokenUsage { prompt completion total }` — each is a `Float`
  • `costSummary { total { cost tokens } prompt { cost tokens } completion { cost tokens } }`, `costDetailSummaryEntries`
  • `traceLatencyMsQuantile(probability: Float!)` — the percentile field (not `latency`)
  • `traces(first, after)` — forward-only; `first` is effectively required. Summarize each turn via the trace's `rootSpan { name input { truncatedValue } output { truncatedValue } }`.
  • `sessionAnnotations { name label score }`, `sessionAnnotationSummaries(filter)`

Example

One round trip: session rollups plus a per-turn summary read from each trace's root span.

query SessionDetail($id: ID!) {
  node(id: $id) {
    ... on ProjectSession {
      sessionId
      numTraces
      numTracesWithError
      tokenUsage { total }
      costSummary { total { cost tokens } }
      p50: traceLatencyMsQuantile(probability: 0.5)
      traces(first: 20) {
        edges {
          node {
            traceId
            latencyMs
            numSpans
            rootSpan {
              spanId
              name
              statusCode
              input { truncatedValue }
              output { truncatedValue }
            }
          }
        }
        pageInfo { hasNextPage endCursor }
      }
    }
  }
}
Read more
Ships withphoenix

AI Observability & Evaluation

Get the whole plugin