file path globs aren't properly parsed in the config instructions field #8052

Open
opened 2026-02-16 18:09:01 -05:00 by yindo · 1 comment
Owner

Originally created by @elliotsegler on GitHub (Jan 30, 2026).

Originally assigned to: @thdxr on GitHub.

Description

When specifying instructions files (to be merged with agent instructions), if you use glob patterns like ** the files are silently dropped from being loaded.

When debugging on a dev instance, you notice that the Bun Glob is uses path.basename(instruction) as the matching pattern, and sets the cwd to path.dirname(instruction).

For paths like my/path/**/*.md the path.basename would be *.md which is the unwanted pattern (i.e a subset of what the user wants) and the dirname would be my/path/** which is always invalid.

Plugins

none

OpenCode version

v1.1.43

Steps to reproduce

Create an opencode config with something like the following

{
  "$schema": "https://opencode.ai/config.json",
  "instructions": ["~/.config/opencode/rules/**/*.md"],
}

Create some instructions at ~/.config/opencode/rules/general-guidelines.md and ~/.config/opencode/rules/test/other-guidelines.md

Start an agent session and ask it to tell you about it's rules (or intercept the payload to the LLM)

tell me about the rules/instructions you must follow and where you recieved those instructions from

The agent will repeat back instructions from the system prompt and any AGENTS.md or CLAUDE.md if you have one and have claude compatibility enabled. The instructions from the files with the globs will be missing.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @elliotsegler on GitHub (Jan 30, 2026). Originally assigned to: @thdxr on GitHub. ### Description When specifying instructions files (to be merged with agent instructions), if you use glob patterns like `**` the files are silently dropped from being loaded. When debugging on a dev instance, you notice that the Bun Glob is uses `path.basename(instruction)` as the matching pattern, and sets the cwd to `path.dirname(instruction)`. For paths like `my/path/**/*.md` the path.basename would be `*.md` which is the unwanted pattern (i.e a subset of what the user wants) and the dirname would be `my/path/**` which is always invalid. ### Plugins none ### OpenCode version v1.1.43 ### Steps to reproduce Create an opencode config with something like the following ``` { "$schema": "https://opencode.ai/config.json", "instructions": ["~/.config/opencode/rules/**/*.md"], } ``` Create some instructions at ~/.config/opencode/rules/general-guidelines.md and ~/.config/opencode/rules/test/other-guidelines.md Start an agent session and ask it to tell you about it's rules (or intercept the payload to the LLM) ``` tell me about the rules/instructions you must follow and where you recieved those instructions from ``` The agent will repeat back instructions from the system prompt and any AGENTS.md or CLAUDE.md if you have one and have claude compatibility enabled. The instructions from the files with the globs will be missing. ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal Windows Terminal
yindo added the windowsbug labels 2026-02-16 18:09:01 -05:00
Author
Owner

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

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

  • #11160: Bug: Glob patterns not working in instructions array (closed - marked as refiled with cleaner format, and this appears to be that refiled issue)
  • #4758: Custom instruction files in opencode.jsonc not being loaded (related issue about instruction files not being properly loaded)

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

@github-actions[bot] commented on GitHub (Jan 30, 2026): This issue might be a duplicate of existing issues. Please check: - #11160: Bug: Glob patterns not working in instructions array (closed - marked as refiled with cleaner format, and this appears to be that refiled issue) - #4758: Custom instruction files in `opencode.jsonc` not being loaded (related issue about instruction files not being properly loaded) Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8052