2.7 KiB
2.7 KiB
Troubleshooting Codex Configuration
Common issues and solutions for Codex CLI configuration.
Common Issues
Config Not Loading
Symptoms: Settings not applied, defaults used instead
Solutions:
- Verify
~/.codex/config.tomlexists - Check TOML syntax
- Use
-cto override and test
# Test with override
codex -c model="gpt-5.2" --help
# Validate TOML syntax
cat ~/.codex/config.toml | toml-lint
MCP Server Not Connecting
Symptoms: Tools not available, connection errors
Checklist:
- Check command path is correct
- Verify API keys in env section
- Check
enabled = true - Review
tool_timeout_sec
# List servers and status
codex mcp list
# Test server connection
codex mcp test server-name
Skills Not Found
Symptoms: $skill-name not recognized
Checklist:
- Verify path hierarchy
- Check skill directory structure
- Ensure SKILL.md exists in skill folder
Skills path precedence:
$CWD/.codex/skills/$CWD/../.codex/skills/$REPO_ROOT/.codex/skills/~/.codex/skills//etc/codex/skills/- Built-in skills
Sandbox Too Restrictive
Symptoms: Permission denied, can't access files
Solutions:
- Use
-s workspace-writefor normal development - Check project trust level
- Consider
--add-dirfor additional paths
# Add additional writable directory
codex --add-dir /path/to/data "task requiring data access"
# Check current sandbox mode
codex -c sandbox_mode
Debug Commands
Check Current Configuration
# View current features
codex features
# Check effective config
codex config show
Session Management
# Resume previous session
codex resume
# Resume last session
codex resume --last
# List recent sessions
codex sessions
Sandbox Debugging
# Run command in sandbox debug mode
codex sandbox <command>
# Check sandbox permissions
codex sandbox --check
Validation
TOML Syntax
# Using toml-lint
cat ~/.codex/config.toml | toml-lint
# Using Python
python -c "import toml; toml.load(open('$HOME/.codex/config.toml'))"
Test Config Override
# Test model setting
codex -c model="gpt-5.2-codex" --help
# Test multiple settings
codex -c model="gpt-5.2" -c model_verbosity="high" --help
Verify MCP Servers
# List all configured servers
codex mcp list
# Check specific server
codex mcp test graphite
Log Locations
Codex logs are typically in:
~/.codex/logs/(if logging enabled)- System journal (on Linux with systemd)
Reset Configuration
If configuration is corrupted:
# Backup current config
cp ~/.codex/config.toml ~/.codex/config.toml.bak
# Start fresh
rm ~/.codex/config.toml
# Recreate with defaults
codex config init