Bug: @ file picker surfaces .git refs/logs entries
Problem
@ file picker suggestions include Git internal reference/log files (for example .git/refs/... and .git/logs/refs/...).
This is confusing because the picker is expected to show project files intended for code context, not VCS internals.
Environment
- Codex Desktop:
26.228.1430 (760) - Codex CLI:
0.106.0 - OS:
macOS 26.3 (25D125) - Architecture:
arm64
Reproduction
- Open Codex in any Git repository that has local or remote branches.
- In the prompt input, type
@followed by a partial term matching a branch-like token (for example a feature name segment). - Observe suggestions/results.
Actual Behavior
Suggestions include entries under:
.git/refs/....git/logs/refs/...
Expected Behavior
@ file picker should exclude Git internals and only show relevant workspace files.
Action Plan
- [ ] Confirm whether file picker is bypassing ignore rules for hidden/VCS directories.
- [ ] Ensure
.git/**is excluded across CLI, desktop app, and extension for consistent behavior. - [ ] Add regression tests for
@completion/search with repositories containing refs/logs.
Acceptance Criteria
- [ ]
@suggestions never include.git/**entries. - [ ] Project files remain searchable as before.
- [ ] Behavior is consistent across Codex surfaces.
Additional confirmation: reproducible in Codex CLI as well.
Environment:
- Codex CLI:
0.106.0
Observed behavior in CLI @ suggestions:
.git/refs/heads/....git/logs/refs/heads/....git/filter-repo/...
Example repro in CLI:
- Open any Git repository with multiple branches.
- Type
@utils(or another token matching branch/file-like text). - Suggestions include
.git/**entries instead of only workspace source files.
Still an issue in 0.110.0, in the TUI, and has been an issue for a long time now. I've stopped using this feature entirely because of it
E: Does not seem to respect .gitignore, .rgignore, etc, it used to do this at some point
I have the same issue on codex-cli 0.145.0
(response from codex)
Thanks for the report. The @ picker searches hidden directories by design so you can mention project files like .github/workflows/ci.yml. We chose to include all dot-directories, which also makes Git refs and reflogs searchable. I reproduced the reported results and confirmed that the picker respected .gitignore.
To hide Git internals, add .git on its own line to a .ignore file at the repository root. I verified that this removed the ref and reflog from the results while keeping the matching source file and GitHub workflow searchable.
I’m closing this as working as designed.