Skip to content

Feature Request: Allow uncommitted AGENTS files #13

Open

Description

@yordis

Context

As a programmer, I want an AGENTS file that can be safely excluded from version control, so I can manage my personal context settings for a given project.

Solution

Add AGENTS.local.md to the specification

Alternatives

We have directory support #9 where we can decide the format of the file and ignore it

Prior Art:

Activity

  1. yordis commented on Jan 4, 2026

    @yordis
    Author

    @Matan-Yadaev-Forter it seens that the link is broken, do you know where the new link suppose to point to?

  2. mattrossman commented on Feb 4, 2026

    @mattrossman

    CLAUDE.local.md is mentioned in the docs here: https://code.claude.com/docs/en/memory#claude-md-imports

    For private per-project preferences that shouldn’t be checked into version control, prefer CLAUDE.local.md: it is automatically loaded and added to .gitignore.

  3. davidmyersdev commented on Mar 15, 2026

    @davidmyersdev

    The Claude Code docs no longer mention CLAUDE.local.md files. Instead, the recommended approach seems to be using the @ file-import syntax (e.g. add a line with @CLAUDE.local.md to CLAUDE.md). These files get loaded automatically when Claude Code starts up if they are present, and they can then be added to your .gitignore (e.g. *.local.md). I would love to see a similar syntax added to AGENTS.md. It seems like a more comprehensive approach to this problem.

  4. Pjrich1313 commented on Mar 15, 2026

    @Pjrich1313
  5. hashlash commented on Apr 14, 2026

    @hashlash

    The Claude Code docs no longer mention CLAUDE.local.md files.

    Per 2026-04-09 they've added it back 🤔

  6. HaleTom commented on Jun 18, 2026

    @HaleTom

    Proposal: Formalize AGENTS.local.md in the Specification

    Problem

    AGENTS.md is committed to version control and shared across teams. Individual developers need a place for personal, machine-local, or role-scoped instructions that should not be committed:

    • Personal coding style preferences (e.g., "I prefer verbose test output")
    • Local environment paths and ports
    • Tool-specific overrides (e.g., "never run npm run dev for me")
    • Temporary experiment flags or debug instructions

    Without a standard convention, each tool implements its own ad-hoc solution, fragmenting the ecosystem. This issue has 22 reactions and Issue #72 has 8 more — the demand is clear.

    Current Fragmentation

    Tools are already implementing this independently:

    Tool Status
    Claude Code CLAUDE.local.md (prior art, in official docs)
    Roo Code Merged PR #11183 for AGENTS.local.md
    OpenCode Issue #16110 for .local.md support
    MUI X Ships AGENTS.local.md.template
    Codex hooks samzong/codex-agents-local workaround

    Without spec-level guidance, each tool will implement semantics differently (additive vs override, standalone-allowed vs base-required, etc).

    Proposed Spec Addition

    Naming Convention

    For any instruction file FOO.md, the local variant is FOO.local.md:

    Base file Local variant
    AGENTS.md AGENTS.local.md
    AGENTS.md (in src/) AGENTS.local.md (in src/)

    Semantics

    1. Additive merge: When both AGENTS.md and AGENTS.local.md exist in the same directory, agents MUST load both. Local content is appended after base content.
    2. Local-only is valid: AGENTS.local.md MAY exist without a corresponding AGENTS.md. It stands alone in that case.
    3. Precedence: In case of conflicting instructions, AGENTS.local.md takes precedence over AGENTS.md (last-wins, same as nested directory overrides).
    4. Gitignore: *.local.md SHOULD be added to .gitignore. Repos MAY ship a .gitignore entry or a template file.

    Updated Scope Resolution Order

    ~/.agents/AGENTS.md              ← Global base
    ├── .agents/AGENTS.md            ← Project base (committed)
    ├── AGENTS.md                    ← Project active (committed)
    ├── AGENTS.local.md              ← Project local (gitignored)
    │   ├── src/AGENTS.md            ← Folder rules (committed)
    │   └── src/AGENTS.local.md      ← Folder local (gitignored)
    

    Local files are loaded immediately after their same-directory base counterpart.

    Why .local.md over alternatives

    Alternative Why not
    AGENTS.override.md Implies full replacement, not additive. Users want to extend, not replace.
    Directory-based (.agents/local.md) Loses the 1:1 mapping with base files in nested directories.
    @import syntax Requires parser changes in every agent. .local.md is zero-config.
    Env vars / config fields Not file-based; harder to discover and version locally.

    The .local.md convention is already established by Claude Code, Vite (.env.local), ESLint (.eslintrc.local.*), and MUI X.

    Implementation Guidance for Agent Authors

    1. After loading FOO.md from a directory, check for FOO.local.md in the same directory.
    2. If found, append its content (with a separator) after the base content.
    3. Apply the same precedence rules: local overrides base for conflicting instructions.
    4. No schema changes required — both files are plain Markdown.

    Template for Repos

    Repos MAY ship an AGENTS.local.md.template (committed) that developers copy to AGENTS.local.md (gitignored):

    <!-- Copy to AGENTS.local.md — this file is gitignored -->
    <!-- Add your personal preferences below -->
    
    ## My Preferences
    - (add your local instructions here)

    Happy to contribute a PR for this if the maintainers are open to it.

  7. maxwellb commented on Aug 5, 2026

    @maxwellb

    Just dropping in.

    This sounds like a good place for XDG Base Directories: $XDG_CONFIG_HOME/agents/AGENTS.md plus any of $XDG_CONFIG_DIRS/agents/AGENTS.md.

    Thank you for your consideration.

    EDIT: Please see #91 as a possible resolution to this proposal.

  8. jhm-ciberman commented on Aug 26, 2026

    @jhm-ciberman

    This needs to be standardized. Managing local rules is impossible with current standards.

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