System Prompt for Codex: What You Can Customize
Codex CLI uses AGENTS.md and skills rather than a user-facing system prompt. Here is what each layer does, what you can set, and how to keep project rules in a shared record.
Updated 5 min read
Codex CLI, the terminal-based coding agent from OpenAI, does not expose a user-editable system prompt the way a chat API does. Instead, it reads project context from an AGENTS.md file in your repository and can call skills and prompts you define. Those are the layers you control.
Understanding which layer does what prevents you from trying to configure behavior in the wrong place. Tools like fenbs keep the project rules, skills and approved prompts that those layers should reference, so they stay current across sessions and contributors.
The layers of Codex behavior
Codex CLI has internal system instructions set by OpenAI. You cannot read or edit them. They define how the agent reasons about code, manages tool calls, and handles safety constraints. These are stable across your use; changes to them come from OpenAI, not from anything you configure.
The layer you do control is the project context. When you run Codex in a repository that contains an AGENTS.md file, Codex reads that file as part of its context. It works like standing instructions for the project: coding standards, naming conventions, architecture decisions, rules about what to touch and what not to touch.
A third layer is the user prompt: what you type in the terminal when you invoke Codex for a specific task. That is a request, not standing instructions. It applies to the current task only.
What AGENTS.md does
AGENTS.md is a markdown file in your repository root, or in subdirectories for more specific context. Codex reads it natively and applies its contents to the session. You write it; the project team maintains it. It is the right place for project-level rules that every Codex session should follow.
- Coding standards: the language version, style guide, and formatter settings the project uses.
- Architecture rules: what patterns to follow, what to avoid, and which parts of the codebase are off-limits without explicit discussion.
- Testing requirements: which test types are required, how to run them, and what constitutes a passing result.
- Naming and file conventions: how new files, functions and variables should be named.
- Process rules: when to ask before acting, what to do when a change affects other systems.
Keep AGENTS.md short enough to read in one pass. A rule that gets lost in a long file is not followed. Write rules in plain language and update them when the project's decisions change.
Skills and prompts as reusable context
Skills are named, reusable instructions or context that a connected assistant can list and read. Where AGENTS.md covers project-wide rules, skills are useful for task-type instructions: how to write a code review for this codebase, how to refactor a specific class type, or how to generate documentation in your team's format.
A skill you store in fenbs is available to any connected AI app, not just Codex. If you use Claude Code for the same project, it can read the same skill library. The approved instructions stay in one place and do not need to be copied or maintained separately for each tool.
See ChatGPT Codex for how Codex integrates with the broader OpenAI product set, and Codex alternatives if you are evaluating other coding agents.
What you cannot customize
Codex CLI's internal system prompt, reasoning behavior and tool-use logic are not user-configurable. Attempts to override them through AGENTS.md or the user prompt may produce unexpected results. If Codex behaves in a way you cannot explain, the cause is more likely a gap in your project context than a behavior you can change through instructions.
OpenAI's documentation for Codex CLI covers what the agent is designed to do and the limits of its tool-use capabilities. Use that as the reference for what is and is not possible, rather than assuming any behavior is configurable.
For context about how the idea of a "system prompt" applies differently across tools, see system prompt vs user prompt. For a set of system prompt examples across common roles, see system prompt examples.
Keep project rules and approved prompts in one place
fenbs stores the project rules, skills and approved prompts that Codex and other connected agents should reference. Add your AGENTS.md rules as Decisions so the reasoning behind each one stays alongside it. When the rules change, the record shows what changed and why.
Free for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
How to do this with fenbs
- Create a free account and add a project for the codebase you are working in.
- Write an
AGENTS.mdfor your repository with the coding standards, architecture rules and process rules Codex should follow. - Add the most important rules as Decisions in fenbs so the reasoning is recorded alongside the rule.
- Add any task-type instructions as skills in fenbs, so they are available to all connected agents, not just Codex.
- Connect Codex and your other AI coding tools over MCP from Integrations.
- Ask your AI to read the project context, including the skills and decisions, before starting a task.
fenbs does not replace AGENTS.md; both serve a purpose. AGENTS.md travels with the repository. fenbs keeps the shared record across tools, contributors and sessions. Use AGENTS.md for the rules that should be in version control, and fenbs for the context that crosses tool boundaries.
When you onboard a new contributor, the AGENTS.md they clone with the repository gives Codex the project rules immediately. The fenbs connection gives them the broader project context: current tasks, decisions and where things were left. Neither replaces a good handoff conversation, but together they mean Codex starts every session from a well-defined state rather than a blank one.