Berserk Docs

AI Sessions

Browse coding-agent activity as sessions of turns, and open any turn as a trace

The AI Sessions tab lists AI coding-agent sessions (Claude Code, or any emitter using the same telemetry shape) recorded in a traces table. One session is one agent conversation; each turn in it is one user prompt and everything the agent did until it stopped — and each turn is a full trace you can open as a span waterfall.

Prerequisites

The view is built from claude_code.interaction root spans, so the agent must export traces, not just logs and metrics. For Claude Code, follow the monitoring & usage guide and set at minimum:

export CLAUDE_CODE_ENABLE_TELEMETRY=1
export CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1
export OTEL_LOGS_EXPORTER=otlp
export OTEL_METRICS_EXPORTER=otlp
export OTEL_TRACES_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=<your Berserk ingest endpoint>

CLAUDE_CODE_ENHANCED_TELEMETRY_BETA is required

The span scope is gated behind CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1. Without it Claude Code exports logs and metrics but no spans, and this view stays empty for that user even though their activity shows up in log searches. The environment is captured when Claude Code starts, so restart the agent from a fresh shell after setting it.

Browsing Sessions

Pick a traces table and a time range, then Run. Sessions list newest activity first, showing the user, turn count, first prompt, and the session's time window. Expand a session to see its turns — sequence number, start time, duration, and prompt — and click Trace on a turn to open it as a span waterfall in a new Trace tab, anchored at the turn's start time.

The search field filters turns Google-style before they are grouped into sessions:

  • issue assign — every term must match, each as a whole word (has semantics): impl does not match implementation.
  • "issue assign" — a quoted phrase matches exactly, words adjacent.
  • impl*, *impl, *impl* — wildcards opt into prefix, suffix, or substring matching per term.

Matching runs over the whole interaction row, so it covers prompts, tool attributes, user emails, and anything else recorded on the turn.

Effective Query

The code icon next to Run opens a dialog with the exact KQL the tab executed, formatted and ready to copy — useful as a starting point for a custom query in an Explore tab.

On this page