Skip to Content

How do I find the longest-running sessions in Codex (beta)?

Rius shows each Codex (beta) session as one trace, so you find the longest-running ones by reading the latency on the trace list or sorting spans by duration. Filter the list to the codex agent, set a time range, and the slowest sessions stand out. Open one to see every turn, model call, tool call and subagent on a timeline.

How it works

The Rius plugin records each Codex (beta) session as a single trace, and that trace is what you search.

  • One trace per session. Resuming a session with codex resume or codex exec resume continues the same trace, so a resumed session is one long trace, not two.
  • Latency on every row. The trace list shows time, status, root span name, agent, span count, error count, tokens, cost and latency for each trace. The strip above the list sums up the traces that match your filters, including latency percentiles.
  • An agent span at the root. The session is an agent span at the top of the span tree, with a span for each turn, model call and tool call below it. A subagent that Codex starts appears as its own agent span with its own turns and calls.
  • An agent named codex. Sessions are grouped under that agent name, so one click on an agent cell filters the list to them.
  • A closing rule. A session shows as in progress until your next Codex session on the same key closes it, so its latency is not final before then. How do I track how long sessions take in Codex (beta)? explains the rule and how to read one session’s timing.

Set it up

  1. Install the plugin, trust the hooks and sign in. Installing sends nothing, and tracing stays off until you enable a folder. Then trust the five rius hooks in /hooks and sign in with $rius:rius-login. The full steps are in the Codex (beta) guide.
codex plugin marketplace add glassflow/rius-coding-agents codex plugin add rius@rius-coding-agents
  1. Enable the repo. Run $rius:rius-enable-here in the folder, then $rius:rius-status. If a session does not show up later, check the Hooks: line there first.
  2. Open Traces and set the range. Pick 7d, 30d or a custom range, so the long sessions fall inside the window.
  3. Filter to Codex (beta). Click a codex cell in the Agent column, or use Add filter. Filters combine with AND, and the URL keeps them, so you can copy the link.
  4. Read the latency column. Scan the Latency column for the largest values. The strip above the list shows latency percentiles for the whole filtered set.
  5. Or use the Spans tab for sorting. Open Spans, choose Agent in the All kinds menu, and click the Duration header to sort. Subagents are also agent spans, so click a trace ID to open the full trace and confirm you are looking at a whole session.
  6. Find your own sessions. From plugin 0.6.2, each span carries your sign-in email as user.id. The Sent by column names the owner of the key that sent each trace, and clicking it filters to one developer. For team-wide views, see Track Claude Code usage and cost across a team, which uses the same plugin.
  7. Open the slow session. The waterfall lists each turn, model call, tool call and subagent in order. Use the Map tab with the latency lens to see where the time went, or see how to read a Codex session’s timing step by step.

What you get

  • A list of Codex (beta) sessions ordered by what you care about, with latency, tokens, cost and error count on each row.
  • A way to go from a long session to the exact step behind it: a slow model call, a long-running command or a subagent that ran for a while.
  • Sessions with a failed step badged recovered, so you can tell a long session that hit errors from one that was only slow.
  • Context growth for a trace with several model calls, plotted as input tokens per call, which shows where a prompt kept growing.
  • Cost per session, worked out from token counts at API rates. It is not what you pay on a ChatGPT plan.

The Coding agents guide covers the other agents that send sessions to the same workspace.

When something else fits

  • If you want to rank sessions by tokens, ask Codex in plain language after running codex mcp login rius, for example “Which of my Codex sessions this week used the most tokens?”.
  • Sessions started with codex exec --ephemeral are not traced, so they never appear in the list.

Still stuck? Get help

Last updated on