Claude-skill-registry codex-configuration
Manages OpenAI Codex CLI configuration including config.toml settings, MCP servers, model profiles, sandbox modes, approval policies, and skill paths. Use when configuring Codex CLI, setting up model profiles, managing MCP server integrations, troubleshooting Codex configuration issues, or optimizing Codex for different workflows.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/codex-configuration" ~/.claude/skills/majiayu000-claude-skill-registry-codex-configuration && rm -rf "$T"
skills/data/codex-configuration/SKILL.mdCodex Configuration Management
Manages configuration files for OpenAI Codex CLI, including model settings, sandbox policies, MCP servers, and profiles.
Quick Start
Configuration File Location
Primary Config:
— User-level configuration~/.codex/config.toml
Skills Paths (precedence, highest first):
— Current directory$CWD/.codex/skills/
— Parent directory$CWD/../.codex/skills/
— Repository root$REPO_ROOT/.codex/skills/
— User-level~/.codex/skills/
— System/admin level/etc/codex/skills/- Built-in skills — Bundled with Codex
CLI Config Override
Override any config value at runtime:
codex -c model="o3" codex -c 'sandbox_permissions=["disk-full-read-access"]' codex -c shell_environment_policy.inherit=all
Config Structure
Basic config.toml
# Model settings model = "gpt-5.2-codex" model_verbosity = "medium" # high | medium | low model_reasoning_effort = "high" # low | high | xhigh # Permissions approval_policy = "on-failure" # untrusted | on-failure | on-request | never sandbox_mode = "workspace-write" # read-only | workspace-write | danger-full-access exec_timeout_ms = 300000 # 5 minutes # Misc file_opener = "cursor" # Editor for opening files
Model Configuration
model = "gpt-5.2-codex" model_verbosity = "medium" model_reasoning_summary = "auto" # auto | concise | detailed model_reasoning_summary_format = "experimental" model_supports_reasoning_summaries = true model_reasoning_effort = "high" tool_output_token_limit = 25000
Profiles
Define named profiles for different workflows:
[profiles.max] model = "gpt-5.1-codex-max" model_verbosity = "high" model_reasoning_effort = "xhigh" [profiles.fast] model = "gpt-5.1-codex-mini" model_verbosity = "low" model_reasoning_effort = "low" [profiles.normal] model = "gpt-5.2" model_verbosity = "medium" model_reasoning_effort = "high"
Usage:
codex -p max "complex refactoring task" codex -p fast "quick fix"
Sandbox Modes
| Mode | Description | Use Case |
|---|---|---|
| No write access | Safe exploration |
| Write to workspace only | Normal development |
| Full system access | Trusted operations |
codex -s read-only "analyze this codebase" codex -s workspace-write "implement feature" codex --dangerously-bypass-approvals-and-sandbox # EXTREME CAUTION
Approval Policies
| Policy | Behavior |
|---|---|
| Only trusted commands (ls, cat, sed) run without approval |
| All commands run; approval only if command fails |
| Model decides when to ask |
| Never ask for approval |
codex -a untrusted "careful task" codex -a never "automated pipeline" codex --full-auto # Alias for -a on-request --sandbox workspace-write
Project Trust Levels
[projects] "/path/to/trusted/project" = { trust_level = "trusted" } "/path/to/another" = { trust_level = "trusted" }
Shell Environment Policy
[shell_environment_policy] set = { MY_VAR = "value" } # Force-set environment vars inherit = "all" # all | core | none ignore_default_excludes = false include_only = [] # Whitelist patterns
Features
Toggle experimental features:
[features] unified_exec = true shell_snapshot = true apply_patch_freeform = true exec_policy = true remote_compaction = true skills = true
CLI toggle:
codex --enable skills codex --disable remote_compaction
TUI Settings
[tui] notifications = ["agent-turn-complete", "approval-requested"]
MCP Server Configuration
Adding MCP Servers
[mcp_servers.server-name] command = "npx" args = ["-y", "@package/mcp-server"] enabled = true tool_timeout_sec = 60.0 [mcp_servers.server-name.env] API_KEY = "your-key"
Common MCP Servers
Context7 (documentation):
[mcp_servers.context7] command = "npx" args = ["-y", "@upstash/context7-mcp", "--api-key", "YOUR_KEY"]
Firecrawl (web scraping):
[mcp_servers.firecrawl] command = "npx" args = ["-y", "firecrawl-mcp"] [mcp_servers.firecrawl.env] FIRECRAWL_API_KEY = "YOUR_KEY"
Graphite (stacked PRs):
[mcp_servers.graphite] command = "gt" args = ["mcp"]
Linear (project management):
[mcp_servers.linear] command = "npx" args = ["-y", "mcp-remote@latest", "https://mcp.linear.app/sse"]
Disabling MCP Servers
[mcp_servers.disabled-server] command = "some-command" args = [] enabled = false
Skills Configuration
Skills Paths
Codex loads skills from multiple locations with precedence:
- CWD:
— Project-specific.codex/skills/ - Parent:
— Shared in parent folder../.codex/skills/ - Repo Root:
— Repository-wide$REPO_ROOT/.codex/skills/ - User:
— Personal skills~/.codex/skills/ - Admin:
— System-wide/etc/codex/skills/ - Built-in: Bundled with Codex (
,$plan
)$skill-creator
Invoking Skills
# Explicit invocation codex "$plan implement authentication" codex "$skill-creator new skill for testing" # Implicit (Codex decides based on context) codex "plan out the implementation"
Built-in Skills
— Research and create implementation plans$plan
— Bootstrap new skills$skill-creator
— Download skills from GitHub$skill-installer
Convenience Flags
| Flag | Equivalent |
|---|---|
| |
| (local LM Studio/Ollama) |
| Enable web search tool |
codex --full-auto "implement feature" codex --oss --local-provider ollama "explain this code" codex --search "find latest React patterns"
Working Directory
codex -C /path/to/project "work here" codex --add-dir /additional/writable/path "access multiple dirs"
Validation
# Check TOML syntax cat ~/.codex/config.toml | toml-lint # Test config override codex -c model="test" --help # Verify MCP server codex mcp list
Troubleshooting
Common Issues
Config not loading:
- Verify
exists~/.codex/config.toml - Check TOML syntax
- Use
to override and test-c
MCP server not connecting:
- Check command path is correct
- Verify API keys in env section
- Check
enabled = true - Review
tool_timeout_sec
Skills not found:
- Verify path hierarchy
- Check skill directory structure
- Ensure SKILL.md exists in skill folder
Sandbox too restrictive:
- Use
for normal development-s workspace-write - Check project trust level
- Consider
for additional paths--add-dir
Debug Commands
# Check current features codex features # Resume previous session codex resume codex resume --last # Run in sandbox debug mode codex sandbox <command>
Best Practices
Security
- Use
sandbox for most workworkspace-write - Set
as baselineapproval_policy = "on-failure" - Only use
when necessarydanger-full-access - Review project trust levels periodically
Performance
- Use profiles for different task types
- Set appropriate
exec_timeout_ms - Configure
for large outputstool_output_token_limit
Organization
- Keep user-level skills in
~/.codex/skills/ - Use project-level skills for team sharing
- Document custom MCP server configurations