Skip to content

Skill discovery walks node_modules and .git inside a skill on every startup #51080

Closed as not planned

Description

@kugesh-Rajasekaran

Description

Opening OpenCode took 13.3s, 10.0s, and 6.6s on three cold starts before the TUI was ready.

Startup spends several seconds in skill discovery because skills/**/SKILL.md is scanned with followSymlinks: true and dot: true, and Bun.Glob.scan has no ignore option. A skill directory that contains node_modules or .git is walked in full on every launch, even though those directories never contain a skill.

On OpenCode 1.18.31, with no plugins, three cold starts in the same project reached booting location services in 13.3s, 10.0s, and 6.6s. On the fastest run the skill scan itself was 2.3s (message=init at 07:52:56.868Z, message=init count=62 at 07:52:59.173Z). ~/.agents/skills/gstack is a full checkout: node_modules is 703MB / 12,732 files and .git is 57MB. A plain find of those two directories takes 0.07s, so the cost is the scanner, not the disk.

~/.claude/skills is a symlink to ~/.agents/skills, so the same tree is scanned twice and each skill is logged as a duplicate.

This is the same class of walk as #27027 and #30337, both closed as not planned. #27027 is about a symlink to an external tree. Here node_modules is a real directory inside the skill, so dropping followSymlinks does not fix it. Bun.Glob.scan also cannot take an ignore list (cwd, absolute, onlyFiles, dot only).

Please skip descending into node_modules, .git, dist, and .cache during discovery, so nested SKILL.md files are still found and those directories are not stat-ed. Deduping by realpath would also stop the symlink from scanning the tree twice.

Plugins

none

OpenCode version

1.18.31

Steps to reproduce

  1. Install a skill that is a full project checkout, so ~/.agents/skills/<name>/node_modules and .git exist. gstack does this.
  2. Point ~/.claude/skills at ~/.agents/skills (a symlink).
  3. From any project, run opencode --log-level INFO.
  4. Time from message=init to message=init count=… in ~/.local/share/opencode/log/opencode.log.

Screenshot and/or share link

No screenshot. Timing is from the server log above.

Operating System

macOS 15.7.5 (Apple Silicon)

Terminal

Measured from the server log, not from terminal rendering. The delay happens before the TUI is ready.

Activity

  1. added a commit that references this issue on Sep 27, 2026
    c0e2e59
  2. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions