Support Plan mode in the CLI and TS SDK

Resolved 💬 8 comments Opened Mar 3, 2026 by gsabran Closed May 7, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What variant of Codex are you using?

CLI, ts SDK

What feature would you like to see?

The CLI (and the TS SDK that uses the CLI) don't support plan mode. It would be great if they did!

Additional information

_No response_

View original on GitHub ↗

8 Comments

etraut-openai contributor · 4 months ago

The CLI does support plan mode. Just use the /plan slash command to toggle.

gsabran · 4 months ago

I meant in headless mode, ie the CLI doesn't have a parameter to be prompted in plan mode (updated the description)

gsabran · 4 months ago
gsabran · 4 months ago

I made a PR, I don't think I can open it as I'm not a collaborator to this repo:

https://github.com/openai/codex/compare/main...gsabran:gui/plan-exec?expand=1

g-imhoff · 4 months ago

Also very interested about getting this !

0xble · 3 months ago

Strong +1 on this.

The missing piece is not interactive /plan, it is a first-class startup parameter for Plan mode.

What would be most ergonomic is something like:

  • codex --plan
  • codex --plan "investigate this repo and propose a fix"

Possibly also:

  • codex exec --plan "..."

Why this matters:

  • /plan only works after the session starts
  • wrappers and orchestrators cannot express startup intent cleanly
  • prompt-level /plan shims are brittle and less discoverable than a real flag
  • this matches precedent from Claude, which exposes startup plan mode via --permission-mode plan

I would treat this as distinct from "Plan mode exists" and closer to "Plan mode is not addressable as a first-class CLI startup mode".

bluerssen · 2 months ago

Still looking for this. This should be possible via SDK. I'd be happy to do PR to add it in.

etraut-openai contributor · 2 months ago

The SDK is intended for non-interactive automation use cases. Plan mode is an interactive feature, so it's not something that's exposed in codex exec (upon which the SDK is built).

If you'd like to use plan mode in a custom client, I recommend building your client on the app server API.