Starting an interactive Codex session makes short feedback loops possible when planning changes, generating code, and iterating on fixes in the same terminal. Keeping the conversation and the working directory together reduces context switching during multi-step work.
Running Codex without a subcommand opens an interactive text UI that accepts prompts and presents a structured response, including suggested commands and edits when appropriate. The session keeps conversational context until it is closed, so later prompts can reference earlier decisions and outputs.
Interactive sessions can apply changes across multiple files, so frequent review of diffs and command summaries helps prevent unintended edits. Exiting cleanly ends the session and returns to the shell, which is especially important when working in shared repositories or production-adjacent environments.
Related: How to run Codex exec with a prompt
Related: How to resume the last Codex session
Steps to start a Codex interactive session:
- Change to the working directory the session should use.
$ cd ~/projects/example-app $ pwd /home/user/projects/example-app
- Launch the interactive CLI from the directory to work in.
$ codex Welcome to Codex CLI Type /exit to quit
The welcome banner confirms interactive mode, and /exit closes the session at any time.
- Enter a prompt in the session input.
> Summarize the goal for the next change and list the files that might be involved.
Approving a proposed command or edit can modify files in the current directory, so review paths and diffs before confirming changes.
- Review any changes applied during the session.
$ git diff --stat README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
- Exit the session to return to the shell.
/exit
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
