[Feature Request] .codexignore file
Resolved 💬 7 comments Opened Apr 17, 2025 by jonasry Closed Aug 7, 2025
💡 Likely answer: A maintainer (lostmygithubaccount, contributor)
responded on this thread — see the highlighted reply below.
Add support for removing files and path from codex.
Intended use is to prevent files that contain sensitive data from being sent to the AI model. For example test files with sensitive input data for testing.
The .codexignore file is similar to a .gitignore file and contains paths that aren't read/updated by the AI.
7 Comments
Also useful for ignoring things like dependency lock files. My
pdm.lockis adding ~10k tokens to the context that aren't relevant to codex but I don't want it in .gitignore either.Not sure if this can be solved by setting this as an instruction in AGENTS.md. If smn can confirm.
deterministic solutions are always preferable
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 here.I have worktree directories showing up the
@file dropdown that should be ignored but i don't see a way to add those to not show up in the list<img width="624" height="143" alt="Image" src="https://github.com/user-attachments/assets/7935a58a-6648-4fd2-997c-6ca2c7d9a545" />
Jetbrains IDEs have support for
.aiignorefiles. You can create one in root dir of your project and use codex through their chat plugin and the model should respect the file. I've added all env varibles,.pemfiles, secrets, etc. in and it seems to work right now.Would be great to see codex adopt this standard.
The fact that codex supports
llms.txtbut refuses to implement support for an.aiignoreis just silly.Why has this issue been closed as completed? It doesn't seem like this feature is supported.