handle node_modules dir correctly
Resolved 💬 7 comments Opened Apr 16, 2025 by danielj86 Closed Aug 7, 2025
By default, Codex should ignore the node_modules directory when indexing code or listing files. It should only access node_modules when explicitly requested by the user.
7 Comments
Closing #102 as we seemed to create these at the same time @danielj86 😅
I think a generall feature, like a .codexignore file that list all folders, files, the ai should not use would be helpful and save tons of tokens.
Agreed, this is also an issue in Rust crates with the "targets" build directory. I would also expect the .git directory to be ignored by default.
Yes, .codexignore is a must have.
Addressed by #206
Some paths are hatdcoded to be ignored:
https://github.com/openai/codex/blob/82f5abbeea54b172fab29eb87bc9d15dab36c2a9/codex-cli/src/utils/singlepass/context_files.ts#L95
Thanks for the feedback! Please try the latest version of Codex CLI to see if this issue persists. If it does, feel free to open a PR or report it in the
codex-rs/implementation. We're primarily focused on the native/Rust implementation now. More details here: https://github.com/openai/codex/discussions/1174