PROMPTS
AI Analysis
Live Data

Two Hidden Codex Config Fields: developer_instructions and compact_prompt

Customize Codex agent behavior globally and steer the compaction model using two lesser-known config.toml fields.

posted on X

Two Codex Features You Probably Didn't Know About! 🫵 1/ developer_instructions (string) Supplement the Codex system prompt with your own custom instructions. These are higher level instructions than your AGENTS file. You could use this for global instructions to your agents such as: - providing your name - negative prompts (em dashes, common phrases, etc) - personalization / personality 2/ compact_prompt (string) Did you know you can customize the pre compaction prompt for custom instructions? If you are have some custom workflows that would benefit from explicit steering, you can prompt the compaction model directly. You can also do this via a separate markdown file with experimental_compact_prompt_file (string - path). Both of these features are configured in your config.toml file, and work for both CLI and Codex App. I will cover more quirky hidden features in future posts 📫

View original tweet on X →

Customize Codex agent behavior globally and steer the compaction model using two lesser-known config.toml fields.

Example(yaml)

# config.toml

developer_instructions = """
Your name is Alex.
Do not use em dashes.
Avoid filler phrases like 'certainly' or 'of course'.
Be concise and direct.
"""

compact_prompt = """
When compacting, prioritize preserving:
- Open tasks and TODOs
- File paths and function names referenced in the conversation
- Any explicit user preferences stated during the session
"""

# Or use a file instead:
# experimental_compact_prompt_file = "prompts/compact.md"

Why it works

The developer_instructions field injects instructions at a higher priority layer than the AGENTS file, making it ideal for global, session-wide rules that apply regardless of the task at hand. Because it sits above the agent-level config, it reliably enforces things like tone, persona, and negative prompts without needing to repeat them per project. The compact_prompt field gives you direct control over what the compaction model is told to preserve when context windows fill up. By default, compaction is a lossy process — it summarizes what it deems important. Custom steering ensures project-specific context (open tasks, file references, user preferences) survives the compression step. Both fields live in config.toml, so they apply universally across CLI and App usage without per-project setup. The file-based variant (experimental_compact_prompt_file) separates concerns cleanly, letting you version-control compaction instructions alongside your codebase.

When to use

  • •You want to enforce a consistent writing style or persona (no em dashes, specific tone) across all Codex sessions
  • •Your sessions regularly hit context limits and important task state keeps getting lost during compaction
  • •You have multi-agent or complex workflows where the compaction model needs explicit guidance on what to retain

This article was AI-generated from real-time signals discovered by PureFeed.

PureFeed scans X/Twitter 24/7 and turns the noise into actionable intelligence. Create your own signals and get a personalized feed of what actually matters.

Report an Issue

Found something wrong with this article? Let us know and we'll look into it.