Codex CLI cannot use shell

Resolved 💬 2 comments Opened Dec 12, 2025 by shinmohuang Closed Mar 29, 2026

What version of Codex is running?

v0.71.0

What subscription do you have?

Plus

Which model were you using?

gpt-5-codex medium

What platform is your computer?

Linux 6.8.0-71-generic x86_64 x86_64

What issue are you seeing?

When using Codex CLI on a remote Linux server, any shell-related tool calls succeed with exit code 0 but return no stdout/stderr in the Codex UI. This makes it impossible for the agent to inspect the filesystem or run any scripts.

The behavior from the agent’s perspective looks like this (summarized from the Codex “reasoning” trace):

ls
→ exit code 0, but no visible output

pwd
→ exit code 0, but no visible output

printf 'test'
→ exit code 0, but no visible output

python - <<'PY' ... print('cwd', os.getcwd())
→ exit code 0, but no visible output

Codex then concludes that it “cannot proceed because shell output is blank” and asks me to re-run commands manually or provide file contents. From outside Codex (in a normal shell on the same machine), all of these commands work and print correctly.

The issue appears to be specific to newer Codex CLI versions. After downgrading, the exact same environment works:

codex-cli 0.71.0 → shell tools have no output

codex-cli 0.65.0 → same behavior (no output)

codex-cli 0.56.0 → shell tools work normally, stdout/stderr appear in the Codex UI

So this looks like a regression somewhere between 0.56.x and later releases, likely in the unified exec / sandboxed shell execution path.

There are no obvious error messages in the UI — tool calls are reported as “success” but with empty captured output.

<img width="432" height="278" alt="Image" src="https://github.com/user-attachments/assets/66d5d92d-4ceb-432a-b8a8-829d8059a236" />

<img width="1893" height="98" alt="Image" src="https://github.com/user-attachments/assets/00d1df58-dd0f-43d8-a64c-4226e5bfdf4f" />

What steps can reproduce the bug?

In a fresh workspace, ask Codex to run simple shell commands, e.g.:

“Run ls in the current directory.”

“Run pwd.”

“Run printf 'test\n'.”

“Run a small Python script that prints the current working directory.”

What is the expected behavior?

_No response_

Additional information

using zsh

View original on GitHub ↗

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