BTALabs

Build with

Run Codex in Nix Agents

Codex runs in Nix Agents the same way every other CLI agent does: real terminal, own worktree, your login.

How it works

Codex is installed and authenticated by you, in your shell. Nix Agents runs it in a worktree created for the task, in a terminal pane that behaves like the one you would open by hand — including on Windows, where PTY support is the difference between a working agent and a broken one.

Nothing about the CLI is wrapped or reimplemented. If a flag works in your shell it works here, and the pane is a terminal, so you can take over mid-session at any point.

Running Codex next to other agents

The reason to put Codex in a workspace instead of a terminal is the second agent. Once two CLIs are running, the questions become operational: which checkout, which branch, which diff, which one is finished.

The board answers them by construction — each session owns a worktree, each worktree owns a branch, and the diff view is per worktree rather than per window. Mixing Codex with Claude Code, Gemini CLI or Copilot is the normal case, not an edge one: around 25 CLIs are supported, and the choice of agent can be per task.

Questions

Do different agents share a worktree?
Not by default. A worktree per session is what keeps two agents from editing the same files, and mixing agents in one checkout is exactly the collision the worktree model prevents.
← All build with