[Feature Request] .codexignore/.aiignore file or ignoring paths in config.toml

Open 💬 3 comments Opened May 29, 2026 by dibstern

What variant of Codex are you using?

App, CLI, Web, IDE Extension

What feature would you like to see?

Add support for specifying paths and files for codex agents to ignore, using e.g. a .codexignore or .aiignore file, or in the config.toml.

Intended use is to prevent files that contain:

  • sensitive data
  • data that might bias AI responses but which are helpful to be versioned (e.g. to show progress or store results for skill development, iterating on prompts, etc.)

Current workarounds are incomplete and unreliable:

  1. Ask agent to respect it in AGENTS.md, but this is easily ignored.
  2. Use a PreToolUse hook with a custom script to attempt to reliably read the tool use and the file path, but (a) there are various ways to not correctly catch reads since Codex reads via shell tools and not a built in Read tool, and (b) agents may try to work around the script.

This has been a user frustration for a while now:

I am writing this since https://github.com/openai/codex/issues/205 was closed as "completed", by what looks like a mistaken agent advising to check if it was now supported (it is not):

Thank you for the feedback! Please try the latest version of Codex CLI to see if this feature is supported. If not, we encourage you to contribute to the codex-rs/ implementation. More details on our project update can be found https://github.com/openai/codex/discussions/1174.

Additional information

_No response_

View original on GitHub ↗

3 Comments

PaulRBerg · 2 months ago

This would be helpful for ignoring these pestering .claude/ symlinks I need to have because Anthropic dugs in its heels and refuses to support AGENTS.md and .agents/

<img width="1488" height="422" alt="Image" src="https://github.com/user-attachments/assets/1d66f06b-cd59-4ada-9cb2-0ebff153eae5" />

garogarabed12 · 2 months ago

Exactly the problem I've been trying to solve, and the reason a .codexignore specifically makes it worse, not better.

Every tool shipping its own name (.codexignore, .clineignore, .geminiignore, .cursorignore) means developers maintain N files for N agents. This has been raised multiple times (https://github.com/openai/codex/issues/2847, with https://github.com/openai/codex/issues/6530 as a duplicate, https://github.com/agentsmd/agents.md/issues/33, just to name a few) and still unresolved.

I put together a vendor-neutral RFC for this: .agentignore - same gitignore syntax, one file designed to work across tools: https://github.com/garogarabed12/agentignore

Full spec in RFC-0001.md. Would love to see Codex adopt .agentignore instead of a Codex-specific name.

Happy to answer any questions! 😄

PaulRBerg · 2 months ago

@garogarabed12 that's a good proposal

My vote, however, goes to .agentsignore (plural agents, not singular .agent), because:

  • Consistency with AGENTS.md and .agents
  • It matches what happens in practice (that is, multiple agents running in parallel)