You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Also useful for ignoring things like dependency lock files. My pdm.lock is adding ~10k tokens to the context that aren't relevant to codex but I don't want it in .gitignore either.
Reacted by Amr Nabil, Dae, Tomaz Strukelj, rov and Mario Rios
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.
Jetbrains IDEs have support for .aiignore files. 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, .pem files, 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.txt but refuses to implement support for an .aiignore is just silly.
Activity
caleb-harrelson commentedon May 21, 2025
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.amrnali commentedon Jun 14, 2025
Not sure if this can be solved by setting this as an instruction in AGENTS.md. If smn can confirm.
lostmygithubaccount commentedon Jun 16, 2025
deterministic solutions are always preferable
codex-maintainers commentedon Aug 7, 2025
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.kdawgwilk commentedon Mar 3, 2026
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 listflawnson commentedon Apr 16, 2026
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.PaulRBerg commentedon Jun 18, 2026
Why has this issue been closed as completed? It doesn't seem like this feature is supported.
fix(workflow): bind scratch without Option callsites
face-al commentedon Sep 15, 2026
When its too much AI slop that you dont even review what issue was being opened and closed. Just keep pushing for code.
PaulRBerg commentedon Sep 15, 2026
There's a separate open issue about this feature request, everyone in this thread, please upvote that issue so that it gets more visibility:
#24993
face-al commentedon Sep 15, 2026
Thanks @PaulRBerg !