Repository navigation
Description
Summary
Skills installed into the global ~/.agents/skills compatibility source after the background server starts are not registered when ~/.agents did not exist at server start. /skills, /api/skill, and @skill-id omit them until opencode reload or a service restart.
Environment
- opencode version: 2.2.5 (Arch package 2.2.5-1.1)
- OS: Linux 7.3.0-3-cachyos feat: compact and other improvements #1 SMP PREEMPT_DYNAMIC x86_64
- Terminal: ghostty,
TERM=xterm-256color,COLORTERM=truecolor - Shell: /usr/bin/zsh
- Install/channel: release, Arch package (
pacman -Qi opencodeURL: https://github.com/anomalyco/opencode) - Active plugins: none found in config
Reproduction
- Start OpenCode with
~/.agentsabsent. The background server started at2026-11-03T12:43:55Z. - Install a skill at
~/.agents/skills/caveman/SKILL.md. This creates~/.agentsand~/.agents/skillsat2026-11-03T13:20:43Z. - Wait several minutes, then run
/skillsoropencode api get /api/skill.
Expected Behavior
The new skill is discovered by the existing directory watch and appears in /skills and /api/skill without a manual reload. @caveman loads it.
Actual Behavior
/api/skill returned only opencode, report, and browser. caveman was absent from the model's available skill list. After opencode reload, caveman appeared and loaded normally.
Additional Context
The startup log shows watchers registered for ~/.config/opencode/skills even though that directory did not exist, because its parent did. No watcher was registered for ~/.agents/skills because ~/.agents did not exist:
timestamp=2026-11-03T12:43:55.277Z message="watcher subscribe" path=/home/sathvic/.config/opencode/skill type=file
timestamp=2026-11-03T12:43:55.278Z message="watcher subscribe" path=/home/sathvic/.config/opencode/skills type=file
After opencode reload the compatibility root was watched:
timestamp=2026-11-03T13:25:03.254Z message="watcher subscribe" path=/home/sathvic/.claude/skills type=directory ignores=8
timestamp=2026-11-03T13:25:03.255Z message="watcher subscribe" path=/home/sathvic/.agents/skills type=directory ignores=8
Probe skills created live in ~/.agents/skills and ~/.claude/skills after that reload were picked up within seconds, so watching works once registered. The failure is only initial watcher registration when the compatibility root does not exist at server start.
Workarounds that worked:
- Run
opencode reloadafter the first install into~/.agents/skills. - Add
"skills": ["~/.agents/skills"]to the globalopencode.json, which triggers a config reload. - Restart the background service.
Reproducible: observed once with the real install; the startup-versus-reload watcher difference in the log is consistent.
Activity
opencodejr commentedon Nov 3, 2026
Thanks for the detailed report and logs. I reproduced this on 2.2.5, and it still happens on the latest
dev(6d1c444).Steps, using an isolated
HOMEwith no~/.agentsand the background service running:~/.agents(for example, an installer writing a lock file there), and about a second later create~/.agents/skills/caveman/SKILL.md.opencode api get /api/skillstill doesn't listcaveman.opencode reload, it does.If the whole path
~/.agents/skills/caveman/SKILL.mdis created in one step, the skill is picked up without a reload. So the trigger seems to be~/.agentsappearing beforeskills/. When~/.agentsappears, OpenCode rescans once;skills/isn't there yet, so nothing gets watched and its later creation is missed. The script below reproduces it.Related:
skills/when.agents/.claudeexists butskills/doesn't. It's the same pattern, but it may not cover a missing~/.agents.Until this is fixed, your workarounds still work: run
opencode reload, or list~/.agents/skillsunderskillsin your config.Reproduction script (repro.sh)
Run it:
bash repro.sh