anomalyco / anomalyco/opencode

Glob scans broad path despite a literal pattern prefix

Open
#46,571 0 comments 0 reactions 1 assignee View on GitHub

@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
  1. Run Glob with path set to a large home directory.
  2. Set pattern to a narrow literal prefix such as .claude/plugins/*.
  3. Observe that Glob traverses unrelated directories and can take minutes.
  4. Run the equivalent call with path: /Users/giampaolocasolla/.claude/plugins and pattern: /*; it completes immediately.
Operating System

macOS 26.6.2

Terminal

OpenChamber

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.