Skip to content

Add developer_instructions_file for stronger local guidance #12926

Closed as not planned

Description

@aofei

What variant of Codex are you using?

CLI

What feature would you like to see?

I would like to propose a new config key: developer_instructions_file.

This is a practical middle ground between:

  • AGENTS.md, which is useful but often has weaker adherence in practice, and
  • a hypothetical --append-system-prompt-file, which seems more invasive for Codex CLI.

Additional information

Context and problem

I ran small local experiments and found that:

  • Guidance in AGENTS.md is not always followed consistently enough for strict workflows.
  • Guidance injected as developer instructions has much better adherence.

I also tried to emulate an "append system prompt file" flow using model_instructions_file, but that creates a maintenance burden:

  • I need to track and copy upstream base prompt content (for example from codex-rs/core/prompt.md and related model prompt behavior).
  • Any upstream changes to built-in instructions can break or drift my local setup.

Why this over --append-system-prompt-file

--append-system-prompt-file is appealing, but for Codex CLI it seems riskier:

  • It touches base/system instruction composition.
  • It can interact with model-specific templates and personality logic.

developer_instructions_file fits existing architecture better:

  • Lower implementation risk.
  • Clearer scope and intent.
  • Better adherence than AGENTS.md for strict local policy.

Compatibility

  • Fully backward compatible.
  • No behavior change unless explicitly configured.
  • Relationship with developer_instructions: developer_instructions_file provides a reusable baseline, while developer_instructions remains the inline per-config override.
  • If both are set, combine as: file_content + "\n\n" + developer_instructions, so inline text can refine or tighten the baseline file content.

Activity

  1. added
    enhancement
    on Feb 26, 2026
  2. added
    CLI
    on Feb 26, 2026
  3. aofei commented on Feb 26, 2026

    @aofei
    ContributorAuthor

    FWIW, what I want is a direct replacement for an existing Claude Code workflow that already works very well for me.

    #!/usr/bin/env bash
    
    set -e
    
    claude="$(which -a claude | grep -v "$0" | head -1)"
    system_prompt_file="${HOME}/.config/AGENTS.md"
    
    for arg in "$@"; do
    	if [[ "${arg}" == --append-system-prompt-file || "${arg}" == --append-system-prompt-file=* ]]; then
    		exec "${claude}" "$@"
    	fi
    done
    
    exec "${claude}" --append-system-prompt-file "${system_prompt_file}" "$@"
  4. added
    agent
    and removed
    CLI
    on Feb 27, 2026
  5. added
    config
    and removed
    agent
    on Apr 11, 2026
  6. etraut-openai commented on May 2, 2026

    @etraut-openai
    Contributor

    This feature request hasn't received enough upvotes, so I'm closing it.

  7. hlky commented on Jun 2, 2026

    @hlky

    @etraut-openai Would you consider reopening/revisiting this request?

    I put together a branch implementing developer_instructions_file for my own use, and wanted to share it in case it reduces the amount of OpenAI engineering bandwidth needed to evaluate the feature:

    I understand this may not have enough broad demand to prioritize internally. My hope is that having an implementation available makes it easier to assess whether the feature is acceptable, even if it still needs changes before it could be considered.

    My personal use case is easier experimentation with and sharing of custom developer instructions. I will likely use this together with:

    include_permissions_instructions = false
    include_apps_instructions = false
    include_collaboration_mode_instructions = false
    
    [skills]
    include_instructions = false

    The reason is that I want to experiment with completely custom developer instructions while suppressing the default developer-instruction sections. I suspect that interactions between the default developer-instruction sections and parts of the base/system instructions can sometimes compound into assumptions that affect the quality of the work produced. For that kind of experiment, keeping a large amount of Markdown inside config.toml is awkward, and sharing it is also awkward.

    model_instructions_file already solves this shape of problem for model/base instructions: it lets users provide substantial custom instructions without flooding config.toml with hundreds of lines. This branch adds the analogous config key for developer instructions.

    The branch is intended to be backward compatible: no behavior changes unless developer_instructions_file is configured. It also updates the config schema and adds test coverage for config loading, profile/path resolution, standalone agent roles, config lock behavior, and a request-body integration test showing the file content is sent as a developer role message.

    I'm happy to adjust the exact semantics if maintainers prefer a different precedence or combination behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    configenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions