Skip to content

Documentation / Codex

On this page

Codex

Natamux starts Codex with hooks for that session only.

Install Codex and log in. Follow the Codex project page. Check that codex runs in your terminal.

If you are not logged in, the task waits and asks you to sign in in its terminal. See The agent asks me to sign in.

Program codex
Command line codex --dangerously-bypass-hook-trust --sandbox workspace-write --ask-for-approval never -c sandbox_workspace_write.network_access=true -c 'projects={…}' -c 'hooks.<Event>=[…]' --no-alt-screen [extra args] '<prompt>'
Full screen Off: --no-alt-screen runs Codex inline, so its output goes into the terminal history. NATAMUX_CODEX_ARGS cannot turn it back on: the flag wins over tui.alternate_screen
Permission flag --sandbox workspace-write --ask-for-approval never -c sandbox_workspace_write.network_access=true, left out with "agents": { "permissionMode": "ask" } in .natamux.json
Network On in the sandbox. Without it, the natamux commands Codex runs cannot reach the daemon on 127.0.0.1, and a stage cannot report done. To turn it off, add -c sandbox_workspace_write.network_access=false to NATAMUX_CODEX_ARGS
Change the program NATAMUX_CODEX_COMMAND
Add arguments NATAMUX_CODEX_ARGS

Set the variables in the environment of the daemon (or the desktop app) before it starts. Start the agent from the dashboard, or:

Terminal window
natamux agent start T-42 --agent codex

Natamux passes one -c hooks.<Event>=… override for each event. Each hook runs natamux hook codex. Your own Codex settings do not change.

The -c 'projects={…}' override trusts the task’s worktree for this run, so Codex does not ask. See Folder trust.

Hook event Meaning Task state
UserPromptSubmit A prompt was sent running
PreToolUse, PostToolUse The agent works no change
PermissionRequest Codex asks for permission needs input
Stop, Interrupt The turn ended, or you pressed Esc idle

Codex has no failure hook, so a failed turn does not move the task to failed.

Where Folder Shown as
Project .agents/skills/<name>/SKILL.md Project
You ~/.agents/skills/<name>/SKILL.md Only on this machine
  • Natamux does not read Codex plugins: their install path is not documented.
  • {skill:<name>} becomes $<name> when Codex has the skill. Otherwise it becomes the path of a SKILL.md of that name, or the <name> skill when none exists.

Source: Codex skills, checked 2026-10-11.

For the rules in general, see Skills in a prompt. Agents change quickly: check the vendor docs if a skill is not found.

Supported. After a turn ends, Natamux reads the token_count lines of the session file. See Usage.

Not run against a real Codex session. The hooks follow Codex’s source code and are tested with made-up input.

  • No failed state.
  • If codex is not found, the task fails in the first 15 seconds with a message that names NATAMUX_CODEX_COMMAND.