Codex CLI: file references report 'no matches' even for existing files in CWD
Resolved 💬 3 comments Opened Dec 30, 2025 by vforsh Closed Dec 30, 2025
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
Problem
In Codex CLI I try to reference files that definitely exist in the current working directory / repo, but Codex responds with "no matches".
Examples
- In a repo where
src/GameScaler.tsexists, attempting to reference it via@GameScalerin chat yields "no matches".
Expected behavior
- When a user references an existing file path (relative to repo root or CWD), Codex should resolve it and include it as context (or at minimum provide a clear error explaining the required syntax / root).
Actual behavior
- Codex replies with "no matches" even though the file exists.
Environment
- Product: Codex CLI
- Version:
codex-cli 0.77.0 - OS: macOS 15.5 (24F74), arm64
- Terminal: Ghostty 1.2.3
3 Comments
Is the target file included in a
.gitignore? If so, that's covered by https://github.com/openai/codex/issues/2952.Otherwise, this appears to be a duplicate of https://github.com/openai/codex/issues/3493.
Findings: /mention file search was only returning 2 files because global gitignore (~/.gitignore) contains '' which ignores everything. ignore crate logs show entries skipped with source /Users/vlad/.gitignore pattern ''. Removing the '' line restores full traversal. Debug line example: "ignore::walk: ignoring … Gitignore(Glob { from: Some("/Users/vlad/.gitignore"), original: "", actual: "**/*" })". For local repro, set RUST_LOG=codex_file_search=debug,ignore=debug and check ~/.codex/log/codex-tui.log. Root cause is user-level gitignore, not TUI.
More detail / fix steps:
ignore::walk: ignoring … Gitignore(Glob { from: Some("/Users/vlad/.gitignore"), original: "", actual: "*/*" }).
How to confirm:
How to fix:
Potential product hardening (optional): consider disabling global gitignore (git_global=false) for /mention file search, or add a fallback when file_entries is suspiciously low.