YouTip LogoYouTip

Codex Config File

Codex provides rich configuration options, allowing you to customize the Agent's behavior to suit different work needs. By default, the Codex App will set the language based on your system settings. If not, you can do so through Settings: !(#) Select General to modify your desired language: !(#) Similarly, if you want to change from Chinese to English, just check English: !(#) * * * ## Codex App Settings How to open: Click Settings in the application menu, or press Cmd + ,: !(#) The settings interface is shown below: !(#) **General:** Configure how files are opened, and the amount of command output displayed in the conversation thread. You can also set multi-line prompts to require Cmd+Enter to confirm, and prevent the system from sleeping during task execution. **Notifications:** Set the trigger timing for task completion notifications, and whether the app proactively requests system notification permissions. !(#) **Agent Configuration:** The Codex Agent in the App shares the same configuration as the IDE and CLI extensions. Common options can be adjusted directly within the App, while advanced options require editing the config.toml file (explained later). !(#) **Appearance:** Supports selecting a base theme, adjusting accent, background, and foreground colors, as well as changing UI and code fonts. Custom themes can be shared with others. !(#) **Codex Pets:** Optional dynamic companion characters. Path: **Settings > Appearance > Pets**. You can choose built-in pets or load custom pets from the local Codex home directory. !(#) **How to use:** * Type `/pet` in the input box * Use **Wake Pet** or **Tuck Away Pet** in **Settings > Appearance** * Press `Cmd+K` / `Ctrl+K` and run the command of the same name The pet floating window can continuously display the current Codex work status (Running / Awaiting Input / Pending Review) while using other applications, along with a brief progress prompt. **Custom Pets (Creation Process):** $skill-installer hatch-pet After installation, select **Force Reload Skills** in the command menu, then execute: $hatch-pet create a new pet inspired by my recent projects **Git:** Unify branch naming conventions, configure whether to enable force push, and set the prompts used by Codex when automatically generating commit messages and PR descriptions. !(#) **Environment:** You can view project directories and add projects. !(#) **Worktree:** Use Git worktree to allow Codex to process multiple tasks in parallel within the same project. !(#) **Browser Use:** Install or enable the built-in Browser plugin, and manage website whitelists and blacklists. By default, Codex will ask the user before using any website; after removing a website from the blacklist, Codex will resume its prompting behavior. See the in-app browser documentation for details. !(#) **Computer Use:** macOS only. You can view desktop app access permissions and related preference settings. To revoke system-level permissions, go to macOS Privacy & Security to modify Screen Recording or Accessibility permissions. !(#) **Archived Threads:** Lists all archived conversations, showing date and project context. Click Unarchive to restore a specific thread. !(#) * * * ## Configuration File Location Codex configuration files are managed in layers: | Layer | Path | Scope | | --- | --- | --- | | **User-level** | `~/.codex/config.toml` | Global default configuration | | **Project-level** | `.codex/config.toml` | Project-specific configuration | | **Managed-level** | Enterprise distributed | Unified enterprise configuration | ### Configuration Merge Rules Configurations are merged by priority: * Managed configuration has the highest priority * Project configuration overrides user configuration * User configuration serves as the default value * * * ## Basic Configuration Items ## Basic Configuration # ~/.codex/config.toml # Default model model = "gpt-5.4" # Reasoning effort model_reasoning_effort = "medium" # minimal | low | medium | high | xhigh # Reasoning summary detail level model_reasoning_summary = "auto" # auto | concise | detailed | none # Service tier service_tier = "flex" # flex | fast # Approval policy approval_policy = "suggest" # suggest | auto-edit | full-auto * * * ## AGENTS.md AGENTS.md is a project-level Agent instruction file that defines the behavioral specifications for Codex in this project. ### File Discovery Order 1. Read global `~/.codex/AGENTS.md` 2. Search each directory from the project root downwards 3. Rules in closer directories override those in farther ones ### AGENTS.md Example ## Project AGENTS.md # Project Development Specifications ## Tech Stack - Frontend: React + TypeScript - Backend: Python FastAPI - Database: PostgreSQL ## Code Standards - Use 4-space indentation - Maximum 100 characters per line - All functions must have type annotations ## Testing Requirements - New features must include tests - Use pytest to run tests ## Git Commits - Use Conventional Commits format - Commit messages should describe the "why" ## Review guidelines - Don't log PII - Verify authentication middleware - Check for SQL injection ### Subdirectory Override You can place AGENTS.override.md in a subdirectory: ## Subdirectory Rules # src/auth/ module rules ## Security Requirements - All passwords must be bcrypt encrypted - Add audit logs - Check for SQL injection > The AGENTS.md size limit is 32 KiB; exceeding this will result in truncation. * * * ## Skills Skills are reusable custom capabilities that encapsulate common task logic. ### Skill Directory Locations | Location | Path | Purpose | | --- | --- | --- | | **REPO** | `.agents/skills/` | Project-level skills | | **USER** | `~/.agents/skills/` | User-level skills | | **ADMIN** | `/etc/codex/skills/` | System-level skills | | **SYSTEM** | Built-in | Official preset skills | ### Skill Structure skill-name/β”œβ”€β”€ SKILL.md # Skill definition (required)β”œβ”€β”€ scripts/ # Optional scriptsβ”œβ”€β”€ references/ # Optional reference documents└── assets/ # Optional resources ### Creating a Skill ## Skill Definition --- name: code-review-standard description: Execute team standard code review --- # Code Review Standard ## Review Items 1. Code readability 2. Potential Bugs 3. Security vulnerabilities 4. Performance issues 5. Test coverage ## Output Format - Issue list (by severity) - Improvement suggestions - Score (1-10) ### Skill Triggering | Trigger Method | Example | | --- | --- | | **Explicit invocation** | `$skill-name` or `/skill-name` | | **Implicit matching** | Task description matches skill description | * * * ## Subagents Subagents allow complex tasks to be split among multiple Agents for parallel processing. ### Built-in Agent Types | Agent | Function | | --- | --- | | **default** | General-purpose agent | | **worker** | Execution-oriented, suitable for implementation and fixes | |
← Codex CommandsCodex Install β†’