Skip to content

fix(skills): quiet startup skill conflicts for duplicated shared skill dirs - #246

Merged
Uking-xxx merged 2 commits into
mainfrom
fix/skill-collision-noise
Oct 12, 2026
Merged

Uking-xxx merged 2 commits into
mainfrom
fix/skill-collision-noise

Conversation

@Uking-xxx

Copy link
Copy Markdown
Collaborator

Problem

Users who run both Codex and Claude Code often have the same skills installed in ~/.agents/skills (Codex) and ~/.claude/skills (Claude Code). Skill installers usually copy rather than symlink, so the existing realpath dedupe doesn't catch them. Every duplicate produced a [Skill conflicts] entry. Step mode always shows diagnostics on startup, so users got dozens of lines like this:

[Skill conflicts]
  "oo" collision:
    ✓ auto (user) ~/.agents/skills/oo/SKILL.md
    ✗ ~/.claude/skills/oo/SKILL.md (skipped)
  "wrangler" collision:
  ...

These entries are informational only: .agents takes precedence over .claude, the shadowed copy is never loaded, and the user can't remove it without breaking Claude Code.

Changes

  • Skip identical copies silently (packages/coding-agent/src/core/skills.ts): when two skills share a name and their SKILL.md files are byte-identical, the later one is skipped without a diagnostic, the same way symlinked duplicates already are.
  • Summarize remaining collisions on startup (apps/cli/src/ui/interactive-mode.ts): without the full resource listing, skill and prompt collisions collapse into one line per (skipped dir, winning dir) pair:
    [Skill conflicts]
      3 skills in ~/.claude/skills skipped (same name already loaded from ~/.agents/skills)
      Run with --verbose to list them.
    
    --verbose and the full listing mode still show the per-name breakdown. Warnings and errors (e.g. frontmatter parse failures) are shown in full as before.

Precedence and the winning skill are unchanged.

Note: only SKILL.md content is compared. If two copies have identical SKILL.md but different bundled scripts, the shadowed copy is now skipped silently; the winner (higher-precedence dir) is still what gets used.

Validation

  • New tests in skill-loading-regressions.test.ts: identical copies produce no collision; differing copies still report .agents as winner and .claude as loser.
  • New tests in interactive-mode-status.test.ts: Step mode summarizes unless --verbose; summary groups by directory pair and keeps non-collision diagnostics.
  • skills, resource-loader, skill-loading-regressions, 2781-skill-collision-precedence, and interactive-mode-status suites pass (132 tests).
  • pnpm run check (biome, repo checks, tsgo --noEmit) passes.

xuyunfang and others added 2 commits October 12, 2026 14:57
…l dirs

Users who run both Codex and Claude Code often have the same skills
copied into ~/.agents/skills and ~/.claude/skills. Each copy produced a
collision entry, flooding startup even though the shadowed copy is never
loaded.

- Skip a colliding skill silently when its SKILL.md is byte-identical to
  the winner, the same way symlinked duplicates are already skipped.
- Without the full resource listing, collapse remaining skill/prompt
  collisions into one line per (skipped dir, winning dir) pair; --verbose
  still lists each one. Warnings and errors are shown in full as before.
@Uking-xxx
Uking-xxx merged commit 3ba89e0 into main Oct 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant