Skip to main content

ai_sessions_claude

Note

The ai_sessions_claude dataset is provisioned globally and created automatically the first time a tenant emits Claude Code telemetry. Access is restricted to admins by default. The dataset backs the Code Agents Intelligence GitHub repos tab.

Purpose

The ai_sessions_claude dataset captures the content of Claude Code sessions — the prompts developers typed, the model's answers, tool inputs, tool results, and errors. The cost and token metrics that drive the Code Agents dashboards live in the regular claude_code_* metric stream; the conversation transcript lives here. Together they let admins reconstruct per-session activity and answer "what did this spend buy us?" with concrete prompt and response evidence.

This dataset is the privacy control for prompt and response capture. Content logging on the developer side (via OTEL_LOG_USER_PROMPTS, OTEL_LOG_RAW_API_BODIES, OTEL_LOG_TOOL_CONTENT, OTEL_LOG_TOOL_DETAILS) sends the data to Coralogix; routing it into this admin-only dataset is what limits who can read it.

Schema description

Query the dataset

Users with read access can query the dataset in DataPrime using the dataspace path:

source ai_sessions_claude
| filter $d.body == 'claude_code.user_prompt'

From Explore, select ai_sessions_claude in the data-source selector to search and visualize it interactively. The dataset is archive-backed and not indexed in OpenSearch, so it doesn't appear in LiveTail or Frequent Search — queries run against the archive.

Customize access or routing

The defaults — auto-provisioned, admin-only — work for most organizations. If you need to grant access to additional roles, scope access to a subset of the data, or route a different subset of events into a separate dataset, manage the dataset through Dataset management:

  • Grant access to non-admin roles. Create a scope on ai.sessions.claude and bind the relevant team or role to it. Useful, for example, when a finance analyst needs read access to audit AI spend.
  • Scope access to a subset of the data. Attach a DPXL expression to an exception rule on the access policy for this dataset. Useful for restricting a role to a single subsystem or organization.
  • Route a different subset of events. Layer a TCO Optimizer policy on top of the default routing. Policies are evaluated in order; the first match wins.

Next steps

  • Set up content capture: add the content-logging variables (OTEL_LOG_USER_PROMPTS, OTEL_LOG_RAW_API_BODIES, OTEL_LOG_TOOL_CONTENT, OTEL_LOG_TOOL_DETAILS) — OTEL_LOG_RAW_API_BODIES also requires CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1 — to the env block you configured during Claude Code setup. Content logging is off by default.
  • View session data in context: see Code Agents Intelligence.
Last updated on