How do I find how much of each prompt came from cache in Codex (beta)?
Rius records the cached tokens on the span for each Codex (beta) model call, so you find the figure by opening that call. List the calls on the Spans tab with the LLM kind filter, open one, and read its attributes in the Raw tab. Each Codex session is one trace under an agent named codex, so the trace list narrows to your sessions quickly.
How it works
The Rius plugin turns each Codex (beta) session into one trace. Inside it, each model call is its own span that records the model and its input, cached, output and reasoning tokens. Tokens and cost are part of the default structure-only capture, so you do not need to send prompts to see cache figures.
The pieces that make these calls easy to find:
- Agent name. Sessions appear as an agent named
codex. Clicking an agent cell in the trace list filters the list to it. - Sender and user. The Sent by column shows whose key sent each session. From plugin 0.6.2, the User column shows the email you signed in with. Sessions sent with a key stored by
use-keycarry no user and land in the anonymous row. - Span kind. On the Spans tab, the All kinds menu filters to LLM spans, which are the model calls.
- Resumed sessions. Resuming with
codex resumeorcodex exec resumecontinues the same trace.
Cost is worked out from token counts at API rates, so it is an estimate and not what you pay on a ChatGPT plan. OpenAI does not report cache-write tokens, so Rius shows cache reads only.
Set it up
- Install the plugin, trust its hooks and enable the folder. Run the install commands below, trust the five
riushooks in/hooks, sign in with$rius:rius-login, then run$rius:rius-enable-herein your repo. Codex (beta) covers each step in full.
codex plugin marketplace add glassflow/rius-coding-agents
codex plugin add rius@rius-coding-agents- Check that the session is traced. Run
$rius:rius-status. If theHooks:line counts fewer than five approved hooks, or theReasonline says no path rule matches, nothing is traced for that session. - Work in Codex as usual. A session stays in progress until you start your next Codex session after the old one has exited and been idle for about an hour. You can still open it while it runs.
- Find your sessions. Open Traces in the console at
console.rius-glassflow.com. Clickcodexin the agent column, or click your email in the User column or your name in Sent by. The default window is 7d, and you can switch to 15m, 1h, 1d, 30d or a custom range. - List the model calls. Open the Spans tab and choose the LLM kind in the All kinds menu. To stay inside one session, paste its session ID in the search box. The same view is available from the Session link in a trace’s header. Click the Tokens header to sort.
- Read the cached tokens. Open a model call and select its Raw tab, which shows the span exactly as ingested. Find the cached-token attribute next to the input and output tokens. Each attribute has a menu with Filter traces by this, so you can list other calls that carry the same value. The Model section of the span shows the model, input and output tokens and cost.
- Ask Codex instead. Run
codex mcp login riusonce, then ask in plain language about your recent sessions, for example which ones used the most tokens. The Coding agents guides cover the other agents the plugin supports.
What you get
- A trace per Codex session, found by agent, user or sender in the trace list.
- One span per model call, with input, cached, output and reasoning tokens recorded, so you can compare how much of each prompt was served from cache.
- A sortable list of every model call on the Spans tab, narrowed to one session by its ID.
- A cost estimate per call. It is based on token counts at API rates, and Rius shows a blank cost, not zero, for a call that reported no usage.
- Filters from the Raw tab, so one cached-token value leads you to every call that has it.
For several developers on one workspace, see Track Claude Code usage and cost across a team. It describes the same Users, Sent by and Agents views, and the same plugin also traces Codex (beta). For the full list of trace list filters, saved searches and span views, see Exploring traces.
When something else fits
- Cursor (beta) traces carry no token counts, so there is no cache figure to find there.
- If you need the exact amount billed on your ChatGPT plan, use your OpenAI account. Rius costs are list-price estimates.