How to Configure Codex CLI to gpt-6-sol and Set Up AGENTS.md for Repositories
Configuring Codex CLI to use gpt-6-sol gives your coding agent faster reasoning and fewer syntax regressions on complex TypeScript and Python stacks. Creating an AGENTS.md file in your repository root ensures the agent respects your coding style, linter rules, and testing requirements without asking repetitive questions.
Switching Default Model
Edit your ~/.codex/config.toml file and set 'model = "gpt-6-sol"'. Alternatively, pass the flag per session: 'codex --model gpt-6-sol'.
Why gpt-6-sol Matters: Unlike older conversational checkpoints, gpt-6-sol is fine-tuned specifically for code patch generation and multi-file syntax trees, cutting down failed builds.
Creating AGENTS.md: Place an AGENTS.md file in the root folder of your project. Codex automatically parses this file before planning any actions.
What to Include in AGENTS.md: Specify your package manager (e.g., 'Always use pnpm, never npm'), your testing framework ('Run pnpm test before finishing'), and styling rules ('Use Tailwind CSS v4 and functional React components').
Preventing Breaking Edits
Explicitly declare which directories the agent must never touch, such as production database migrations or vendor folders.
RunAnAi Takeaway
An AGENTS.md file acts like a README written specifically for AI workers. Spending 5 minutes setting it up saves you hours of fixing unwanted edits.
Related Questions & User Queries
- • How to switch Codex model to gpt-6-sol
- • What is AGENTS.md and how to write one for AI coding
- • Codex CLI config file settings and model flags
- • How to give OpenAI Codex project context using AGENTS.md