Skip to content

[Feature Request] .codexignore file #205

Closed

Description

@jonasry

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.

Activity

  1. caleb-harrelson commented on May 21, 2025

    @caleb-harrelson

    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.

  2. amrnali commented on Jun 14, 2025

    @amrnali

    Not sure if this can be solved by setting this as an instruction in AGENTS.md. If smn can confirm.

  3. lostmygithubaccount commented on Jun 16, 2025

    @lostmygithubaccount
    Contributor

    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

  4. codex-maintainers commented on Aug 7, 2025

    @codex-maintainers

    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.

  5. kdawgwilk commented on Mar 3, 2026

    @kdawgwilk

    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

    Image
  6. flawnson commented on Apr 16, 2026

    @flawnson

    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.

  7. PaulRBerg commented on Jun 18, 2026

    @PaulRBerg

    Why has this issue been closed as completed? It doesn't seem like this feature is supported.

  8. face-al commented on Sep 15, 2026

    @face-al

    When its too much AI slop that you dont even review what issue was being opened and closed. Just keep pushing for code.

  9. PaulRBerg commented on Sep 15, 2026

    @PaulRBerg

    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

  10. face-al commented on Sep 15, 2026

    @face-al

    Thanks @PaulRBerg !

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