Include dotfiles in @-file search suggestions

Resolved 💬 4 comments Opened Aug 28, 2025 by mkusaka Closed Sep 19, 2025
💡 Likely answer: A maintainer (mkusaka, contributor) responded on this thread — see the highlighted reply below.

What feature would you like to see?

  • Show files and directories that start with a dot (e.g., .github, .env, .vscode) in the suggestions when using the "@" file search.
  • Keep honoring .gitignore (and related ignore files) exactly as today; do not surface files that Git ignores.
  • It might be helpful to make this configurable (global and/or per-project), e.g., a toggle to include hidden files.

Are you interested in implementing this feature?

Yes. I can implement it.

Additional information

The @ search in the UI goes through codex-rs/file-search and uses ignore::WalkBuilder, which already honors .gitignore. Hidden files are excluded by default; this request is to optionally include them without changing .gitignore semantics.

View original on GitHub ↗

4 Comments

kantorcodes · 12 months ago

My 2 cents: this seems like a bad idea given the recent exploit in NX.

mkusaka contributor · 12 months ago

Thanks for the suggestion — and for the Nx heads-up. I share the concern the incident highlights, but the core risk is the ability for tools/models to read sensitive files (e.g., .env), not merely having them appear in suggestions. That is better addressed with model/tool-sideprotections like the proposal in #2847.

For this issue, the scope is simply to include dotfiles in @-file suggestions while continuing to honor .gitignore exactly as today. If #2847 (or a similar guard) is adopted, aligning suggestions with that policy would be a sensible follow-up.

adv0r · 11 months ago

UP. I would love codex to help with github actions

mkusaka contributor · 11 months ago

In 0.39.0 I confirmed that the “@” search now shows dot-prefixed entries such as .github/.

<img width="491" height="439" alt="Image" src="https://github.com/user-attachments/assets/0b8b1d96-ab71-49ea-b5d5-23b0237fe064" />

I also verified that .gitignore and other ignored files are not suggested, so the original request is satisfied and I’ll close this issue.

Ideally we wouldn’t surface metadata under .git, but typing @.git still brings up entries like .git/COMMIT_EDITMSG and .git/FETCH_HEAD, so I’d suggest tracking that separately in another issue.

<img width="309" height="167" alt="Image" src="https://github.com/user-attachments/assets/556aeffc-ad16-4593-a146-919dcc0966ce" />