Skip to content

Standardize global user-level AGENTS.md at ~/.config/agents/AGENTS.md #91

Open

Description

@nijaru

Problem

Each AI coding tool uses a different global config path:

  • Claude Code: ~/.claude/CLAUDE.md
  • Codex: ~/.codex/AGENTS.md
  • droid: ~/.factory/AGENTS.md
  • Amp: ~/.config/AGENTS.md

Result: Users must either duplicate personal preferences across tool-specific paths OR copy the same config into every project's ./AGENTS.md.

Solution

One standard location: ~/.config/agents/AGENTS.md

Platforms:

  • Linux/macOS: ~/.config/agents/AGENTS.md ($XDG_CONFIG_HOME/agents/AGENTS.md)
  • Windows: %APPDATA%\agents\AGENTS.md

Why a directory (agents/) not a lone file:

  • Follows XDG standard: ~/.config/<name>/ (not ~/.config/file)
  • Extensible: add rules/, commands/, templates later
  • Prevents ~/.config/ clutter from tool-specific files

How It Works

Tools check ~/.config/agents/AGENTS.md for global user configuration. Project-level config takes precedence over global.

Implementation details—precedence order, parent directory walking, merging behavior—are up to individual tools.

Precedent

Amp already uses ~/.config/AGENTS.md (lone file). This proposal uses the directory pattern (~/.config/agents/) for better extensibility.

Similar patterns: Git uses ~/.gitconfig (global) + .git/config (project), npm uses ~/.npmrc + .npmrc.

Reference

Full proposal: https://github.com/nijaru/global-agents-config

Activity

  1. duaneadam commented on Oct 25, 2025

    @duaneadam

    YES PLEASE.

  2. CX330Blake commented on Nov 15, 2025

    @CX330Blake

    +1. We need the standard to be unified.

  3. tifandotme commented on Nov 23, 2025

    @tifandotme

    please, one more standard!

  4. kryptobaseddev commented on Feb 12, 2026

    @kryptobaseddev

    Counterproposal: .agents/ as the Canonical Agent Directory

    Re: Issue #91 — Standardize global user-level AGENTS.md at ~/.config/agents/AGENTS.md


    TL;DR

    Instead of burying agent configuration inside ~/.config/agents/, I propose a simpler, more powerful pattern:

    • Project-level: .agents/ at the project root
    • Global user-level: ~/.agents/

    This mirrors the most successful directory convention in software history (.git/) and acknowledges that what agents need is not configuration — it's a knowledge workspace.


    The Core Problem with ~/.config/agents/

    The original proposal frames this as a configuration problem and reaches for XDG as the solution. But XDG Base Directory Specification was designed for a specific category of thing: application settings, preferences, and operational config. Think ~/.config/git/config, ~/.config/nvim/init.lua, ~/.config/starship.toml.

    Agent instructions are not configuration. They are:

    • Project knowledge (architecture, domain context, conventions)
    • Reusable skills and capabilities
    • Design specifications and task definitions
    • Links to external resources (Figma, Jira, dashboards)
    • Team tribal knowledge codified for machines

    This is closer to what .git/ is for version control or .github/ is for CI/CD workflows — a workspace directory that contains an entire domain of concern. Stuffing it into ~/.config/ misclassifies it from day one and limits its evolution.


    The .agents/ Proposal

    Project-Level: .agents/

    my-project/
    ├── .agents/
    │   ├── AGENTS.md          # Primary agent instructions (backward-compatible)
    │   ├── skills/            # Reusable agent capabilities
    │   │   ├── testing.md
    │   │   ├── deployment.md
    │   │   └── code-review.md
    │   ├── spec/              # Requirements, design docs, task definitions
    │   │   ├── requirements.md
    │   │   └── architecture.md
    │   ├── wiki/              # Domain knowledge, conventions, tribal knowledge
    │   │   ├── data-model.md
    │   │   └── auth-flow.md
    │   └── links/             # External resource references
    │       ├── figma.md
    │       └── jira.md
    ├── src/
    ├── package.json
    └── README.md
    

    Global User-Level: ~/.agents/

    ~/.agents/
    ├── AGENTS.md              # Personal global defaults
    ├── skills/                # Your personal reusable skills
    │   ├── my-code-style.md
    │   └── commit-conventions.md
    └── config.toml            # Tool-specific settings (if needed)
    

    Precedence

    Project .agents/ overrides global ~/.agents/, just like .gitconfig in a repo overrides ~/.gitconfig. Simple, intuitive, done.


    Why This Is Better: The Arguments

    1. Follows the Most Proven Convention in Software

    The most successful tool conventions in software development use top-level dot directories:

    Tool Project-Level Global-Level
    Git .git/ ~/.gitconfig
    GitHub .github/ —
    VS Code .vscode/ ~/.config/Code/
    Husky .husky/ —
    Cursor .cursor/ —
    Claude Code .claude/ ~/.claude/

    The .agents/ directory isn't just a different path — it's a different framing. It says: "Agent knowledge is a first-class concern in software development, important enough to deserve its own space, not a subfolder of someone else's spec."

  5. ForsakenHarmony commented on Apr 2, 2026

    @ForsakenHarmony

    I'd rather have my home directory be clean than have it be spammed by every program (even if in this case it's shared)

    git also supports ~/.config/git

    also do you really need to post fully ai written comments

  6. Pjrich1313 commented on Apr 2, 2026

    @Pjrich1313

    AI does they're own directions of sharing their information. I have it written into my PR. I am not here to be directed to how to control a system that controls its self. I have confidence in the system created to pull merger and build needs. I am conducting my own analysis on my project. I will double check my cargo records but when I ask for a clean build. Like stated, it's a non bias project.

  7. jonahsnider commented on Apr 15, 2026

    @jonahsnider

    The .agents/ directory isn't just a different path — it's a different framing. @kryptobaseddev

    Low effort slop, if you want anyone to take you seriously spend the time to actually write out your reasoning.

  8. gtbuchanan commented on May 7, 2026

    @gtbuchanan

    The Agent Skills spec and actual client implementations for skill paths have already mostly converged on .agents/skills, so I think that's reason enough to use .agents/AGENTS.md. I don't think it makes much sense to have them live separately.

  9. nertzy commented on May 27, 2026

    @nertzy

    Counterproposal - follow XDG Base Directory Specification to find a ~/.config/agents folder (or its equivalent)

  10. imaitland commented on Jun 2, 2026

    @imaitland

    whatever is picked. it must support different agents.md for different agents. you might have an agent (harness and model) doing code review, on another agent's work. in this case "hiding" the reviewer's agents.md is a desired feature.

  11. 1 remaining item

  12. maxwellb commented on Aug 5, 2026

    @maxwellb

    whatever is picked. it must support different agents.md for different agents. you might have an agent (harness and model) doing code review, on another agent's work. in this case "hiding" the reviewer's agents.md is a desired feature.

    So, at the repository level, instead of AGENTS.md we should have CLAUDE.md, GEMINI.md, CODEX.md, etc.?

    Maybe that desire should be a separate proposal for how AGENTS.md can support instructions per agent. I strongly believe a user-level AGENTS.md file should still be an AGENTS.md file.

  13. imaitland commented on Aug 5, 2026

    @imaitland

    So, at the repository level, instead of AGENTS.md we should have CLAUDE.md, GEMINI.md, CODEX.md, etc.?

    No, what happens at the repo level is not part of this question. This is about the "global user-level".

    Maybe that desire should be a separate proposal for how AGENTS.md can support instructions per agent.

    Same, as above, not part of this. Repo/Project scoped ambient context is a different beast. (imo).

    I strongly believe a user-level AGENTS.md file should still be an AGENTS.md file.

    Yes, but the agents have already bifurcated and will likely continue to do that as it's related to their businesses. The standard can resist this, but cannot go back in time. Or rather the standard can codify this sufficiently to allow others to play in this space. Something adopting this comment would do: #91 (comment)

    Indeed that's what that spec is for - "we know config will be flying around, here's how we can manage that..."

    For example, adopting the XDG spec would allow users to manage ambient context (e.g. skills, instructions) across agents (e.g. Claude Code skills, available in Codex, available in Pi), using established paradigm from Unix land like Stow (https://www.gnu.org/software/stow/manual/stow.html), something I've proposed in my implementation of botfile here: https://botfile.org/

  14. gameroman commented on Aug 5, 2026

    @gameroman

    The main difference between repo-level config and global config is repo-level config is usually shared between many people, which means standardising it is more important

    global config is only used by yourself, which means you can have several different configs or one shared config for different coding agents

  15. imaitland commented on Aug 5, 2026

    @imaitland

    The main difference between repo-level config and global config is repo-level config is usually shared between many people, which means standardising it is more important

    It's less important at the repo level because you can just commit it... it's the opposite of a standardization problem. Any agent can understand anything as long as it's text... no different from anything else you include in a codebase...

    global config is only used by yourself, which means you can have several different configs or one shared config for different coding agents

    As i've mentioned and as you'll discover if you look at the proprietary agents, they actively don't want to adopt standards or conventions for ambient context at the global/user scope because making it hard to move from claude-code to codex is in their interest. The agents do this to varying degrees and in different ways.

    Global config is used by myself across devices, across agents. Furthermore, coding conventions, standards, common workflows encoded in ambient context that I want to share, are characterized by generality, ergo - extra project scope. ymmv. checkout botfile.org.

  16. ZikrieHR commented on Sep 21, 2026

    @ZikrieHR

    @C:\Users\zonap\AppData\Local\Temp\opencode\issue91-comment.md

  17. sparr commented on Oct 3, 2026

    @sparr

    This proposal should distinguish between "global" and "user".

    ~/.config/agents/ is user level
    /etc/agents/ is global

  18. doctorjei commented on Oct 23, 2026

    @doctorjei

    To throw another wrench: proper agents are more than just the "AGENTS.md" file, which is sort of like a mini post-system prompt after all. The tools, endpoint, dialect... these are all part of the "agent".

    Whatever standard comes (if it does), it would be nice if it doesn't stuff the directives / auto-loaded context in the root of an "agents" folder, or we'll end up with similar problems of a bunch of littered files. And that will be worse, because sandboxing the AGENTS.md file (and related files) is going to be harder if random config files are scattered in the directory, too (and if there isn't a place designated for config info about the other aspects of agents, some developers wil absolutely toss everything in .config/agents).

    Maybe something like this?

    ~/.config/agents/
                |---- directives/
                |            |---- AGENTS.md
                |            `---- <other agent instructions / scripts / etc>
                |---- definitions/  # ("personas", "endpoints", something like that)
                `---- tools/ # (Claude Code, Codex, OpenCode, etc.)
    

    Alternatively, it may be that ~/.agents is the right answer for directives, while tools and definitions (true "config") belong in ~/.config. The directives aren't really the same app-specific directories littering your home directory, because (presumably) ~/.agents would be for all agent variants to share - it's more like "Documents", but for agents than like ".claude" or ".guthub". And what would leave ~/.config/agents for agent definition, tools, etc.:

    ~/.agents/
        |---- AGENTS.md
        `---- <other agent instructions / scripts / etc>
    
    ~/.config/agents/
                `---- <definitions>
    
    ~/.config/claude/
                `---- <claude files>
    
    ~/.config/codex/
                `---- <codex files>
    
  19. BenoitBotton commented on Nov 16, 2026

    @BenoitBotton

    This proposal should distinguish between "global" and "user".

    ~/.config/agents/ is user level /etc/agents/ is global

    yes, but /etc/ doesn't exist on all operating systems.

  20. sparr commented on Nov 16, 2026

    @sparr

    ~ also doesn't exist on all operating systems.

    some global configuration location exists on all the operating systems we probably care about.

    Linux has /etc
    BSD has /etc
    MacOS has /etc
    Windows has C:\ProgramData\ or C:\Documents and Settings\All Users\Application Data

  21. JohnLudlow commented on Nov 20, 2026

    @JohnLudlow

    ~ also doesn't exist on all operating systems.

    ~ exists in PowerShell as a magic alias to the user profile folder (c:\Users\<USERNAME>). A lot of the user config files end up in that folder - for example c:\Users\<USERNAME>\.agents

    But note that ~ is purely a PowerShell thing - other applications don't understand that alias.

  22. forgottenlab commented on Nov 27, 2026

    @forgottenlab

    I'd like to share some practical experience with this problem.

    I've been using Codex across multiple long-running projects and maintaining a global AGENTS.md to avoid repeating the same engineering instructions in every repository.

    Initially, keeping everything in one file worked well. However, as I encountered recurring problems with instruction adherence, task boundaries, verification, and session continuity, I gradually added more rules. Eventually, maintaining a single large instruction file became a problem of its own.

    I moved toward a modular structure: a relatively stable entry file, with supporting instruction files that the agent reads when relevant to the task.

    More recently, when adapting my workflow to Grok Build, I encountered another problem. Most of my engineering rules were still applicable, but the instruction discovery mechanisms, directory structures, and some client-specific behaviors were different.

    Simply copying the existing configuration would mean maintaining multiple versions of essentially the same rules.

    My current workaround is to maintain a common source of instructions and use a PowerShell installer to generate client-specific configurations. Codex and Grok Build currently share seven supporting rule modules, while retaining their own entry files and native discovery mechanisms.

    This experience makes me think that standardizing the user-level instruction location would be a valuable first step, but the location alone would not completely solve the portability problem.

    I would also like the standard to consider:

    • Shared user-level instructions alongside optional client-specific instructions.
    • A predictable mechanism for referencing supporting instruction files, including relative path resolution.
    • Clear discovery and precedence rules for shared, client-specific, and project-level instructions.
    • A way for users to inspect which instruction sources are actually active.

    I don't expect every agent to behave identically or support exactly the same capabilities. I'd just like to avoid maintaining multiple copies of the same engineering conventions whenever I adopt another agent.

    For anyone interested in the implementation details, I've made my current workaround public: https://github.com/forgottenlab/codex-agents-playbook

    It's still an evolving, Windows-oriented personal workflow rather than a proposed standard or a universally compatible solution. I'm sharing it primarily as a practical example of the problems that a common user-level instruction convention could help address.

  23. FranklinYu commented on Dec 3, 2026

    @FranklinYu

    The Agent Skills spec and actual client implementations for skill paths have already mostly converged on .agents/skills, so I think that's reason enough to use .agents/AGENTS.md. I don't think it makes much sense to have them live separately.

    While I agree with this, I would propose a longer term project to migrate everything (including skills) to the XDG directory.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions