@ file autocomplete should include gitignored files
What is the problem?
When using @ file references in Codex CLI / Codex Desktop, files ignored by .gitignore do not appear in the autocomplete suggestions.
The file can still be a valid user-intended local context file, especially for files that are intentionally untracked or local-only (for example generated local config, notes, scratch files, environment-specific files, or ignored fixtures). Without autocomplete, users have to type the path manually and it looks like Codex cannot reference the file.
Version
- Codex CLI:
codex-cli 0.142.0-alpha.6 - Codex Desktop bundled CLI/app-server:
codex-cli 0.142.0-alpha.6 - Platform: macOS arm64
Reproduction
- Create or open a git repository.
- Add a file that is ignored by
.gitignore, for example:
``sh``
echo 'local-only.txt' >> .gitignore
echo 'hello' > local-only.txt
- Start Codex CLI or Codex Desktop in that repository.
- Type
@localin the composer.
Actual behavior
local-only.txt is not shown in @ file autocomplete suggestions.
Expected behavior
local-only.txt should be shown as an explicit @ file reference candidate, even though it is ignored by git.
Why this matters
Git ignore rules are useful for excluding files from version control, but they should not necessarily hide files from explicit user selection in a chat composer. If the user types @..., they are intentionally trying to attach or reference a local file. Autocomplete should help with that explicit action.
Possible cause
From a local source inspection of rust-v0.142.0-alpha.6, the file search implementation supports FileSearchOptions { respect_gitignore: false, ... }, but the TUI FileSearchManager and app-server fuzzy file search paths appear to use the default options, where respect_gitignore defaults to true.
Relevant areas appear to be:
codex-rs/tui/src/file_search.rscodex-rs/app-server/src/fuzzy_file_search.rscodex-rs/file-search/src/lib.rs
A scoped fix may be to keep the default behavior for generic codex-file-search, but set respect_gitignore: false for interactive @/fuzzy file selection surfaces.