Proposal: standardize .agents workspace alongside .codex
Resolved 💬 3 comments Opened Oct 28, 2025 by AmirTlinov Closed Dec 18, 2025
Summary
Codex today keeps durable agent assets in ~/.codex, while project-specific guidance lives in scattered AGENTS.md files and user scripts. We want to add a sibling ~/.agents workspace — with an optional project-level .agents/ overlay — so that context notes, reusable tools, and MCP definitions have a consistent home.
Why it matters
- Predictable structure: Teams can drop durable memory (
context/), helper scripts (tools/), or MCP manifests (mcp/) into~/.agentsand expect every Codex session to see them. - Per-project overrides: When a repository contains its own
.agents/, its content augments or overrides the global workspace. This lets each codebase carry tailored policies without affecting others. - Lower setup friction: Provisioning new machines—or sharing platform-wide tooling—becomes a matter of syncing the
.agentstree instead of juggling multiple ad-hoc folders. - Shared ecosystem: Today, different agent CLIs often ship with their own hidden folders (
~/.codex,~/.claude,~/.gemini, …). Standardizing on~/.agentsgives humans and agents a common, reusable hierarchy for memory, tooling, and configuration. - Reusable context: High-value guidance stored in
~/.agents/context/can be refined once and reused across projects or agents, rather than re-instructing each run from scratch.
What we’re proposing
- Ship Codex CLI with an auto-initialized
~/.agents/{context,tools,mcp}. Users can override the path via theagents_homeconfig key or theAGENTS_HOMEenvironment variable. - At startup, if the working repository contains
.agents/, merge it on top of the global workspace (project entries win, global entries remain as fallbacks). - Merge MCP configs from
agents_home/mcpwith the existingmcp_serverssection inconfig.toml, so commands likecodex mcp listsurface both global and local servers. - Render an aggregated
<agents_context>block (listing context documents and tool paths) at the beginning of every session/turn so models can immediately act on those assets. Global entries use their true absolute paths and honor per-file/per-block truncation limits. - Keep behavior opt-in for projects: we never create
.agents/in a repo automatically—users or tooling do that when they want project-local customization. - Document the layered layout and cover it with unit/integration tests so the behavior stays stable.
Expected outcome
- Global
.agentsbecomes the canonical place for long-lived agent memory and tooling. - Projects that ship with their own
.agentsgain layered context/MCP support without bespoke scripting. - Multiple agent CLIs can converge on the same directory layout, simplifying coexistence on shared machines.
- Each Codex session receives a clearly delimited
<agents_context>message that references the real paths to context files and helper tools. - The new convention remains backwards compatible; existing
~/.codexworkflows keep working unchanged.
We’ve prototyped this in PR #5877 (integration/unit coverage + docs included) and would appreciate guidance on whether the approach aligns with Codex’s roadmap, as well as any concerns about rolling it out.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗