Skip to content

[FEATURE]: Add config option to restrict skill discovery directories #23035

Closed as not planned

Description

@rahul-sensehq

Problem

OpenCode hardcodes skill discovery across 6 directories (3 global + 3 project-level):

  • ~/.config/opencode/skills/
  • ~/.claude/skills/
  • ~/.agents/skills/
  • .opencode/skills/
  • .claude/skills/
  • .agents/skills/

There is no way to restrict which directories are scanned. Users who share skill files across tools (e.g., Claude Code + OpenCode) via hard links end up with identical skills in 3 global directories. OpenCode correctly deduplicates them, but scanning and deduplicating ~43 files across 3 directories adds ~5 seconds to startup time.

Reference from startup log:

WARN  service=skill name=frontend-design existing=~/.claude/skills/... duplicate=~/.agents/skills/... duplicate skill name
WARN  service=skill name=frontend-design existing=~/.agents/skills/... duplicate=~/.config/opencode/skills/... duplicate skill name
INFO  service=skill count=15 init  # 5+ seconds after first scan started

Proposed Solution

Add a skills.directories config option to opencode.json that lets users specify which directories to scan, replacing the hardcoded defaults:

{
  "skills": {
    "directories": ["~/.agents/skills/"]
  }
}

When set, only the listed directories are scanned. When omitted, current behavior (scan all 6) is preserved for backwards compatibility.

This would also complement the existing skills.paths (which adds additional paths) and skills.urls options.

Verification

  • I have verified this feature hasn't been suggested before

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 17, 2026
  2. github-actions commented on Apr 17, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • This appears to be a feature request, but the title does not start with [FEATURE]: as required by the feature request template
    • The feature request template verification checkbox ("I have verified this feature hasn't been suggested before") is missing

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


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

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. changed the title [-]Add config option to restrict skill discovery directories[/-] [+][FEATURE]: Add config option to restrict skill discovery directories[/+] on Apr 17, 2026
  4. github-actions commented on Apr 17, 2026

    @github-actions
    Contributor

    Thanks for updating the issue! Everything looks good now — the feature request is clear, well-described, and follows the contributing guidelines. We appreciate you taking the time to improve it.

  5. rahul-sensehq commented on Apr 17, 2026

    @rahul-sensehq
    Author

    Related issues:

    This issue is specifically about the performance impact of scanning multiple directories — 5+ seconds of startup time spent reading and deduplicating identical skills across ~/.claude/skills/, ~/.agents/skills/, and ~/.config/opencode/skills/.

    Even a minimal fix — like respecting skills.paths as an override (replace defaults when set) rather than an additive list — would solve the startup regression without needing a new config key.

  6. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  7. PVLPM commented on May 3, 2026

    @PVLPM

    +1
    Additionally to the added startup time, the <available_skills> system prompt bloats the context with irrelevant skills to the project. For example, if you have a few projects with different tech stacks, you don't want to load the irrelevant skill to the project, but the same skills would be relevant for another project with a different tech stack.
    I purpose to inject only allowed skills or add the ability to override the skill directories per project.

  8. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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