You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot @tag/reference files in dot-directories (e.g., .cursor/commands/*.md) #11691
Opencode cannot reference/tag files that are located in directories starting with a dot (.), even when those files are explicitly added to the instructions array in opencode.json.
Environment
Opencode version: (latest)
OS: Linux
Project structure: Has .cursor/commands/ directory with markdown files
Steps to Reproduce
Create a directory structure with dot-prefixed folder (e.g., .cursor/commands/)
Add files to that directory (e.g., .cursor/commands/review.md)
Tried moving to non-dot directory (cursor/commands/) ✓ (works, but not ideal)
Additional Context
The glob search tool (glob) also fails to find these files when using patterns like .cursor/**/*.md
However, ls -la .cursor/commands/ confirms the files exist
This affects development workflows that rely on dot-directories (like .cursor/, .vscode/, etc.)
Possible Root Cause
Opencode may be filtering out dotfiles/dot-directories when building the file index for @tagging, even when they're explicitly listed in the instructions array.
The issue is now resolved. The problem was that dot-directories like .cursor/ are being ignored by default by the underlying ripgrep tool that OpenCode uses for file discovery.
Solution
Create a .ignore file in your project root with exclusion patterns to un-ignore the dot-directory:
!.cursor/
!.cursor/**
This tells ripgrep to not ignore the .cursor/ directory, making files within it discoverable by the @ tagging system.
Root Cause
As explained in #4689, the list tool uses ripgrep which respects ignore patterns. Dot-directories are often excluded by default or by global gitignore settings. The .ignore file takes precedence and allows explicit un-ignoring of specific directories.
Note: The instructions array in opencode.json is for providing instructions content to the LLM, not for making files discoverable for @ tagging. The .ignore file is the correct approach for file visibility.
Activity
raychrisgdp commentedon Feb 2, 2026
Bug Description
Opencode cannot reference/tag files that are located in directories starting with a dot (
.), even when those files are explicitly added to theinstructionsarray inopencode.json.Environment
.cursor/commands/directory with markdown filesSteps to Reproduce
.cursor/commands/).cursor/commands/review.md)opencode.jsoninstructions:{ "$schema": "https://opencode.ai/config.json", "instructions": [".cursor/commands/*.md"] }{ "instructions": [".cursor/commands/review.md"] }@.cursor/commands/review.md)Expected Behavior
The file should appear in the autocomplete dropdown and be taggable/referenceable, just like files in non-dot directories.
Actual Behavior
@.cursor/commands/shows no suggestionsinstructionsdoes not make the files taggableWorkarounds Attempted
".cursor/commands/*.md"❌".cursor/commands/review.md"❌cursor/commands/) ✓ (works, but not ideal)Additional Context
glob) also fails to find these files when using patterns like.cursor/**/*.mdls -la .cursor/commands/confirms the files exist.cursor/,.vscode/, etc.)Possible Root Cause
Opencode may be filtering out dotfiles/dot-directories when building the file index for @tagging, even when they're explicitly listed in the instructions array.
github-actions commentedon Feb 2, 2026
This issue might be a duplicate of existing issues. Please check:
@is not listing the available files #6618: '@' is not listing the available files - users report @ autocomplete not showing files in dot-directories like .ai/prompts/Feel free to ignore if none of these address your specific case.
raychrisgdp commentedon Feb 2, 2026
✅ Issue Resolved
The issue is now resolved. The problem was that dot-directories like
.cursor/are being ignored by default by the underlying ripgrep tool that OpenCode uses for file discovery.Solution
Create a
.ignorefile in your project root with exclusion patterns to un-ignore the dot-directory:This tells ripgrep to not ignore the
.cursor/directory, making files within it discoverable by the@tagging system.Root Cause
As explained in #4689, the
listtool uses ripgrep which respects ignore patterns. Dot-directories are often excluded by default or by global gitignore settings. The.ignorefile takes precedence and allows explicit un-ignoring of specific directories.Related Issues
@is not listing the available files #6618 - "@is not listing the available files" - Related issue about file autocompleteNote: The
instructionsarray inopencode.jsonis for providing instructions content to the LLM, not for making files discoverable for@tagging. The.ignorefile is the correct approach for file visibility.Closing this as the workaround is effective.