How do I track how long sessions take in Claude Code?
Rius turns each Claude Code session into one trace with timing on every span, so you can see how long a session ran and which steps took the time. Install the Rius plugin, sign in, and run /rius:enable-here in the folder you want traced. Tool call durations are exact, and model call durations are approximate.
How it works
One Claude Code session is one trace, with the same session id throughout. The session is the root of the trace. Under it sit each turn (one prompt and everything it caused), each model call, each tool call and each subagent, nested under the call that started it. Every span carries timing, status and, for model calls, tokens and cost.
Timing is recorded in both content modes. A folder enabled with /rius:enable-here sends structure only, which includes the span tree and timing. /rius:enable-content-here adds prompts, replies and tool content on top. You do not need to send content to see durations.
While the session runs, its spans fill in and the trace shows as in progress. Exiting Claude Code closes the trace. If you resume a session, it continues the same trace.
How exact the numbers are depends on the span:
- Tool calls (Bash, Read, Edit and so on) have exact durations.
- Model calls have approximate durations. Claude Code’s transcript records when a reply finished but not when the request went out, so a model span can include time you spent reading or approving a permission prompt.
Set it up
-
Install the plugin, sign in and turn tracing on for a folder. In a terminal, run:
claude plugin marketplace add glassflow/rius-coding-agents && claude plugin install rius@rius-coding-agentsThen run
/rius:loginin Claude Code, pick a workspace and click Connect. In the repo you want traced, run/rius:enable-here. The plugin needs Python 3.9 or later on yourPATH. The full walkthrough is in the Claude Code plugin guide. -
Run
/rius:status. The first line should readRius tracing: on, andSpans exported this sessionshows how many spans the session has sent so far. -
Work as usual. A session that was already open when you enabled its folder is traced from its start. To measure only from now on, start a new session after enabling.
-
Open the trace list in the Rius console and find the session. It shows while it runs, as in progress.
-
Exit Claude Code when you finish. This closes the trace, so the session counts on the Agents and Users pages and has a finished length.
-
Open the trace and read the waterfall. It lays out every turn, model call, tool call and subagent in order, so you see which step took the time.
What you get
- One trace per session, so a session’s length and its internal timing sit on one page. The trace list shows it live, and the waterfall shows where the time went.
- Exact tool timing. A slow build, test run or file read stands out as its own tool span, and a failed tool call is marked as an error.
- Subagent timing. Subagents get their own spans with their own model calls and tools, nested under the call that started them.
- A live view on Agents. An open session appears as a live instance of the
claude-codeagent. Its trace, error and cost figures count the session once it has ended. - Sessions per developer. Each session lands on Users under the email the developer signed in with, so a team can find whose session it was. See Track Claude Code usage and cost across a team.
- Questions from the terminal. Run
/mcp, pickriusand sign in once, then ask Claude about your recent sessions.
Two cases leave a session without a finished length. A session that never ends cleanly, because Claude Code crashed or was killed, is never counted on Agents or Users. If you run /rius:logout while a session runs, its trace cannot close and stays in progress.
When something else fits
- If you only need an overall figure for a long period, the Agents and Users pages summarize ended sessions, but the per-step view in the trace waterfall is where you find slow steps.
- If your team also uses Codex (beta), Cursor (beta) or OpenHands, see Coding agents for how each one records sessions and what it reports.