How do I find the longest-running sessions in Claude Code?
Rius records each Claude Code session as one trace, so you find the longest-running sessions by their latency in the trace list, or by sorting session spans by duration on the Spans tab. Each trace row shows its latency, and you can narrow the list to Claude Code, to one developer, or to a time range. Open a long session to see in the waterfall which turn, model call, tool call or subagent took the time.
How it works
One Claude Code session is one trace, with the same session id throughout. A resumed session continues the same trace. The root of the trace is an agent span for the session, and under it sit each turn, each model call, each tool call and each subagent, all with timing and status.
That structure is what makes long sessions findable:
- Latency on every trace. The trace list shows each trace’s latency, and the strip above the list sums up the traces that match your filters, including latency percentiles.
- A named agent. Sessions appear under an agent named
claude-code(or yourRIUS_SERVICE_NAME), so you can filter the list to Claude Code alone. - An owner. The Sent by column names the owner of the key that sent the trace, so you can filter to one developer’s sessions.
- Live and finished sessions. A session shows in the list while it runs and reads as in progress until you exit Claude Code, which closes it. Its final length is known once it has ended.
When a session is long, check what the time is made of. Tool durations are exact. A model call’s duration is approximate, because Claude Code’s transcript records when a reply finished but not when the request went out, so it can include time you spent reading or approving a permission prompt.
See the Claude Code plugin page for everything a session captures.
Set it up
- Install the plugin once in a terminal:
claude plugin marketplace add glassflow/rius-coding-agents && claude plugin install rius@rius-coding-agents- Run
/rius:login, thencdinto a repo and run/rius:enable-here. Check that the first line of/rius:statusreadsRius tracing: on. Start Claude Code from inside that repo. The Claude Code plugin page has the full setup. - Work as usual and exit Claude Code when a session is done, so its trace closes.
- Open Traces in the console. The default range is 7d, so switch to 30d or a custom range to reach older sessions. Click an agent cell to filter to
claude-code, or click a Sent by cell to filter to one developer. Read the latency column to spot the long ones. - To rank sessions by length, open the Spans tab, pick Agent in the All kinds menu, and click the Duration header to sort. Subagents are Agent spans too, so the session is the Agent span at the root of its trace. Click its trace ID to open the trace.
- In the trace, read the waterfall to see which turn, model call, tool call or subagent took the time. The Map tab has a latency lens that shows the slow nodes at a glance, and clicking a node lands you on the tree filtered to its spans.
The Exploring traces page covers filters, saved searches and sorting in detail. To come back to the same view, save the filters as a saved search.
What you get
- A list of your Claude Code sessions with their latency, filterable by agent, developer and time range.
- A ranking of session spans by duration on the Spans tab.
- For any long session, the full span tree, with the duration of each turn, model call, tool call and subagent, and tokens and cost on each model call.
- Subagents with their own spans, so you can see when delegated work is what made a session long.
- With content on, a trace named after the session (your
/renameor--name, or the title Claude Code generates from your first prompt). A folder enabled with/rius:enable-herenames itclaude-code session.
When something else fits
- To find sessions by spend rather than length, read the cost column in the trace list, sort the Users page by Cost to see which developer spent the most, or ask Claude from
/mcp(after signing in torius): “Which of my Claude Code sessions in the last 24 hours cost the most, and what did the tokens go on?” - For a team rollout with one shared workspace, see Track Claude Code usage and cost across a team.
- The wider picture across Claude Code, Codex (beta), Cursor (beta) and OpenHands is on the Coding agents page.