Read the session logs.
Analyze local Codex session logs. Reports and backups stay on your computer.
Codex Token Xray
Read actual session logs to inspect tool results, skill bodies, and instructions. Find what can be trimmed and review the changes first.
Analyze local Codex session logs. Reports and backups stay on your computer.
Inspect tool outputs, skill bodies, and project instructions. Totals use recorded usage; category shares are size-based estimates.
Review proposed changes and backups before trimming your own skills and instructions or removing selected unused skills.
Numbers measured from 12 real sessions, and what this skill changes and leaves alone.
These come from reading 12 real Codex sessions on one machine. Where the tokens go turned out to differ from the usual guesses.
The 33,000 tokens at start-up are out of your hands. During work, every file read in full lands in the context as is. And what pays to trim is a skill’s body, not its description.
SKILL.md, the rest moves into references files. Nothing is deleted.AGENTS.md the same way.It shows the diff and asks once before changing anything. Skills by other people and Codex’s own skills and plugins are never edited: their authors keep tuning them, and an update would overwrite the edit.
Session logs are read from ~/.codex/sessions on your machine, with no network access. Reports and backups live only under ~/.codex-token-xray. Add --project to look only at sessions started in the current folder.
Astra Xray cleans up the skill list and instructions Codex hands to GPT-6 Astra. Codex Token Xray measures where tokens actually went, for any model, and trims the heavy parts.
Python 3.9 or newer. Add -g to the install command to use it in every project.
After installing, type $codex-token-xray in Codex. Requires Python 3.9 or newer.