handle node_modules dir correctly
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.
Codex continues to list all files including node_modules, in a variety of ways, despite being told in CODEX.md not to.
The only way I have stopped it from doing this so far is to tell it at the very beginning to always use tree --gitignore for file listings.
If Codex could respect .gitignore that'd save many tokens!
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