Skip to content
86% off$349 $48.86code BF2026

Guides

Codex CLI Windows error: non-elevated terminal, --no-daemon

Codex CLI on Windows says to start the daemon from a non-elevated terminal, or fails with Access is denied (os error 5)? Use --no-daemon or pin 0.156.1.

TroubleshootingUpdated 5 min read

On this page

You ran codex on Windows and got this:

text
Error: start the Windows daemon from a non-elevated terminal; shared clients must not inherit administrator privileges

Or you got Access is denied (os error 5), or codex --version crashed with a fatal hardware-capability error. This page covers all three. We don't make Codex and haven't reproduced these errors. Everything below comes from user reports on the Codex GitHub issue tracker (last seen October 2026), so treat the fixes as reported workarounds, not official guidance.

Why it happens

The reports point to three separate problems, most common first:

  1. Elevated terminal. Version 0.157.0 refuses to start from an administrator terminal. The error text says shared clients must not inherit administrator privileges. A plausible reading is that a background process started with admin rights could be shared with clients that don't have them. That is our interpretation, not something the reports state.
  2. Access denied. Version 0.160.1 fails with Access is denied (os error 5). That is Windows' generic access-denied code. The reports don't say which file, pipe or process was denied, so the cause is unknown.
  3. Hardware-capability crash. Version 0.161.0 crashed on codex --version with a fatal hardware-capability error. The report came from a machine with a Ryzen 5 8400F. No cause or official fix was given.
SymptomVersion in the reportTry first
"start the Windows daemon from a non-elevated terminal"0.157.0Fix 1, then Fix 2
Access is denied (os error 5)0.160.1Fix 2, then Fix 3
Crash on codex --version, hardware-capability error0.161.0Fix 3

Users list two workarounds overall: --no-daemon and a downgrade to 0.156.1. We couldn't confirm which one fixed each error, so the order above is our suggestion, easiest first.

Step-by-step fixes

First check which version you have:

powershell
codex --version

If this command itself crashes, skip to Fix 3.

Fix 1: Start Codex from a non-elevated terminal

  1. Close the terminal window where you ran codex.
  2. Open a new terminal from the Start menu with a normal click, not Run as administrator.
  3. Change to your project folder and run codex again.

Not sure whether a window is elevated? Run this in PowerShell. It prints True in an elevated session and False in a normal one. It only reads your session and changes nothing.

powershell
([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)

If it prints True in a window you opened normally, check whether your terminal profile or shortcut is set to run as administrator. Windows Terminal profiles and pinned shortcuts can carry that setting. So can an editor that was itself started as admin, if you launch the terminal from inside it.

Fix 2: Run Codex with --no-daemon

Use this when you need an elevated terminal, or when you see Access is denied (os error 5):

powershell
codex --no-daemon

As the flag's name suggests, it starts Codex without the Windows daemon. It is the workaround users reported. To go back to normal, leave the flag off. If you want it every time, create a PowerShell function or alias yourself. We don't know of an official setting for that, so we don't suggest one.

Fix 3: Pin Codex to 0.156.1

Use this when the latest release fails even with --no-daemon, or when Codex crashes before it prints anything. Version 0.156.1 is the one users reported going back to.

powershell
npm install -g @openai/codex@0.156.1
codex --version

The first line installs that exact version globally with npm. The second should print 0.156.1.

To undo the pin and return to the newest release:

powershell
npm install -g @openai/codex@latest

The hardware-capability crash

If codex --version ends in a fatal hardware-capability error, the reported workaround is the downgrade in Fix 3. We couldn't confirm that --no-daemon helps, because the program crashes on a command that shouldn't need the daemon at all. If you hit the same crash on a different CPU, add your CPU model and Windows version to the existing GitHub issue. Hardware details are what maintainers need to narrow it down.

Checklist before you try again

  • You opened a normal terminal, not Run as administrator.
  • codex --version prints a version, or you know it crashes.
  • You tried codex --no-daemon once from a fresh window.
  • If you pinned 0.156.1, codex --version really shows 0.156.1. A second Codex install earlier on your PATH can shadow the new one.

If nothing works

Search the openai/codex issue tracker on GitHub for your exact error text, and comment on an existing issue instead of opening a duplicate. Include:

  • The exact error text, copied from the terminal.
  • The output of codex --version, or a note that it crashes.
  • Your Windows version and terminal (Windows Terminal, PowerShell, cmd).
  • Whether the terminal was elevated, and what --no-daemon changed.
  • Your CPU model, if the error mentions hardware capability.

A message you can adapt:

text
Codex CLI on Windows fails at startup.

Version: 0.xxx.x (or: crashes on --version)
Windows: 11, build xxxxx
Terminal: Windows Terminal / PowerShell, elevated: yes/no
CPU: your CPU model
Error: paste the exact error text here

Tried: normal terminal, codex --no-daemon, npm install -g @openai/codex@0.156.1
Result: describe what changed, if anything

Common questions

Is --no-daemon safe to use?

It is the workaround users reported, and it only changes how that run starts. We haven't seen a report of it causing other problems, but we haven't tested it either.

Does the pinned version keep updating?

No. A pinned npm install stays on 0.156.1 until you install something else. Run npm install -g @openai/codex@latest when you want to try the newest release again.

Why does the error mention "shared clients"?

The message doesn't explain it, and the reports don't either. We read it as a safeguard against elevated rights being passed on to other Codex clients, but that is a guess.

Does any of this apply on a Mac?

The reports are all about Windows, so these errors aren't known to occur on macOS.

Every app.
One purchase.