Codex tool execution fails because `codex-code-mode-host` is missing

Resolved 💬 5 comments Opened Jul 9, 2026 by jcostantini Closed Jul 9, 2026

Summary

On macOS with zsh, Codex launches and accepts prompts, but every command, filesystem, GitHub, and documentation tool fails before execution with:

failed to spawn code-mode host /Users/<username>/.local/bin/codex-code-mode-host:
No such file or directory (os error 2)

This problem persisted after installing or reinstalling Codex through:

  • npm using @openai/codex@latest
  • Homebrew
  • The Codex standalone installation

Both the npm and Homebrew installations were tested. The diagnostic snapshot below reflects the system's current state after those attempts; it should not be interpreted as evidence that npm was never installed or tested.

Impact

Codex can converse, but it cannot:

  • Run shell commands
  • Read or write files
  • Inspect repositories
  • Use GitHub integrations
  • Access documentation through tools
  • Diagnose or repair its own installation

The failure occurs before the requested command reaches the shell. It reproduces on every tool-backed operation.

Current version

codex-cli 0.144.0

Installations and troubleshooting attempted

The following have been attempted without resolving the failure:

  • Uninstalled the global npm package
  • Verified the npm cache
  • Installed @openai/codex@latest
  • Refreshed the zsh command cache
  • Installed Codex through Homebrew
  • Tested both npm and Homebrew installations
  • Tested the Codex standalone installation
  • Confirmed that ~/.local/bin/codex-code-mode-host does not exist
  • Repeatedly retried command and filesystem operations

All tested installation paths produced the missing codex-code-mode-host failure.

Steps to reproduce

  1. Launch Codex on the affected system.
  2. Ask Codex to perform any tool-backed operation, such as:
List the files in the current directory.
  1. The operation fails immediately:
failed to spawn code-mode host /Users/<username>/.local/bin/codex-code-mode-host:
No such file or directory (os error 2)

The requested shell command is never executed.

Expected behavior

A supported Codex installation should provide every executable required for tool-backed operations.

If codex-code-mode-host is supplied by a separate component, Codex should:

  1. Detect its absence during installation or startup.
  2. Explain which component is missing.
  3. Provide a supported repair or installation command.
  4. Avoid starting a session whose tools cannot function.

Actual behavior

Codex starts normally but attempts to spawn this absolute path for every tool call:

/Users/<username>/.local/bin/codex-code-mode-host

That file does not exist.

Because the path is absolute, changing PATH alone cannot resolve the problem.

Diagnostics

codex --version

codex-cli 0.144.0

which -a codex

/Users/<username>/.local/bin/codex
/opt/homebrew/bin/codex

Current global npm state

/opt/homebrew/lib
└── (empty)

The npm package had previously been installed and tested. This output represents the state when diagnostics were collected after multiple installation attempts.

npm config get prefix

/opt/homebrew

Relevant contents of ~/.local/bin

lrwxr-xr-x codex -> /Users/<username>/.codex/packages/standalone/current/bin/codex

There is no codex-code-mode-host entry in that directory.

Executable resolution

The current first-resolved executable is:

/Users/<username>/.local/bin/codex

It resolves to:

/Users/<username>/.codex/packages/standalone/current/bin/codex

Another Codex executable exists at:

/opt/homebrew/bin/codex

Both npm and Homebrew installation paths were tested, and the missing-host problem persisted.

PATH

The relevant beginning of PATH is:

/Users/<username>/.local/bin:/opt/homebrew/bin:/opt/homebrew/sbin

Both executable locations are available through PATH.

Additional evidence

Codex was asked to run the diagnostic commands itself. It could not run even the first command because the tool runtime failed before spawning the shell:

failed to spawn code-mode host /Users/<username>/.local/bin/codex-code-mode-host:
No such file or directory (os error 2)

Codex was also asked to read and create diagnostic files. Those operations failed at the identical spawn step.

Suspected failure area

The available evidence does not establish whether the underlying cause is:

  • A missing file in one or more installation packages
  • An installer or updater failing to provision the helper
  • Incorrect absolute-path resolution
  • A missing prerequisite belonging to another Codex component
  • Stale installation state shared across distribution methods

The important observed fact is that reinstalling through npm and Homebrew did not provide or correctly resolve the required helper.

Questions for maintainers

  1. Which supported package or installer is responsible for provisioning codex-code-mode-host?
  2. Should that helper be included with npm, Homebrew, or standalone distributions?
  3. Why is the helper resolved specifically as ~/.local/bin/codex-code-mode-host?
  4. Is there a supported repair command that reinstalls only the missing runtime components?
  5. Is there configuration outside the CLI installation that can force this helper path?
  6. Can Codex validate the helper during startup and display an actionable error?
  7. Is there a supported fallback tool runner when the code-mode host is unavailable?

Requested resolution

Please provide:

  • The supported method for restoring codex-code-mode-host
  • Any configuration that must be removed or regenerated
  • Confirmation of which Codex distribution owns this helper
  • A fix preventing installations from launching with a completely nonfunctional tool runtime

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗