anomalyco / anomalyco/opencode
Glob scans broad path despite a literal pattern prefix
@jlongster is already working on this.
Since Sep 1, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Glob can appear stuck when path is broad even if pattern starts with known literal directories. For example:
path: /Users/giampaolocasolla
pattern: .claude/plugins/*
On 1.18.25 this traverses the full home directory because path becomes ripgrep's working directory and pattern is only passed as a filter. Narrowing the traversal root to the literal prefix makes the call immediate.
I can contribute a focused fix that extracts safe literal directory prefixes before invoking ripgrep, preserves anchored glob semantics, and adds equivalence tests. Would that direction be acceptable for a PR? Related closed reports: #29437 and #33540.
Plugins
oh-my-opencode-slim, opencode-cmux, and local plugins. The behavior is in the native Glob implementation.
OpenCode version
1.18.25
Steps to reproduce
- Run Glob with
pathset to a large home directory. - Set
patternto a narrow literal prefix such as.claude/plugins/*. - Observe that Glob traverses unrelated directories and can take minutes.
- Run the equivalent call with
path: /Users/giampaolocasolla/.claude/pluginsandpattern: /*; it completes immediately.
Operating System
macOS 26.6.2
Terminal
OpenChamber
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.