Codex spawn fix: bypass posix_spawnp's PATH search, exec yourself first on Linux

charliermarsh · x · 2026-11-25

charliermarsh details the Codex spawn optimization: the bug is in posixspawnp, which also searches PATH for the executable, so on macOS they call posixspawn directly. On Linux, since some setup isn't supported by posixspawn, they use it to spawn themselves, do the setup in the new process, then exec the command — counterintuitively adding an extra exec to make spawning faster.

Related event: Codex Cuts Process Startup Time 800x by Replacing fork+exec with posix_spawn(7 posts)→

Original post →

More from coding & agent

coding & agent channel →