Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Fdata-layer%2Fdefault-dataspace%2Fai-claude-sessions.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Fdata-layer%2Fdefault-dataspace%2Fai-claude-sessions.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# `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](https://coralogix.com/docs/docs/user-guides/ai/code-agents/.md) GitHub repos tab.

## Purpose[​](#purpose "Direct link to 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[​](#schema-description "Direct link to Schema description")

<!--$?-->

<!--/$-->

## Query the dataset[​](#query-the-dataset "Direct link to 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[​](#customize-access-or-routing "Direct link to 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](https://coralogix.com/docs/docs/user-guides/data-layer/dataset-management/.md):

* **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](https://coralogix.com/docs/docs/dataprime/user-guide/dpxl/.md) 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](https://coralogix.com/docs/docs/user-guides/account-management/tco-optimizer/.md) policy on top of the default routing. Policies are evaluated in order; the first match wins.

## Next steps[​](#next-steps "Direct link to 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](https://coralogix.com/docs/docs/integrations/ai-observability/claude-code/.md). Content logging is off by default.
* View session data in context: see [Code Agents Intelligence](https://coralogix.com/docs/docs/user-guides/ai/code-agents/.md).
