How do I track how long sessions take in Codex (beta)?
Rius records timing on every span of a Codex (beta) session, so the trace shows how long the session ran and how long each turn, model call and tool call took. Install the Rius plugin, trust its hooks, sign in and enable tracing for a folder. Each session then appears as one trace in the console. The trace ends at the last thing the session did, not at the moment you exit Codex.
How it works
The plugin turns each Codex (beta) session into one trace. The trace is a tree of spans: the session at the root, a span for each turn (one prompt and everything it caused), a span for each model call, a span for each tool call, and nested spans for any subagents.
Timing is part of the default, structure-only capture, so you get durations without sending prompts or replies. Folders enabled with content add prompts, replies and tool output on top, with recognized secrets removed.
Two details shape how you read a session’s length:
- The end of a session. Codex does not tell plugins when a session ends. A trace is closed by the next session you start on the same key, once the old session’s process has exited and it has been idle for about an hour. The trace then ends at the last thing the session did, so idle time at the end does not count. Until it closes, the trace shows as in progress.
- Model-call start times. They are approximate, so treat small differences between neighboring model calls with care.
Resuming a session with codex resume or codex exec resume continues the same trace. Sessions run with codex exec --ephemeral are not traced, because Codex keeps no record of them for the plugin to read.
Set it up
-
Install the plugin. Support for Codex (beta) needs plugin 0.6.0 or later, Python 3.9 or later on your
PATH, and macOS or Linux. Installing sends nothing.codex plugin marketplace add glassflow/rius-coding-agents codex plugin add rius@rius-coding-agents -
Trust the hooks. In Codex, open
/hooksand trust the fiveriushooks. Until you do, nothing is traced and Codex does not tell you. -
Sign in and turn tracing on. Type
$rius:rius-login, then run$rius:rius-enable-herein your repo. Structure-only tracing already includes timing. If a session does not show up, check theHooks:andReasonlines of$rius:rius-status. -
Work as usual, then open the session’s trace in the console at
console.rius-glassflow.com.
The Codex (beta) guide covers sign-in, folder rules, the optional API key, settings and troubleshooting in full.
What you get
- A trace per session. Open it in the trace list to see the waterfall of turns, model calls, tool calls and subagents with their timing, so you can see which step took the time.
- A live and a finished view. An open session shows as in progress and as a live instance of an agent named
codexon the Agents page. The agent’s trace, error and cost figures count a session once its trace is closed. - Sessions under your name. From plugin 0.6.2, each span carries your sign-in email as
user.id, so your sessions appear on the Users page. Sessions sent with a key stored byuse-keycarry no user and land in the anonymous row. - Tokens and cost next to duration. Each model call carries its tokens and cost, so you can see whether a long session was also an expensive one. Cost is worked out from token counts at API rates, so on a ChatGPT plan it measures usage, not what you pay.
What Codex does not report: an exit time. The end of a trace is the last recorded activity, and a failed tool call is marked as an error only when a command exits non-zero or an MCP tool fails. OpenAI does not report cache-write tokens either, so none are shown.
When something else fits
- To rank sessions by length across a time range rather than read one, see How do I find the longest-running sessions in Codex (beta)?.
- If you need the exact moment a session was closed, Codex does not provide it, so the trace’s last recorded activity is the best end time Rius has.
- To compare how different coding agents behave, or to roll tracing out across a team, see Coding agents and Track Claude Code usage and cost across a team.