codex - 💡(How to fix) Fix [Feature Request] .codexignore/.aiignore file or ignoring paths in config.toml

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Fix Action

Fix / Workaround

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.
RAW_BUFFERClick to expand / collapse

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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING