abraxarion

How To Shrink The System Prompt For Codex — Development skill for Claude Code

Development community

Article about how minimize the system prompt of Codex and turn off skills and MCP servers.

How to install How To Shrink The System Prompt For Codex

This entry records only its repository, not the path inside it, so there is no exact command to give. Open abraxarion/How-to-shrink-the-system-prompt-for-Codex and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What How To Shrink The System Prompt For Codex does

Article about how minimize the system prompt of Codex and turn off skills and MCP servers.

Alternatives in Development

README

How to shrink the built-in system-prompt in Codex

Codex can carry substantially more fixed context than you may expect.

The effective prompt seen by the model can include:

  • Codex's bundled base instructions
  • global AGENTS.md
  • repository-level AGENTS.md
  • directory-specific AGENTS.md
  • developer_instructions
  • skill instructions
  • plugin/app instructions
  • MCP tool definitions
  • built-in tool schemas
  • your actual conversation

For ordinary usage this may be fine. But if your goal is a **lean coding harness**, **lower token throughput**, **better prompt-cache behavior**, or a **minimal bootstrap environment**, reducing this fixed context can be worthwhile.

The most important trick is not to shorten Codex's built-in prompt manually.

Instead, **replace it**.


1. Replace Codex's bundled base instructions

Current Codex versions support:

model_instructions_file = "/path/to/minimal-codex-prompt.md"

Add this to:

~/.codex/config.toml

The referenced file can contain a much smaller base prompt.

For example:

You are a coding agent operating in a repository.

Use the available tools to inspect and modify files as needed.

Rules:
- Follow the user's request precisely.
- Inspect relevant code before editing.
- Preserve existing behavior unless change is requested.
- Make minimal, coherent edits.
- Do not modify unrelated files.
- Run relevant tests when practical.
- Report changes and unresolved issues concisely.

This can reduce a fairly large bundled instruction set to only a few hundred tokens.

A minimal configuration might therefore begin with:

model_instructions_file = "/home/user/.codex/minimal-instructions.md"

On Windows:

model_instructions_file = "C:\\Users\\USERNAME\\.codex\\minimal-instructions.md"

[!IMPORTANT] Do not duplicate tool descriptions in the replacement prompt. Tool schemas are supplied separately by the harness. Repeating shell, editor, patch, or MCP tool instr