Skip to content

@ is not listing the available files #6618

Closed

Description

@flexdinesh

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Jan 2, 2026
  2. github-actions commented on Jan 2, 2026

    @github-actions
    Contributor

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

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

  3. flexdinesh commented on Jan 2, 2026

    @flexdinesh
    Author

    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.

  4. flexdinesh commented on Jan 5, 2026

    @flexdinesh
    Author

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

  5. abeisleem commented on Jan 10, 2026

    @abeisleem

    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.

  6. flexdinesh commented on Jan 12, 2026

    @flexdinesh
    Author

    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?

  7. Yimi81 commented on Jan 22, 2026

    @Yimi81

    @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.

  8. edward821220 commented on Jan 28, 2026

    @edward821220

    same issue
    I can't mention files

    Adding a .gitignore file still achieves the same result.

  9. abeisleem commented on Jan 28, 2026

    @abeisleem

    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.

  10. edward821220 commented on Jan 30, 2026

    @edward821220

    I resoved it by brew install ripgrep

  11. Wiktor102 commented on Feb 27, 2026

    @Wiktor102

    I've encountered the same issue when working in a git repo with a defined .gitignore. If I delete it, the autocompletion suddenly starts working and keeps working for a short while after reverting the file. Then it stops working again.

  12. cyf007-lab commented on Mar 24, 2026

    @cyf007-lab

    这可能是忽略 .gitignore 文件的机制的副作用。你可能会认为它通常也是一种安全功能,.env文件已被点亮。

    你自己试试。添加一个文件.gitignore并且将不再显示在建议文件中。

    It may not be related to the Git repository. I am on another computer and have not installed Git, so naturally I do not have a Git repository. However, I can still use @ to query all files in the current working directory.
    On this computer, it was initialized as a Git repository and a. gitignore file was created, but no files could be searched; Of course, I deleted the Git repository, but the problem still persists

  13. MartyLake commented on Mar 24, 2026

    @MartyLake

    Hey, I wished on non-git repos, that opencode @ just list all files.

  14. cyf007-lab commented on Mar 28, 2026

    @cyf007-lab

    I also encountered the same problem, and now the issue has been resolved.
    There is a problem with a tool called ripgrep (i.e. rg. exe)
    This is a high-performance text search tool that not only affects @ search for the current file, but also affects loading skills
    Rg.exe is located in the "%USERPROFILE%.local\share\opencode\bin" directory
    OpenCode should be able to find it, but I don't know why it can't be found. Just add this path to the system PATH environment variable
    The problem has been solved, but I still don't know why OpenCode can't find this program

  15. removed
    bugSomething isn't working
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  16. LOYINuts commented on Jun 11, 2026

    @LOYINuts

    same

  17. darukutsu commented on Jun 13, 2026

    @darukutsu

    This is mentioned in docs already https://opencode.ai/docs/tools/#ignore-patterns
    I had .gitignore and since ripgrep respects it, it won't autocomplete files. Workaround is to create .ignore too with content !*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions