Skip to content

Glob patterns with ~/ expansion don't work in instructions configuration #3289

Closed

Description

@ZarionX5

Description

Glob patterns in instructions array fail to load files when using tilde (~) for home directory:

OpenCode version

0.15.8

Steps to reproduce

Add in opencode.json

"instructions": [
    "~/.config/opencode/rules/*.md"
]

Should load all .md files from the rules directory.

Only works with explicit paths:

"instructions": [
    "~/.config/opencode/rules/mcp-list.md",
    "~/.config/opencode/rules/prog-global-rules.md", 
    "~/.config/opencode/rules/user-rules.md"
]

Files:

ls -la ~/.config/opencode/rules/
total 24
drwxrwxr-x 2 user user 4096 Oct 19 20:10 ./
drwxrwxr-x 5 user user 4096 Oct 20 00:06 ../
lrwxrwxrwx 1 user user   72 Oct 19 17:03 mcp-list.md -> /home/user/dotfiles/dotfiles/dotconfig/config/opencode/rules/mcp-list.md
lrwxrwxrwx 1 user user   77 Oct 19 17:03 prog-example.-md -> /home/user/dotfiles/dotfiles/dotconfig/config/opencode/rules/prog-example.-md
lrwxrwxrwx 1 user user   81 Oct 19 20:10 prog-global-rules.md -> /home/user/dotfiles/dotfiles/dotconfig/config/opencode/rules/prog-global-rules.md
lrwxrwxrwx 1 user user   74 Oct 19 20:10 user-rules.md -> /home/user/dotfiles/dotfiles/dotconfig/config/opencode/rules/user-rules.md

Operating System

Kubuntu 24.04.3 LTS x86_64

Activity

  1. github-actions commented on Oct 19, 2025

    @github-actions
    Contributor

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

    • Interrupting a tool call breaks sending new messages #41: Feature suggestion: Optional tilde expansion support (~/path → /home/user/path) - This issue specifically discusses tilde expansion support for paths, which is directly related to glob patterns with ~/ not working in instructions configuration

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

  2. self-assigned this
    on Oct 19, 2025
  3. rekram1-node commented on Oct 19, 2025

    @rekram1-node
    Contributor

    will fix

  4. rekram1-node commented on Oct 19, 2025

    @rekram1-node
    Contributor

    @ZarionX5 I just tested this we definitely do expand the instructions, what makes you say they aren't expanded?

    Did you restart opencode after updating your opencode.json?

    I just tested with your example and your exact file names and I verified they are all read correctly

  5. ZarionX5 commented on Oct 20, 2025

    @ZarionX5
    Author

    Strange. The problem is clearly present. however, I tried to run opencode on a clean Kubuntu and there was no such error. I think the problem is on my side. It is possible that my nvm may be misconfigured. So far, I do not know how to reproduce the error.

  6. rekram1-node commented on Oct 20, 2025

    @rekram1-node
    Contributor

    no problem, lmk if u run into any other issues

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions