Skip to content

Guides

Codex

Mucq runs OpenAI's Codex CLI beside Claude Code. Install it on your server, turn it on, choose it per project, and answer its first question once.

On this page

Mucq starts Codex the way it starts Claude Code: in tmux on your server, in the project's folder, with its state in words beside the project and a notification when it needs you or is done. Codex is off until you turn it on, and each project opens one agent, Claude Code or Codex.

On the server

Install Codex and sign it in on each server where you want it, as the user Mucq logs in as. OpenAI's installer for macOS and Linux is one line:

Shell
curl -fsSL https://chatgpt.com/codex/install.sh | sh

At the end the installer offers to start Codex (Start Codex now? [y/N]). Answer N: a Codex started there runs without Mucq's hooks, so its row can't tell when it needs you. Mucq starts it with them.

Then sign Codex in, with your ChatGPT account or an API key, the way OpenAI's Codex documentation describes. That sign-in is between you and OpenAI: Mucq never reads, copies or changes it.

Mucq starts Codex in tmux's shell, which is a login shell, so if codex works after a fresh login, it works in Mucq. Everything else is as in Set up a Linux server: tmux, Mucq's key and a projects folder.

Note

This page was checked with Codex CLI 0.171. A later Codex release that changes how it reports its state can make a row read Starting Codex… and then May need you, or Codex not running, until Mucq catches up.

Turn it on

In Mucq's Settings › Agents, turn on Codex. Settings belong to each device, so do it on every Mac, iPhone and iPad you'll start Codex from.

While both agents are on, New projects start with picks the agent for the projects you pin or create from then on. Projects you already have keep the agent they open. One agent always stays on, so the last switch can't be turned off.

The first time you open Mucq, the Agent menu on its first screen does the same in one step: choose Codex there, and Mucq turns it on and starts new projects with it.

Turning Codex off later moves nothing. A project that opens Codex keeps opening it, with its row and its notifications: the switches decide what Mucq offers, not what your projects run.

Choose it per project

While both agents are on, New Project and Edit Project have an Agent menu with Claude Code and Codex. New Project starts with the default and says what it will do: Creates a new project and starts Codex in it.

Codex runs in a tmux session of its own, named after the project's with +codex: webshop+codex. Switching a project from Claude Code to Codex in Edit Project ends nothing. Claude keeps running in its own session, and Edit Project says so:

Claude keeps running in “webshop” on devbox. End Session ends it.

From then on, the row, the notifications and ⇧⌘U follow the agent the project opens. Another device that doesn't know the project's agent yet opens the one it finds running for the project, and Claude when both or neither run. Choose the agent in Edit Project there to make it stick.

The first start

The first time Codex starts in a folder, it asks whether to trust that folder. The first time it starts on a server with Mucq's status hooks, it also asks whether to run them. The hooks are how Codex tells Mucq it's working, needs you or is done, so Mucq says above the terminal which answer it needs:

Codex asks whether to run Mucq's status hooks. Choose “Trust all and continue” so Mucq can tell when Codex needs you.

Choose Trust all and continue. Codex remembers it for your user on that server, so the next project there asks only about its folder. The question is Codex's, and the answer is yours: Mucq never answers it for you and never skips it.

Until you answer, the row reads Needs you. These questions come before any hook runs, so no push goes out for them: a Mac you're using tells you, but an iPhone or iPad in your pocket doesn't. Open a new Codex project once before you walk away.

Codex asks about the hooks again when they change, which a Mucq update can do. Keep Mucq at the same version on your Mac, iPhone and iPad: two versions with different hooks make Codex ask each time the other one starts it. Your own Codex hooks keep running beside Mucq's, and Codex asks about a new one of yours the same way.

If you don't trust them

Codex runs without Mucq's hooks then, and Mucq goes by Codex's window title alone. The row still says Working, Idle or Needs you, but never Done, and no push reaches your iPhone or iPad. On the Mac, the row's tooltip says how to fix it:

Codex runs without Mucq's status hooks — Restart Codex (⇧⌘R) asks to trust them again.

Permission modes

Permission mode in Settings › Codex picks how Codex starts. The modes are Codex's own, in Codex's own words:

ModeWhat Codex does
Codex's defaultNo flag: the approval and sandbox settings of Codex's own config.
Auto-reviewA reviewer answers Codex's approval requests for you (--approve-for-me).
Workspace editsCodex edits files in the project and asks before anything else (-s workspace-write -a on-request).
Never askCodex never asks; what its sandbox refuses fails (-a never).
Full access (danger!)Codex acts without asking and without a sandbox (--dangerously-bypass-approvals-and-sandbox).

The mode applies to sessions Mucq starts. A running Codex switches on Restart Codex (⇧⌘R).

Rules set for Codex on the server stay in force. Mucq sets only Codex's hooks and its window title, so a policy for approvals or the sandbox still applies. If it forbids the mode you chose, Codex ends, and the row reads Codex not running.

Inside the session, Shift-Tab (⇧tab on iPhone and iPad) cycles Codex's own Default and Plan modes, as in any terminal.

What the row says

Codex's rows use Claude's words: Idle, Working, Done and Needs you. A question Codex asks you reads Needs you, like a request for approval. A few words are Codex's own:

StateWhat it means
Starting Codex…Mucq has started Codex, and it's still loading.
May need youCodex has been starting for 20 seconds without saying what it's doing. It may be waiting for you. Mucq doesn't notify for it or paste into it: open the project and look.
Restarting Codex…Codex is restarting; the conversation continues.
Codex not runningThe session runs a shell, not Codex. Restart Codex (⇧⌘R) starts it.
Codex not installedMucq typed codex, and the server's login shell didn't find it. See below.
No statusCodex runs without Mucq's hooks, and its window title says nothing Mucq can read.

While both agents are on, a row names its agent after the state: Working · Claude, Needs you · Codex. Words that already name the agent, such as Starting Codex…, read as they are. With one agent on, the row shows the state alone. Every word is in Project states.

Codex's notifications say Codex needs you and Codex is done. On iPhone and iPad they pass Mucq's push relay like Claude's: the relay also learns that the session runs Codex, and still gets no names and no content. See Notifications.

When Codex isn't installed

When the server has no codex, the terminal shows a card:

Codex isn't installed on devbox

Mucq typed “codex” in ~/projects/webshop, but devbox's login shell didn't find it. Install Codex there, then start it from Mucq.

Copy Install Command copies OpenAI's installer, the line at the top of this page, for you to run in a shell on the server. Mucq never runs it itself. Answer N when the installer offers to start Codex. Once Codex is installed and signed in, choose Start Codex. Close hides the card until the next start. Without a terminal, the same words come with Reconnect and Copy Install Command.

Restart, end, the shell

These work as they do for Claude:

  • Restart Codex (⇧⌘R) continues the folder's last Codex conversation, or starts a new one if there is none. Mucq asks first while Codex is working.
  • End Session… ends every session of the project, Claude's, Codex's and the shell's, and names them before it does.
  • ⌘T swaps Codex for the project's shell, and back.
  • ⌘-click a path Codex printed to open it; ⇧↩ starts a new line in its prompt.
  • A photo or file you drop or paste on the Mac, or send with the paperclip on iPhone and iPad, goes to the server, and its path into Codex's prompt. Codex reads it, as Claude does: see Files and photos.

What Mucq doesn't do

  • No daemon. Mucq starts every Codex with --no-daemon, so Codex's background server never keeps running on your server because of Mucq.
  • No config files. Mucq passes its hooks in the command it types. Your ~/.codex/config.toml stays as you wrote it, and your own hooks keep running. In Mucq's sessions, Mucq's window title replaces a [tui] terminal_title of your own.
  • No screen reading. Mucq reads Codex's hook words and the beginning of its window title, never what's on the screen.
  • No trust decisions. Codex asks; you answer.
  • No sign-in. Mucq never touches Codex's credentials.
  • No theme. Codex keeps its own colours. The theme that follows Mucq's terminal palette is Claude Code's.

Mucq Pro

Mucq Pro, which comes later as a separate Mac app with its own price, runs Codex on This Mac too, and its This Mac checklist checks each agent you've turned on.