Skip to content

[FEATURE]: Model-specific AGENTS files (e.g. AGENTS_gpt-5_5.md) #26720

@emincangencer

Description

@emincangencer

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Problem

When switching between different models I often want model-specific instructions, examples, reminders or constraints (reasoning style, formatting quirks, tool use behavior, context handling, etc.).
Currently there is no easy way to do this without creating fully separate agents (which adds metadata overhead and reduces the nice build mode experience).

Proposed solution

Support model-specific AGENTS files that are loaded in addition to the regular AGENTS.md.

  • Project level: AGENTS_{model}.md
  • Global level: ~/.config/opencode/AGENTS_{model}.md

Examples:

  • AGENTS_claude-opus-4-7.md
  • AGENTS_gpt-5_5.md

Loading rules:

  • Always load base AGENTS.md (project + global) first
  • Then load the matching model-specific file if it exists
  • Model name normalization (replace ., -, / with _ etc.) so variants work nicely

This keeps the current lightweight markdown workflow while giving precise control per model.

Why this is better than per-model agents

  • No extra metadata / JSON
  • No loss of build mode convenience
  • Simple and consistent with how project + global AGENTS.md already work

Additional note

Since AGENTS.md is currently loaded at startup, model-specific files may need to be resolved when the model is actually selected (especially on the first user message). Loading at every model change and rewriting history might impact caching.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions