Feature request: Allow gitignored files in file search #1064

Closed
opened 2026-02-16 17:29:20 -05:00 by yindo · 5 comments
Owner

Originally created by @whaaaley on GitHub (Aug 2, 2025).

Originally assigned to: @thdxr on GitHub.

Right now .gitignore files and dirs are hidden from opencode file search. I often like to save off audits and todo lists in project repos, but not commit them.

As a user... I'd like to be able to re-include specific gitignored files and dirs so I can reference them from the file search.

Originally created by @whaaaley on GitHub (Aug 2, 2025). Originally assigned to: @thdxr on GitHub. Right now `.gitignore` files and dirs are hidden from opencode file search. I often like to save off audits and todo lists in project repos, but not commit them. As a user... I'd like to be able to re-include specific gitignored files and dirs so I can reference them from the file search.
yindo closed this issue 2026-02-16 17:29:20 -05:00
Author
Owner

@Yrds commented on GitHub (Aug 16, 2025):

opencode uses rg to file search. As as workaround you can use RIPGREP_CONFIG_PATH to configure search function. For example, I'm using this in my project:

Create a file named .rgrc file with the following option in your project root:

--no-ignore-vcs

Then open opencode with:

RIPGREP_CONFIG_PATH=.rgrc opencode

Now you can search for gitignored files.

In my opinion it might be better yet to support .rgrc (this is just a very common filename used by ripgrep users so it's just a suggestion). That way, users can customize file search beyond just allowing .gitignore files.

@Yrds commented on GitHub (Aug 16, 2025): opencode uses `rg` to file search. As as workaround you can use `RIPGREP_CONFIG_PATH` to configure search function. For example, I'm using this in my project: Create a file named `.rgrc` file with the following option in your project root: ``` --no-ignore-vcs ``` Then open opencode with: ```bash RIPGREP_CONFIG_PATH=.rgrc opencode ``` Now you can search for gitignored files. In my opinion it might be better yet to support `.rgrc` (this is just a very common filename used by ripgrep users so it's just a suggestion). That way, users can customize file search beyond just allowing .gitignore files.
Author
Owner

@thdxr commented on GitHub (Aug 16, 2025):

/oc are there any other issues like this one?

@thdxr commented on GitHub (Aug 16, 2025): /oc are there any other issues like this one?
Author
Owner

@opencode-agent[bot] commented on GitHub (Aug 16, 2025):

Based on my search, this appears to be a unique and valid feature request. Here's what I found:

No Similar Issues Found

There are currently no other issues in the repository requesting similar file search enhancements. This is the first request for:

  • Gitignore file visibility control
  • Ripgrep configuration customization
  • Search scope configuration

Current Implementation Gaps

The current file search system has significant limitations:

  • Hardcoded exclusions: Only .git/* is filtered out
  • No .gitignore awareness: Gitignored files are still shown/searchable
  • No configuration support: No .rgrc or RIPGREP_CONFIG_PATH support
  • No user customization: Search behavior can't be modified

This is a Greenfield Opportunity

The codebase shows this would be a valuable enhancement since:

  1. The search implementation is basic but functional
  2. There's already a robust config system that could be extended
  3. The suggested workaround confirms the technical feasibility
  4. No competing or conflicting features exist

This issue represents a clear gap in expected developer tooling functionality that would benefit many users.

%22Searching%20for%20similar%20gitignore%20file%20search%20issue
opencode session  |  github run

@opencode-agent[bot] commented on GitHub (Aug 16, 2025): Based on my search, this appears to be a **unique and valid feature request**. Here's what I found: ## No Similar Issues Found There are currently **no other issues** in the repository requesting similar file search enhancements. This is the first request for: - Gitignore file visibility control - Ripgrep configuration customization - Search scope configuration ## Current Implementation Gaps The current file search system has significant limitations: - **Hardcoded exclusions**: Only `.git/*` is filtered out - **No `.gitignore` awareness**: Gitignored files are still shown/searchable - **No configuration support**: No `.rgrc` or `RIPGREP_CONFIG_PATH` support - **No user customization**: Search behavior can't be modified ## This is a Greenfield Opportunity The codebase shows this would be a valuable enhancement since: 1. The search implementation is basic but functional 2. There's already a robust config system that could be extended 3. The suggested workaround confirms the technical feasibility 4. No competing or conflicting features exist This issue represents a clear gap in expected developer tooling functionality that would benefit many users. <a href="https://opencode.ai/s/uoPXYm1K"><img width="200" alt="%22Searching%20for%20similar%20gitignore%20file%20search%20issue" src="https://social-cards.sst.dev/opencode-share/IlNlYXJjaGluZyBmb3Igc2ltaWxhciBnaXRpZ25vcmUgZmlsZSBzZWFyY2ggaXNzdWVzIg==.png?model=anthropic/claude-sonnet-4-20250514&version=0.5.5&id=uoPXYm1K" /></a> [opencode session](https://opencode.ai/s/uoPXYm1K)&nbsp;&nbsp;|&nbsp;&nbsp;[github run](/sst/opencode/actions/runs/17016030607)
Author
Owner

@anmorgunov commented on GitHub (Oct 29, 2025):

would like to voice support for this feature request, I have a few LLM-specific guiding docs or plans that I don't need to commit to the repo, but obviously would want to use in opencode

@anmorgunov commented on GitHub (Oct 29, 2025): would like to voice support for this feature request, I have a few LLM-specific guiding docs or plans that I don't need to commit to the repo, but obviously would want to use in opencode
Author
Owner

@rekram1-node commented on GitHub (Oct 29, 2025):

@anmorgunov we may need to highlight this better in the docs but since we use ripgrep for file searches you can make exclusions using ignore files:
https://opencode.ai/docs/tools/#ignore-patterns

@rekram1-node commented on GitHub (Oct 29, 2025): @anmorgunov we may need to highlight this better in the docs but since we use ripgrep for file searches you can make exclusions using ignore files: https://opencode.ai/docs/tools/#ignore-patterns
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1064