> slash commands & shortcuts
Inside a session, slash commands typed in the composer control Codex — switching models, managing context, reviewing diffs — and keyboard shortcuts drive the TUI itself. This section covers the commands you reach for daily plus the key bindings for interrupting, editing, and searching. Type / to see the full menu; most changes (like /model) apply to the current session only unless you persist them in config.toml.
// slash commands & shortcuts
7 commands// faq
How do I switch the model without restarting?
Type /model in the composer to pick a different model and reasoning effort mid-conversation. /status shows the current model, token usage, sandbox, and approval mode. To make a model the default, set model = in config.toml instead.
My chat is getting long and slow — what do I do?
/compact summarizes the conversation to reclaim context window while keeping the thread going; /new starts a fresh chat in the same session; /clear wipes it entirely. /compact is lossy, so early details can be dropped — prefer it over /clear when you still want to continue.
How do I stop Codex mid-task or fix my last message?
Press Esc once to interrupt and take back the prompt without ending the session. Press Esc twice on an empty composer to edit your previous message and fork the conversation from that point. If you have typed a draft, the first Esc clears it instead.
How do I reference a file or run a shell command in the TUI?
Type @ to fuzzy-search files and insert a path into your prompt, or /mention to attach one. Start a line with ! to run a shell command yourself — it runs in your real shell, outside the agent's sandbox, which is handy for git status between turns.