Skip to Content
Rius

What does a session in Claude Code look like as a trace?

Rius shows a Claude Code session as one trace, with the session as the root span and the turns, model calls, tool calls and subagents nested below it. The session id stays the same throughout, and resuming a session continues the same trace. Each span carries the details for its level, such as model and tokens on a model call, or tool name and error type on a tool call. A folder enabled for structure only sends no prompts or output. A folder enabled for content adds them.

How it works

The Rius plugin turns each Claude Code session into a trace. The spans nest like this:

AGENT the session └─ CHAIN a turn: one prompt and everything it caused └─ LLM a model call: model, input and output tokens, cache reads and writes ├─ TOOL a tool call: Bash, Read, Edit, and so on └─ TOOL Agent: the call that started a subagent └─ AGENT the subagent, named by its type └─ LLM the subagent's own model calls and tools

What sits on each level:

  • The session (root). One trace per session, with the same session id throughout. With content on, the trace is named after the session: the name you gave with /rename or --name, or the title Claude Code generates from your first prompt. With structure only, the trace is named claude-code session.
  • A turn. One prompt and everything it caused. Turns that Claude Code injected itself, such as a slash command’s output or a background task’s report, are kept and marked as system turns, so you can tell them from what you typed.
  • A model call. The model name, input and output tokens, cache reads and writes, and cost. Rius prices tokens at API rates, so on a subscription plan the cost measures usage, not what you pay. A model span’s duration is approximate, because it can include time you spent reading a permission prompt.
  • A tool call. The tool name, such as Bash, Read or Edit, with errors marked on the span and the error type. For a shell call you also get the kind of command (test, build, lint, package, git or other) and its exit code. Tool durations are exact.
  • A subagent. The Agent tool call that started it, then a span for the subagent named by its type, with its own model calls, tokens and cost. In long sessions, subagents can account for more than half of all tokens, so these spans show where spend goes.

Every span also carries user.id, set to the email you signed in with, plus the folder path and git branch.

Set it up

The full walkthrough is in the Claude Code plugin guide. What decides the shape of your trace is how you enable the folder.

  1. Install the plugin in a terminal:

    claude plugin marketplace add glassflow/rius-coding-agents && claude plugin install rius@rius-coding-agents
  2. Run /rius:login, sign in in the browser, pick a workspace and click Connect.

  3. In the repo you want traced, choose how much each span carries:

    • /rius:enable-here sends structure only: the span tree, models, tokens, cost, timing, tool names and error types.
    • /rius:enable-content-here also sends prompts and replies (never the model’s thinking), tool inputs such as commands and file paths, tool outputs such as file contents and command output, and error details of failed tool calls.
  4. Run /rius:status. The first line reads Rius tracing: on.

  5. Work as usual, then open the session in the trace list and read the waterfall from the root down.

With content on, the plugin replaces the secrets it recognizes with a marker such as [redacted:aws-key] before export. This is best effort, so a secret in an unknown format is sent. Each captured value is capped at 32 KB.

Tracing starts from the beginning of a session even if you enable the folder partway through, so everything said earlier is sent too. To trace only from now on, start a new session after enabling.

What you get

  • One trace per session. The trace list shows it while the session runs, and its spans fill in as Claude Code works. The session shows as in progress until you exit Claude Code, which closes it.
  • A waterfall from prompt to step. You can go from “this session cost $12” or “this session went wrong” to the exact turn, model call or tool call. A failed tool call is marked as an error.
  • Tokens and cost on each model call, including cache reads and writes, and separately for subagents.
  • Per-developer views. The session lands on the Users page under the email you signed in with, and on the Agents page as a live instance of the claude-code agent. Those pages count a session only once it has ended. A session that never ends cleanly, because Claude Code crashed or was killed, is never counted there. To roll this out across a team, see Track Claude Code usage and cost across a team.
  • Questions answered from the terminal. The plugin brings the Rius MCP server, so after one sign-in in /mcp you can ask Claude about your recent sessions.

For the other agents Rius traces, see Coding agents.

When something else fits

  • If you want no prompts, replies or command output to leave your machine, enable folders with /rius:enable-here, or set RIUS_CAPTURE_CONTENT to false to send structure only from every folder.
  • If you are building your own agent on the Claude Agent SDK rather than tracing Claude Code sessions, the trace shape comes from your code, not from the plugin. The Coding agents page points to the right guide.

Still stuck? Get help

Last updated on