Two Ways Claude Code Calls Codex: One-Shot Subprocess vs. Persistent App Server
This article details two distinct architectural approaches for integrating Codex capabilities into Claude Code. The first method, 'codex exec,' is designed for single, discrete tasks where a clear input and output are defined, and no persistent state is required. It involves spawning a one-shot subprocess that executes a command, returns a result, and then exits. The second method, 'codex app-server,' utilizes a persistent runtime that communicates via JSON-RPC, allowing for stateful interactions, ongoing collaboration, and the ability to manage threads, context, and interruptions across multiple turns. The author emphasizes that understanding this distinction is crucial for selecting the appropriate architecture to avoid over-engineering simple tasks or misapplying stateless calls to complex, state-dependent workflows. The article also highlights the importance of accurate version tracking for installed plugins and marketplace sources, noting potential discrepancies between the cached snapshot and the actively running version. AI
IMPACT Clarifies integration patterns for LLM tooling, impacting how developers build with AI assistants.