OpenAI Engineer Reveals Internal Workings of Codex CLI Agent in Technical Breakdown

Jan 28, 2026
Ars Technica
Article image for OpenAI Engineer Reveals Internal Workings of Codex CLI Agent in Technical Breakdown

Summary

OpenAI engineer Michael Bolin exposes the inner mechanics of Codex CLI, revealing how the AI coding agent uses an 'agentic loop' to orchestrate user interactions while struggling with quadratic prompt growth and performance bottlenecks from its stateless design.

Key Points

  • OpenAI engineer Michael Bolin publishes detailed technical breakdown of how the company's Codex CLI coding agent works internally, revealing the 'agentic loop' that orchestrates interactions between users, AI models, and software tools
  • Codex constructs prompts from multiple components including system instructions, available tools, and conversation history, with each request being fully stateless and sending complete conversation history rather than referencing stored state
  • The system faces engineering challenges including quadratic prompt growth over conversations, performance issues from cache misses, and automatic conversation compaction when token counts exceed context window thresholds

Tags

Read Original Article