Support first-class main-session agent/role presets with skill scoping
Summary
Codex should support first-class role/agent presets for the main session, not just top-level --profile config overrides or isolated CODEX_HOME workarounds.
A role should be able to define things like:
- system/developer instructions
- allowed/disallowed tools
- preloaded skills
- model / provider / profile defaults
- optional approval / sandbox defaults
and then be selectable directly at startup, for example:
codex --agent frontend
codex --agent backend
codex --agent reviewer
Problem
Today, --profile appears to be a config/profile selector, not a true role/agent definition mechanism.
That means there is currently no clean built-in way to express a setup like:
frontendagent can use frontend/UI skillsbackendagent can use backend/server skillsrevieweragent can use review-focused skills and prompts
without falling back to heavier workarounds like separate CODEX_HOME directories.
Using separate CODEX_HOME roots is functional but awkward because it can also split:
- config state
- installed skills
- local history/session state
- auth and other user-local data
That is much heavier than “start the same Codex, but as a different role”.
Why this matters
This is useful even for single-user workflows, not only multi-agent orchestration.
Typical usage:
- one terminal starts a
frontendrole - another starts a
backendrole - both belong to the same overall user/workspace flow
- but each should have different instructions, skill preload, and capability surface
Claude Code already exposes a much more direct version of this idea via --agent / custom agents. Codex currently feels noticeably less ergonomic for this specific workflow.
Proposed UX
Any of these would help, with a strong preference for the first two:
Option 1: first-class top-level agents
Allow config like:
[agents.frontend]
description = "Frontend/UI specialist"
prompt = "You are a frontend specialist..."
skills = ["frontend-skill", "ui-review"]
tools = ["Read", "Edit", "Write", "Bash"]
profile = "frontend"
[agents.backend]
description = "Backend specialist"
prompt = "You are a backend specialist..."
skills = ["backend-skill"]
tools = ["Read", "Edit", "Write", "Bash"]
profile = "backend"
Then:
codex --agent frontend
codex --agent backend
Option 2: role presets that extend profiles
Keep profiles for ordinary config, but add a higher-level role layer that can also bind skills, prompts, and tool restrictions.
Option 3: make skills profile-scoped
If Codex does not want a full agent abstraction yet, allowing profiles.<name>.skills (or equivalent) would still close a large part of the gap.
Expected behavior
- A role should be selectable at startup without switching to a different
CODEX_HOME - Different roles should be able to preload different skills
- Different roles should be able to set different instructions / tool restrictions
- Roles should compose cleanly with existing
profiles - Session/history storage should remain in the same normal Codex environment unless the user explicitly wants full separation
Non-goal
This request is not asking for full background subagent orchestration by itself.
It is mainly about making “start Codex as role X” a first-class concept for the main session.
Related issues
- #2604 (broader subagent support)
- #14039 (per-subagent model/provider/profile selection)
- #4432 (auth profile request)
This request is adjacent to those, but narrower:
it is specifically about role/agent presets for the main interactive session, especially with skill scoping.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗