codex icon indicating copy to clipboard operation
codex copied to clipboard

Search @ cannot search from directories excluded by .gitignore

Open LucasChenZQ opened this issue 1 year ago • 40 comments

What version of Codex is running?

0.25.0

Which model were you using?

gpt-5

What platform is your computer?

Darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

In VS Code IDE plugin, when typing @ to search a file, only files tracked by git can be searched.

The problem is, in many situations I need to wrote scripts, temp function or handling some sample data. Those related files are not supposed to be tracked by git. I usually put them in a git ignored directory, such as playground/, .local/, temp/ .

If it's about security & privacy issue, would it be designed to read git ignored files only when it's commanded?

What is the expected behavior?

Allow @ files even it's not tracked by git.

What do you see instead?

@ action cannot search git ignored files

Additional information

No response

LucasChenZQ avatar Aug 30 '25 15:08 LucasChenZQ

+1 would like the same, or at least a way to configure this. I add a lot of things to .gitignore (such as certain type of .md files) but want to be able to refer to them as these include instructions for an ongoing task.

guidedways avatar Aug 31 '25 16:08 guidedways

I come across the same question, have you solved this problem?

efengshan avatar Sep 20 '25 09:09 efengshan

docs.local/         
└─ Feature.md  

Documentation is ignored in Git, but is needed in AI.

xianghongai avatar Sep 22 '25 07:09 xianghongai

so I wonder have they solved this problem?

efengshan avatar Sep 26 '25 07:09 efengshan

quick note on this: it was sort of a head scratcher for me too until i realized the behavior from https://github.com/openai/codex/pull/206 ; i previously maintained a gitignore in my home directory (dotfiles) and set it up in a way where it would ignore all files by default and i would selectively invert the ignore to pick the files I wanted in my repo.

This had the effect where any repository under ~ would effectively fail to @ mention a file within codex cli, unless it got through that directory .gitinore and the parent .gitignore as it traversed up the home directory.

i fixed my issue by just not having a .gitignore in the parent directory but this behavior is unique to codex cli (other solutions seem to not run into this problem, probably because they only respect .gitignore in current directory and nested ones vs. traversing up the directory tree).

kaushikgopal avatar Oct 17 '25 15:10 kaushikgopal

bump

CarlosCommits avatar Nov 01 '25 02:11 CarlosCommits

bump

@CarlosCommits can you elaborate with a little more effort, what specific issue you're running into? have you tried the workarounds suggested above? what does your current setup look like. a little more info will help provide more insight to the codex team when they look at this issue. As a start, you can try to answer the same questions that LucasChenZQ did at the start of this thread.

kaushikgopal avatar Nov 01 '25 17:11 kaushikgopal

@kaushikgopal there's nothing to elaborate? I'm just saying bump to try to get more attention on this issue. This issue is that Codex currently does not let you @ mention any files that are .gitignored.

CarlosCommits avatar Nov 01 '25 22:11 CarlosCommits

Need too

Molunerfinn avatar Jan 02 '26 01:01 Molunerfinn

bump

jonaswaller avatar Jan 16 '26 03:01 jonaswaller

This is issue is becoming bottleneck for me to continue with codex :(

dheerajawale-svg avatar Jan 19 '26 14:01 dheerajawale-svg

bump

credo-quia-absurdum avatar Jan 26 '26 07:01 credo-quia-absurdum

How is this still not a thing, half a year later? This should be configurable.

cryptochrome avatar Jan 26 '26 23:01 cryptochrome

bump and sunscribe

nk-tedo-001 avatar Jan 29 '26 11:01 nk-tedo-001

I think this might need integration with VS Code APIs. If you see Google antigravity, they are able to mention .gitignore files, mostly because their agent integration with underlying vs code fork.

dheerajawale-svg avatar Feb 06 '26 14:02 dheerajawale-svg

Any updates on this? Are PRs welcome?

danielpiva avatar Feb 12 '26 20:02 danielpiva

Any updates on this? Are PRs welcome?

Doesn't look like it. I am also waiting for it.

dheerajawale-svg avatar Feb 18 '26 04:02 dheerajawale-svg

This is desperately needed. Now i have to do LLM shenanigans and customize workflows just to go around this. Can anyone from OpenAI look into this, please?

ivanjuras avatar Feb 18 '26 07:02 ivanjuras

This needs to be configurable.

wittywolk avatar Feb 21 '26 18:02 wittywolk

+1

guytros avatar Feb 22 '26 13:02 guytros