A detailed empirical investigation into what OpenAI's Codex CLI actually sends to the model on each request. Starting from a 16-character prompt that ballooned to 42,980 bytes, the author intercepted HTTP requests using a local recorder and measured how token counts grew as Codex loaded system instructions, tool definitions, AGENTS.md project instructions, skill metadata, file contents, command output, images, and MCP tool descriptions. Key findings: the user prompt accounts for only 0.3% of the initial request; tool definitions and base instructions dominate; file contents and terminal output accumulate in history without deduplication; images are transmitted as base64 data URLs; MCP tool descriptions are deferred until discovery; and compaction replaces accumulated history with a model-generated summary, shrinking subsequent requests significantly.

9m read timeFrom 0xkato.xyz
Post cover image
Table of contents
How I recorded the requestsThe first requestProject instructionsSkills loaded in two stagesMCP tool descriptions were deferredA coding task, request by requestFiles entered after they were readTerminal output stayed in the historyImages crossed as data URLsCompaction sent the history through another requestWhat crossed the machine boundaryWhat this experiment did not measure
2 Impressions