@ is not listing the available files #4074

Open
opened 2026-02-16 17:42:31 -05:00 by yindo · 9 comments
Owner

Originally created by @flexdinesh on GitHub (Jan 1, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

I'm coming back to opencode after a few weeks. @ used to autocomplete available files in the dir. It's not doing that anymore. It's only showing available agents.

In my dir, I have .ai/prompts/init.md. I am not able to lookup that filepath in the tui input.

Image

OpenCode version

1.0.223

Operating System

macOS 26.1

Terminal

Ghostty

Originally created by @flexdinesh on GitHub (Jan 1, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description I'm coming back to opencode after a few weeks. `@` used to autocomplete available files in the dir. It's not doing that anymore. It's only showing available agents. In my dir, I have `.ai/prompts/init.md`. I am not able to lookup that filepath in the tui input. <img width="2106" height="536" alt="Image" src="https://github.com/user-attachments/assets/7f026f4b-1c0a-4731-ac91-69d82d29ec56" /> ### OpenCode version 1.0.223 ### Operating System macOS 26.1 ### Terminal Ghostty
yindo added the opentuibug labels 2026-02-16 17:42:31 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 1, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #2772: File search via @ symbol is very slow in large projects, possibly due to lack of debounce
  • #3734: CJK characters break some features like @ mentions
  • #5820: Autocomplete dropdown conflicts with permission dialog (related to autocomplete functionality)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 1, 2026): This issue might be a duplicate of existing issues. Please check: - #2772: File search via @ symbol is very slow in large projects, possibly due to lack of debounce - #3734: CJK characters break some features like `@` mentions - #5820: Autocomplete dropdown conflicts with permission dialog (related to autocomplete functionality) Feel free to ignore if none of these address your specific case.
Author
Owner

@flexdinesh commented on GitHub (Jan 2, 2026):

I just checked in other projects. @ works and shows up file path suggestions in other projects. For some reason it's not working in this particular project. If it helps, this project has not be initialised as a git repo yet.

@flexdinesh commented on GitHub (Jan 2, 2026): I just checked in other projects. `@` works and shows up file path suggestions in other projects. For some reason it's not working in this particular project. If it helps, this project has not be initialised as a git repo yet.
Author
Owner

@flexdinesh commented on GitHub (Jan 4, 2026):

I initialised the project into a git repo and now the files autocomplete when using @. Is this by design?

@flexdinesh commented on GitHub (Jan 4, 2026): I initialised the project into a git repo and now the files autocomplete when using `@`. Is this by design?
Author
Owner

@abeisleem commented on GitHub (Jan 10, 2026):

It could be a side-effect of the mechanism to ignore files in .gitignore. You could argue it's a security feature as well since typically, .env files are git-ignored.

Try it your self. Add a file to .gitignore and it will no longer show in the suggested files.

@abeisleem commented on GitHub (Jan 10, 2026): It could be a side-effect of the mechanism to ignore files in .gitignore. You could argue it's a security feature as well since typically, `.env` files are git-ignored. Try it your self. Add a file to `.gitignore` and it will no longer show in the suggested files.
Author
Owner

@flexdinesh commented on GitHub (Jan 11, 2026):

But non git repos don't have a .gitignore right? Should the harness still ignore all files if the dir is not a git repo?

@flexdinesh commented on GitHub (Jan 11, 2026): But non git repos don't have a `.gitignore` right? Should the harness still ignore all files if the dir is not a git repo?
Author
Owner

@Yimi81 commented on GitHub (Jan 22, 2026):

@abeisleem how can i fix this side effect while keeping the .gitignore file unchanged? I hope to have the ability to @ all files.

It could be a side-effect of the mechanism to ignore files in .gitignore. You could argue it's a security feature as well since typically, .env files are git-ignored.

Try it your self. Add a file to .gitignore and it will no longer show in the suggested files.

@Yimi81 commented on GitHub (Jan 22, 2026): @abeisleem how can i fix this side effect while keeping the .gitignore file unchanged? I hope to have the ability to @ all files. > It could be a side-effect of the mechanism to ignore files in .gitignore. You could argue it's a security feature as well since typically, `.env` files are git-ignored. > > Try it your self. Add a file to `.gitignore` and it will no longer show in the suggested files.
Author
Owner

@edward821220 commented on GitHub (Jan 27, 2026):

same issue
I can't mention files

Adding a .gitignore file still achieves the same result.

@edward821220 commented on GitHub (Jan 27, 2026): same issue I can't mention files Adding a .gitignore file still achieves the same result.
Author
Owner

@abeisleem commented on GitHub (Jan 28, 2026):

The file system is designed to work with version-controlled projects and expects ignore patterns to be present.

A workaround would be to create a minimal .gitignore/.ignore in the root dir

touch .gitignore

# OR

touch .ignore

More technical details:

In packages/opencode/src/file/index.ts, the list() function checks if the project is a git repository and loads .gitignore/.ignore files to filter results packages/opencode/src/file/index.ts. When no .gitignore exists, the ignore logic may not be handling the empty case properly.

Tangentially, there's also:

  1. packages/opencode/src/file/ignore.ts which ignores files that are typically ignored.
  2. packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx which is responsible for autocomplete functionality.

And I'm not sure how the maintainers feel about not following this pattern for security (and maybe even context bloating) purposes. Naively tagging: @rekram1-node? I'd be happy to work a PR for this if you deem this behavior is worth supporting.

@abeisleem commented on GitHub (Jan 28, 2026): The file system is designed to work with version-controlled projects and expects ignore patterns to be present. A workaround would be to create a minimal `.gitignore`/`.ignore` in the root dir ``` bash touch .gitignore # OR touch .ignore ``` ___ **More technical details:** In `packages/opencode/src/file/index.ts`, the `list()` function checks if the project is a git repository and loads `.gitignore`/`.ignore` files to filter results [packages/opencode/src/file/index.ts](https://github.com/anomalyco/opencode/blob/9a8da20a97387b8279229c4fc83c39789a11d534/packages/opencode/src/file/index.ts#L326C3-L342C1). When no `.gitignore` exists, the ignore logic **may not be handling the empty case properly**. Tangentially, there's also: 1. [packages/opencode/src/file/ignore.ts](https://github.com/anomalyco/opencode/blob/d75dca29/packages/opencode/src/file/ignore.ts#L4-L58) which ignores files that are typically ignored. 2. [packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx](https://github.com/anomalyco/opencode/blob/d75dca29/packages/opencode/src/cli/cmd/tui/component/prompt/autocomplete.tsx#L218-L220) which is responsible for autocomplete functionality. And I'm not sure how the maintainers feel about not following this pattern for security (and maybe even context bloating) purposes. Naively tagging: @rekram1-node? I'd be happy to work a PR for this if you deem this behavior is worth supporting.
Author
Owner

@edward821220 commented on GitHub (Jan 30, 2026):

I resoved it by brew install ripgrep

@edward821220 commented on GitHub (Jan 30, 2026): I resoved it by `brew install ripgrep `
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4074