OpenAI Rewrites Codex CLI from TypeScript to Rust, Sparking Debate Over "Rewritten in Rust" Trend

BigGo Editorial Team
OpenAI Rewrites Codex CLI from TypeScript to Rust, Sparking Debate Over "Rewritten in Rust" Trend

OpenAI has announced a major rewrite of their Codex CLI tool, transitioning from TypeScript to Rust. This move has ignited a heated discussion in the developer community about the ongoing trend of rewriting software tools in systems programming languages, particularly Rust and Go.

The Codex CLI is an agentic harness that calls AI models in a loop to assist with coding tasks. Originally built with TypeScript and React-based ink for the terminal interface, OpenAI decided to rebuild the core functionality in Rust to address several technical challenges.

Technical Architecture:

  • Original: TypeScript with React-based ink for terminal UI
  • New: Rust core with wire protocol for multi-language extensions
  • Supported extensions: TypeScript, JavaScript, Python, MCPs
  • Distribution: Native binary compilation

The Push for Native Performance

OpenAI cited four main reasons for the rewrite: eliminating the Node.js dependency requirement, implementing native security bindings, optimizing performance through reduced memory consumption, and creating an extensible protocol for multi-language support. The company already shipped Rust components for Linux sandboxing, making this transition a natural evolution rather than a complete departure.

The performance gains, while potentially minimal for a tool that primarily makes API calls, address real user pain points. Startup delays that plagued the Node.js version have been eliminated, and the memory footprint has been significantly reduced by removing the need for a JavaScript runtime environment.

Key Benefits of Rust Rewrite:

  • Zero-dependency install (eliminates Node.js v22+ requirement)
  • Native security bindings for Linux sandboxing
  • Optimized performance with no garbage collection
  • Extensible wire protocol supporting multiple languages
  • Lower memory consumption
  • Faster startup times (~0ms vs >100ms)

Community Reactions Split on Necessity

The announcement has divided the developer community. Critics argue this represents an unnecessary Rewritten in Rust (RIIR) trend, questioning whether the performance benefits justify the development effort for a tool that spends most of its time waiting for remote API responses. They point out that Node.js already offers single executable application packaging that could have solved the dependency issue without a complete rewrite.

However, supporters highlight the practical benefits beyond raw performance. The elimination of startup delays, simplified distribution through native binaries, and reduced system resource usage create a noticeably better user experience. One commenter noted how CLI tools written in interpreted languages can suffer from significant startup delays that native compilation eliminates entirely.

The Broader Industry Pattern

This rewrite reflects a larger industry shift toward systems programming languages. The discussion reveals a cyclical pattern in technology choices, with the pendulum swinging from interpreted languages back toward compiled, native solutions. Developers are increasingly prioritizing deployment simplicity and resource efficiency over development speed.

The trend extends beyond individual tools to entire ecosystems. Companies are evaluating whether the convenience of interpreted languages justifies the overhead when alternatives like Rust offer comparable development experiences with superior runtime characteristics.

Looking Forward

OpenAI plans to maintain both versions during the transition period, continuing bug fixes for the TypeScript implementation while bringing the Rust version to feature parity. The company is also expanding their team to work on Rust development and new agentic coding capabilities.

This rewrite represents more than a technical decision—it signals a broader industry recognition that the trade-offs between development convenience and runtime efficiency have shifted. As deployment and operational costs become increasingly important, the appeal of native, resource-efficient tools continues to grow, even for applications that aren't traditionally performance-critical.

Reference: Codex CLI is Going Native #1174