Skip to content

Claude Code lists bb-injected skills twice when the same skill is also under a natively scanned root #4164

Closed

Description

@Techno911

Scenario

With the Claude Code provider, the skills bb injects as the bb-global-skills
plugin are listed a second time by Claude Code itself whenever the same skill
also exists under a root Claude Code scans natively — <home>/.claude/skills/<name>/SKILL.md
or <cwd>/.claude/skills/<name>/SKILL.md. bb has no visibility into that scan,
so its own catalog dedup cannot see the collision.

Steps to reproduce:

  1. Put a skill at ~/.claude/skills/demo/SKILL.md (a symlink into
    ~/.bb/shared-provider-skills/demo reproduces it too — bb itself creates
    such symlinks for shared-provider skills).
  2. Register the same skill with bb so it lands in the injected catalog
    (bb skill list --json shows it).
  3. Start a Claude Code thread in bb and ask the model to list its available
    skills, or inspect the system prompt's skill catalog.

Measured on a real workspace (49 shared/bb-owned skills): about 45 names appear
twice, adding roughly 13 500 tokens of repeated description text to every
Claude Code thread's system prompt at startup.

Current behavior

assembleSkillPlugins symlinks the whole staged catalog into one local plugin
and hands it to every Claude Code session unchanged:

https://github.com/get-bb/bb/blob/8b3439332/plugins/provider-claude-code/src/bridge/bridge.ts#L359-L381

Each colliding skill is then listed twice: bare (demo) from Claude Code's own
filesystem scan, and prefixed (bb-global-skills:demo) from the injected plugin.

Secondary effect, and the reason this is more than wasted tokens: Claude Code
caps the skill listing at skillListingBudgetFraction (1% of the context
window) and truncates descriptions once the catalog exceeds it. On the workspace
measured above, seven skills reached the model with an empty description, so the
model cannot tell when to invoke them. Removing the duplicates brings the
catalog back under the budget and restores those descriptions.

A skillOverrides entry keyed "bb-global-skills:<name>" in Claude Code
settings does not hide the injected copy (tried 2026-09-23), so there is no
user-side workaround short of deleting the native symlinks — which also takes
the skills away from Claude Code sessions started outside bb.

Expected behavior

For a Claude Code session, the injected catalog should omit skills whose name
that session already sees natively, so each skill is listed exactly once.
Providers without their own filesystem scanner (Codex and other ACP agents)
should keep receiving the full catalog.

Not a duplicate of #3774: that one is about the same skill registered under
several bb scopes, which bb can dedup inside its own listing. Here the second
copy never passes through bb at all — it comes from Claude Code's own scan of
~/.claude/skills and <cwd>/.claude/skills.

Prototype

Fork commit filtering the catalog per session by natively visible names
(compared both by directory name and by front-matter name), staging the
filtered set as symlinks under a hash-named directory that is reused across
sessions with the same set, and leaving the catalog untouched when there is no
overlap:

Techno911@4d036f54c

Happy to open a PR if this direction looks right.

AGENT GENERATED

Activity

  1. added theissue type on Sep 23, 2026
  2. added
    providers
    provider-claude-code
    partial-repro
    on Sep 23, 2026
  3. bb-slop-cop commented on Sep 23, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied missing classification: Bug · Priority Medium · Effort Medium; labels providers, provider-claude-code, and partial-repro. Final Type verified as Bug.

    Reproduction and root-cause report: PARTIALLY REPRODUCED, with high confidence in the project-root cause.

    The bridge injects the complete staged catalog while native project discovery remains enabled. An isolated SDK test lists the same project skill as both a native and plugin-prefixed entry. This repeated in two clean checkouts of 94d77da09. The home-root fixture returned only one entry; token overhead and description truncation remain unverified. The report includes the executable reproduction and failing deduplication assertion. Full build and all 363 existing provider tests passed.

    No PR: scope-dependent native visibility remains unresolved, so a filtering fix could incorrectly remove skills.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    partial-reproprovider-claude-codeproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions