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_
8 Comments
The CLI does support plan mode. Just use the
/planslash command to toggle.I meant in headless mode, ie the CLI doesn't have a parameter to be prompted in plan mode (updated the description)
There seem to be a comment indicating interest to support this: https://github.com/openai/codex/blob/745c48b0881561403ff30f418f698b53306a217f/codex-rs/core/src/codex.rs#L449-L450
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
Also very interested about getting this !
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 --plancodex --plan "investigate this repo and propose a fix"Possibly also:
codex exec --plan "..."Why this matters:
/planonly works after the session starts/planshims are brittle and less discoverable than a real flag--permission-mode planI would treat this as distinct from "Plan mode exists" and closer to "Plan mode is not addressable as a first-class CLI startup mode".
Still looking for this. This should be possible via SDK. I'd be happy to do PR to add it in.
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.