Skip to main content

Codex

OpenAI Codex is used for automated maintenance tasks in the Green Goods monorepo. It runs in a sandboxed cloud environment with pre-built dependencies and no network access during execution.

Configuration

config.toml

The main Codex configuration lives at .codex/config.toml:

# Use CLAUDE.md as context (AGENTS.md is the primary, CLAUDE.md is fallback)
project_doc_fallback_filenames = ["CLAUDE.md"]
project_doc_max_bytes = 40960

# Default model for automated tasks
model = "gpt-5.3-codex"

# Sandbox: no network access during agent execution
[sandbox_workspace_write]
network_access = false

Key settings:

  • project_doc_fallback_filenames -- Codex reads AGENTS.md by default; falls back to CLAUDE.md for directories without an AGENTS.md
  • model -- gpt-5.3-codex is the default for judgment tasks. Individual automations can override with -m gpt-5.2 for simple transforms.
  • network_access = false -- The agent sandbox has no internet access, improving safety for automated tasks. Setup scripts retain network access for dependency installation.

Environment Setup (environment.toml)

The cloud environment at .codex/environments/environment.toml defines one-time setup:

[setup]
script = """
# Install Bun (primary runtime)
curl -fsSL https://bun.sh/install | bash

# Install Foundry (Solidity toolchain)
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Initialize submodules, install deps, build foundation
git submodule update --init --recursive
bun install
VITE_CHAIN_ID=11155111 bun run build:contracts
VITE_CHAIN_ID=11155111 bun run build:shared
"""

The setup installs Bun and Foundry, initializes git submodules, installs npm dependencies, and builds the foundation packages (contracts -> shared) in the correct dependency order. This is cached for up to 12 hours.

Predefined Actions

Three actions are configured for quick execution:

ActionCommand
Testbun run test
Lintbun format && bun lint
BuildVITE_CHAIN_ID=11155111 bun run build

Use Cases

Codex is used for tasks that benefit from sandboxed, automated execution:

  • Mechanical transforms -- Renaming variables, updating imports across files
  • Test generation -- Generating initial test scaffolds from existing patterns
  • Lint fixes -- Automated formatting and lint rule application
  • Documentation updates -- Updating code references in docs after refactors

Scope Constraints

When running automated maintenance tasks via Codex (or any automated agent), constraints from AGENTS.md apply:

  • Max 20 files changed per PR
  • Never touch deployment scripts, contract upgrade scripts, or .env files
  • Do not create new packages or top-level directories
  • Do not modify CLAUDE.md, AGENTS.md, or files in .claude/
  • All automated PRs must be created as drafts with appropriate labels

Skills Discovery

Codex discovers skills through a symlink:

# Created during environment setup
ln -s ../.claude/skills .agents/skills

This makes the same skill library available to Codex that Claude Code agents use, ensuring consistent patterns across both toolchains.

Relationship to Claude Code

Codex and Claude Code serve complementary roles:

AspectClaude CodeCodex
Context sourceCLAUDE.md + .claude/AGENTS.md + .codex/
ExecutionLocal machineCloud sandbox
NetworkFull accessNone (agent phase)
ModelClaude Opus/SonnetGPT-5.3 Codex
Best forInteractive developmentAutomated maintenance
MemoryPersistent per-agentPer-session

Next best action

Learn about the custom agentic pipeline for meeting-to-action workflows.

OpenClaw