anomalyco / anomalyco/opencode
[BUG]: external .claude/.agents skill discovery silently finds nothing (global and project) in 1.18.15
@kitlangton is already working on this.
Since Aug 8, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
Skill discovery from the external .claude / .agents directories silently finds nothing in v1.18.15. Both legs implemented in discoverSkills are affected:
- global:
~/.claude/skills/**/SKILL.mdand~/.agents/skills/**/SKILL.md - project: the same targets found by walking up from the session directory
opencode's own directories (~/.config/opencode/skills/...) still work, so the failure is specific to the external branch. No error is surfaced — the skills are simply absent from /api/skill and from the skill tool.
This looks like a regression. #31977 (2026-06-12) shows external discovery working well enough to produce duplicate-name warnings from .claude/skills + .agents/skills; on v1.18.15 those same directories yield zero skills.
Steps to reproduce
Fully isolated, no dependency on my machine's config:
# fixture: an external skill in both a fake HOME and a project dir
rm -rf /tmp/ocrepro && mkdir -p /tmp/ocrepro/home/.agents/skills/probe-global \
/tmp/ocrepro/home/.config/opencode/skills/probe-control \
/tmp/ocrepro/proj/.agents/skills/probe-project
printf -- '---\nname: probe-global\ndescription: external global probe\n---\nbody\n' > /tmp/ocrepro/home/.agents/skills/probe-global/SKILL.md
printf -- '---\nname: probe-control\ndescription: opencode-dir control\n---\nbody\n' > /tmp/ocrepro/home/.config/opencode/skills/probe-control/SKILL.md
printf -- '---\nname: probe-project\ndescription: external project probe\n---\nbody\n'> /tmp/ocrepro/proj/.agents/skills/probe-project/SKILL.md
cd /tmp/ocrepro/proj
HOME=/tmp/ocrepro/home opencode serve --hostname=127.0.0.1 --port=47990 &
sleep 20
curl -s "http://127.0.0.1:47990/api/skill?directory=/tmp/ocrepro/proj" | jq -r '.data[].name'
Expected
probe-global, probe-project and probe-control all listed.
Actual
Only probe-control (plus the built-in customize-opencode). Both external probes are missing.
What I ruled out
- Not the disable flags.
disableExternalSkills/disableClaudeCodeSkillsboth default tofalseinruntime-flags.ts. SettingOPENCODE_DISABLE_EXTERNAL_SKILLS=falseandOPENCODE_DISABLE_CLAUDE_CODE_SKILLS=falseexplicitly changes nothing. - Not the glob pattern or options. Running the exact call from
Glob.scanoutside opencode finds the fixtures:await glob("skills/**/SKILL.md", { cwd: "<home>/.agents", absolute: true, dot: true, follow: true, nodir: true }) // -> [ '<home>/.agents/skills/probe-global/SKILL.md' ] - Not home resolution. Same result with
OPENCODE_TEST_HOMEpointed at the fixture instead ofHOME. - Not frontmatter. The control skill uses byte-identical frontmatter and is discovered.
- Not symlinks. The fixtures are real directories.
Since scan() swallows and logs errors when opts.scope is set (which is exactly the external branch, and only the external branch), a throw inside that scan would produce precisely this silent-empty behaviour — that seems the most likely place to look, though I could not confirm it from the logs.
Impact
This is the documented way to share one canonical skills directory across Claude Code / Codex / opencode, so those setups quietly lose every skill.
It is especially hard to work around inside T3 Code, which spawns opencode serve with OPENCODE_CONFIG_CONTENT={}. That discards the user's opencode.json, so the usual skills.paths escape hatch is unavailable there — the external directories are the only remaining mechanism, and they don't work.
Workaround: symlink each skill into ~/.config/opencode/skills/<name>, which is scanned by a different code path and works.
Environment
- opencode 1.18.15 (latest at time of filing; installed via the native installer)
- macOS 15 / darwin arm64
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.