External Publication
Visit Post

Codex CLI --cd ignored when connecting to Codex app server

OpenAI Developer Community April 3, 2026
Source

Hi,

I’m trying to use the Codex CLI with a running codex app-server, and I want to start sessions in different working directories depending on how I invoke the CLI.

However, it always seems to use the working directory where the app server was started, regardless of what I pass via the CLI.

I’m starting the app server like this:

codex app-server --listen ws://127.0.0.1:3000

Then I’ve tried:

  1. Running codex --remote ws://127.0.0.1:3000 from a different directory. Codex does not use the current working directory, but instead uses the app server’s directory.

  2. Running codex --remote ws://127.0.0.1:3000 --cd /some/path. Codex ignores the --cd value and still uses the app server’s directory.

I can’t find a way to run sessions in different directories without starting multiple app servers, one per directory.

Is this expected behavior? If so, is running multiple app server instances the intended way to handle this?

Discussion in the ATmosphere

Loading comments...