Command reference ยท Codex CLI
/local
Runs the chat in your local workspace.
/local sets a Codex chat to run in your local workspace instead of the cloud; the slash command reference describes it briefly as "Run the chat in your local workspace". Its counterpart is cloud execution, or selecting a specific environment.
Important for context: the doc on Codex environments explicitly describes this selection as a feature of the ChatGPT desktop app โ you make it there when starting a new chat. Local and Worktree chats both run on your own machine with direct file access; only Cloud runs remotely in a container.
The standalone terminal CLI reference, on the other hand, doesn't list /local โ the terminal CLI is fundamentally local anyway, with no dedicated switch command of its own.
โ WHEN TO USE IT?
Keep direct file access
You want to work with full access to your local files, so you stay local instead of moving the chat to the cloud.
Fast iteration without cloud latency
For a quick bugfix you want to test right away, you stay in the local workspace.
โ WHEN NOT TO?
The task should run independent of the machine
Local execution ties the work to your machine; for remote execution you need a cloud environment.
Better: Switch to a configured cloud environment.
Expecting the command in the terminal CLI
According to the doc, the Local/Worktree/Cloud selection is made via the ChatGPT desktop app; the terminal CLI doesn't list /local.
Better: In the terminal, simply start codex in the desired directory โ that's inherently local.
SOURCES
- Codex CLI docs: Slash Commands โ learn.chatgpt.com
MORE COMMANDS ยท Codex CLI