Skip to Content
Rius

How do I set up tracing for Claude Code?

Rius traces Claude Code through a plugin: you install it, sign in with /rius:login, and turn tracing on for a folder with /rius:enable-here. Each Claude Code session then appears in Rius as one trace with its model calls, tokens, cost and tool calls. Setup takes four commands, and /rius:status confirms the folder is traced before you open the first session in the console.

How it works

The Rius plugin for Claude Code hooks into your sessions and sends them to Rius as OpenTelemetry traces. Installing sends nothing, and tracing stays off for every folder until you enable one.

  • Sign in. /rius:login mints one API key for this machine and the workspace you choose. The key only sends traces, expires after 90 days, and is stored in ~/.claude/rius/credentials.json, readable only by you.
  • Folder rules. /rius:enable-here traces a folder and everything under it, with structure only: the span tree, models, tokens, cost, timing, tool names and error types. /rius:enable-content-here also sends prompts, replies, tool inputs and outputs, with recognized secrets redacted. Redaction is best effort.
  • Disabled folders win. /rius:disable-here stops tracing a folder, at any depth, even inside an enabled parent.
  • One session, one trace. Subagents get their own spans with their own tokens. Each developer shows on the Users page under the email they signed in with.

The full command reference is in the Claude Code plugin guide.

Set it up

You need Claude Code with plugin support and Python 3.9 or newer on your PATH. The plugin installs nothing from PyPI. It runs on macOS, Linux and Windows, where the hooks run in Git Bash. You can sign up for Rius during the sign-in step.

  1. Install the plugin. Run this in a terminal:

    claude plugin marketplace add glassflow/rius-coding-agents && claude plugin install rius@rius-coding-agents
  2. Sign in. In Claude Code, run /rius:login. Claude Code prints a link and a short code and opens console.rius-glassflow.com in your browser. Sign in or sign up, check that the page shows the same code, choose a workspace and click Connect. The link expires after 15 minutes, so run the command again if it lapses.

  3. Turn tracing on for a folder. Use cd to go into the repo you want traced, then run /rius:enable-here. Run /rius:enable-content-here instead if you want prompts and replies sent too. Only you can run these commands. Claude can’t run them for you.

  4. Check the state. Run /rius:status. The first line should read:

    Rius tracing: on

    The output also shows which rule decided it, whether content is sent, the workspace, and how many spans this session has sent.

  5. Check the first session arrives. Ask Claude Code to do something real in that repo. Open the trace list at console.rius-glassflow.com. The session’s spans appear while it runs, and the trace shows as in progress until you exit Claude Code. With structure only, the trace is named claude-code session.

  6. Optional: query your sessions. Run /mcp, pick rius and sign in with your Rius account. This is a separate sign-in from /rius:login, which only sends traces.

If /rius:status reads Rius tracing: off, the Reason line says why: run /rius:enable-here when no folder rule matches, or /rius:login when there is no key. If tracing is on but Spans exported this session stays at 0, read the Last export error line. An HTTP 401 right after signing in can last about 30 seconds while the new key spreads, so send another prompt after a short wait.

To stop, run /rius:disable-here for a folder, or /rius:logout to revoke the key and turn tracing off everywhere.

What you get

  • Each Claude Code session as one trace, laid out as a waterfall with turns, model calls, tool calls and subagents.
  • Tokens and cost per model call. Cost is a list-price estimate in US dollars, and on a subscription plan it measures usage, not what you pay.
  • A live claude-code agent on the Agents page while a session is open. Its trace, error and cost figures count a session once it ends.
  • Each developer on the Users page under their sign-in email, so a team sharing a workspace can tell whose sessions are whose.
  • The option to ask Claude about your own sessions from the terminal, for example which session cost the most.

To roll this out across a team, start from Coding agents, which compares every agent Rius traces.

When something else fits

  • If you build your own agent on the Claude Agent SDK, the plugin is not the route. Use the SDK integration instead.
  • OpenHands needs no plugin: set three environment variables, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT, OTEL_EXPORTER_OTLP_TRACES_PROTOCOL and OTEL_EXPORTER_OTLP_TRACES_HEADERS. OpenHands always sends prompts and output, unlike the plugin.
  • Codex (beta) and Cursor (beta) use the same plugin with their own commands. Cursor (beta) sessions carry no token counts or cost.

Still stuck? Get help

Last updated on