TLDR Dev · ARTICLES & TUTORIALS
UNROLLING THE CODEX AGENT LOOP
Summary from the TLDR Dev newsletter
OpenAI's Codex CLI is a cross-platform local software agent. The core agent loop orchestrates interactions between the user, the model, and various tools, iteratively building prompts from user input, system instructions, and tool definitions, querying the model, executing requested tool calls, and appending results to the prompt. To manage performance and context window limitations, Codex uses prompt caching and conversation compaction to summarize past interactions.