Skip to content

[BUG]: Skill discovery logs false "duplicate skill name" warnings when .claude/skills is a symlink to .agents/skills #31977

Closed as not planned

Description

@av-leschinskiy

Description

A common multi-agent convention is to keep one canonical skills directory and symlink the agent-specific paths to it, e.g.:

.agents/skills/            # canonical, shared by Claude Code / Codex / opencode
.claude/skills -> ../.agents/skills

opencode scans both .claude/skills and .agents/skills, does not resolve symlinks to a real path, and therefore discovers every skill twice — logging a WARN duplicate skill name per skill on every startup:

timestamp=2026-06-12T02:16:25.049Z level=WARN run=1285e688 message="duplicate skill name" name=demo-skill existing=/tmp/oc-symlink-repro/.claude/skills/demo-skill/SKILL.md duplicate=/tmp/oc-symlink-repro/.agents/skills/demo-skill/SKILL.md

In a project with ~30 skills this produces ~30 warnings per session start, drowning out real log signal.

Note this is not the case fixed in #26709 — there the existing and duplicate paths were identical strings. Here the paths are different strings pointing at the same physical file through a symlinked directory, so the string-equality skip does not apply. #17219 reports the same root cause (no realpath dedup) in the permission scanner.

Steps to reproduce

mkdir -p repro/.agents/skills/demo-skill repro/.claude
cat > repro/.agents/skills/demo-skill/SKILL.md <<'SKILL'
---
name: demo-skill
description: Demo skill for symlink dedup repro
---

Demo body.
SKILL
ln -s ../.agents/skills repro/.claude/skills
cd repro && git init -q
opencode run 'hi'
# then check the log:
grep 'duplicate skill name' ~/.local/share/opencode/log/opencode.log | grep demo-skill

Expected behavior

Skill files reachable through more than one scan path should be deduplicated by resolved real path (fs.realpath) and produce no warning. Alternatively (or additionally) a config option to restrict skill discovery directories (#23035) would let users opt out of scanning one of the locations.

Environment

  • opencode 1.17.3 (also reproduced on earlier 1.17.x)
  • Linux x86_64 (NixOS), opencode installed via nix

Activity

  1. github-actions commented on Jun 12, 2026

    @github-actions
    Contributor

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

    If these are indeed the same root cause, it may make sense to consolidate. That said, the specific symptom here (startup WARN duplicate skill name spam) is distinct enough to track separately if the maintainers prefer.

  2. BacLuc commented on Jun 14, 2026

    @BacLuc

    I also had this issue. opencode web and opencode cli did not start.

    timestamp=2026-06-14T14:02:40.802Z level=WARN run=084ba4e0 message="duplicate skill name" name=playwright-cli existing=/workspaces/ecamp3-agent3/.claude/skills/playwright-cli/SKILL.md duplicate=/workspaces/ecamp3-agent3/.opencode/skills/playwright-cli/SKILL.md
    timestamp=2026-06-14T14:02:40.802Z level=WARN run=084ba4e0 message="duplicate skill name" name=playwright-cli existing=/workspaces/ecamp3-agent3/.opencode/skills/playwright-cli/SKILL.md duplicate=/workspaces/ecamp3-agent3/.agents/skills/playwright-cli/SKILL.md
    

    They started as soon as i removed the symlink .claude -> .agents

  3. github-actions commented on Aug 14, 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