Guide · Agent skill
How to use the Codex Agent Provider skill for NanoClaw
Updated · written with AI from the project's own documentation and checked against our catalogue data
The add-codex skill lets a NanoClaw installation run a group's AI agent on OpenAI's Codex, using its app-server, either alongside Claude or in place of it. This guide explains what the skill changes, how to install it, how to switch a group to Codex, and what to check for safety. After reading it you should be able to decide whether this fits your setup and apply it.
Quick start
- 1Check requirements. Confirm your NanoClaw trunk has src/project-doc-compose.ts and the shared exchange archive, and that you have a ChatGPT subscription or OpenAI API key.
- 2Download and unzip the skill. Download the add-codex ZIP from this page and unzip it into ~/.claude/skills/ or a project's .claude/skills/, or upload it under Settings → Capabilities → Skills.
- 3Apply the provider. Have your agent apply SKILL.md, or run the provider-auth shortcut. This copies the payload, appends the barrel imports and adds the Codex CLI to the container manifest.
- 4Rebuild the container image. Run the build commands in SKILL.md so the Codex CLI is included in the image.
- 5Authenticate through the gateway. Log in with your ChatGPT account or API key through the setup walk-through. The gateway holds the credential, not your .env file.
- 6Switch a group to Codex. Run ncl groups config update with --provider codex for the chosen group, then restart that group.
What the Codex skill changes for your agent
NanoClaw picks each group's agent backend from the group's provider setting, which defaults to claude. This skill adds Codex as a full provider. The agent then keeps Codex's planning, tool orchestration, MCP tools and server-side conversation history, and it can resume sessions.
Codex runs as a child process that talks JSON-RPC over stdio, with native streaming. The continuation is a thread id, so there is no on-disk transcript for the conversation. This is different from using OpenAI only as a tool that Claude calls. In that setup Claude remains the planner, and the source notes that the add-codex skill is not that approach.
Check the requirements before you install
You need a NanoClaw trunk that includes src/project-doc-compose.ts and core's shared exchange archive at container/agent-runner/src/provider-contracts/exchange-archive.ts. If either is missing, the skill says to run /update-nanoclaw first.
You also need a ChatGPT subscription or an OpenAI API key, which is used through the selected gateway's vault. The install adds the Codex CLI (@openai/codex) to container/cli-tools.json and requires a container image rebuild.
- NanoClaw trunk with src/project-doc-compose.ts and the shared exchange archive
- A ChatGPT subscription or OpenAI API key, handled by the selected gateway's vault
- Permission to rebuild the container image and run setup commands
- Newer Codex releases need the credential gateway skill from the same NanoClaw release, so refresh both together with /update-nanoclaw
Install the skill files
Download the ZIP of the add-codex skill from this page and unzip it into ~/.claude/skills/ for all projects, or into a project's .claude/skills/ folder for one project. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.
Installing the files does not finish the job. The SKILL.md inside explains the remaining steps, which an agent can apply for you or you can apply by hand.
~/.claude/skills/add-codex/Apply the Codex provider to NanoClaw
The SKILL.md describes four mechanical steps. First, copy the payload files into the host, container and setup trees, overwriting each file. Second, append import './codex.js'; to each of the five provider and contract barrels. Third, add the @openai/codex entry to container/cli-tools.json. Fourth, rebuild.
The skill also documents a shortcut that performs the whole install, including auth, in one command. Every step is idempotent, so re-running the skill is safe.
- Copy the payload files listed in SKILL.md into all three trees
- Append the import to the five barrel files
- Add the pinned Codex CLI entry to container/cli-tools.json
- Run the build commands and rebuild the container image
pnpm exec tsx setup/index.ts --step provider-auth codexAuthenticate with your ChatGPT login or API key
Credentials are vault-only. The selected gateway serves a sentinel auth.json stub into the container and swaps in the real ChatGPT token or API key on the wire. The key is not stored in .env, and nothing readable is left in the container.
The setup screens and login steps do not change. Choose the same login options as before and the gateway handles custody.
Switch a group to Codex and trigger it
Ask your agent in plain words to add the Codex provider, or run the /add-codex command, which the REMOVE.md file refers to. Then set the provider for the specific group you want to change. Other groups stay on their current provider.
Restart the group after changing its provider so the change takes effect. The REMOVE.md file shows the same pattern for switching back to Claude.
- List groups with ncl groups list
- Switch one group with ncl groups config update --id <group-id> --provider codex
- Restart it with ncl groups restart --id <group-id>
ncl groups config update --id <group-id> --provider codex
ncl groups restart --id <group-id>Safety notes: scripts and network
The skill runs scripts and uses the network. Its build and setup commands run pnpm and the container build script, and the agent reads the SKILL.md directives and applies them. Read the payload and SKILL.md before you run the install, and run it only on a NanoClaw trunk you control.
Because credentials stay in the gateway's vault, you should not put an OpenAI key in .env for this provider. Check which gateway your installation uses before you start.
- Installation copies files across several trees, edits barrel files and rebuilds the image
- The provider talks to OpenAI over the network through the gateway
- To undo the change, follow REMOVE.md, which reverses each step and keeps each group's memory on disk
What people use it for
- Run one customer-facing group on Codex while other groups stay on Claude
- Give a team group access to a ChatGPT subscription the operator already pays for
- Use Codex's server-side conversation history and session resume in a specific group
- Compare provider behaviour by switching a single group and leaving the rest unchanged
Frequently asked questions
Is the Codex agent provider free?
The source does not state pricing or licence terms for Codex itself. The skill is listed under the MIT licence. Codex use requires a ChatGPT subscription or an OpenAI API key, which you pay for through your OpenAI account.
What do I need to install the add-codex skill?
You need a NanoClaw trunk with src/project-doc-compose.ts and the shared exchange archive, a ChatGPT subscription or OpenAI API key, and the ability to rebuild the container image and run setup commands.
Does the add-codex skill store my OpenAI key in .env?
No. The skill says credentials are vault-only. The selected gateway serves a stand-in auth file into the container and swaps in the real token or key on the wire.
How is this different from using OpenAI as an MCP tool?
With this skill, Codex is the agent backend for a group and handles planning and tool use. When OpenAI is used as an MCP tool, Claude remains the planner and calls OpenAI only for specific tasks.
How do I switch a group back to Claude?
Run ncl groups config update with --provider claude for that group, then restart the group. REMOVE.md shows the full process for returning all groups to the default provider.
Why does installation fail or need a rebuild?
The install edits several files and needs a container image rebuild. If the skill reports a missing file, check that your trunk includes the required files, and run /update-nanoclaw before retrying.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you run NanoClaw and want some groups on OpenAI Codex, especially if you already have a ChatGPT subscription or API key. Pick something else if you only want to call OpenAI as a tool from Claude, or if you cannot rebuild the container image and run setup commands.
Download the skill