Skip to content

Symlinked entries in a project skill root are skipped even when they stay inside the repository #3856

Closed as not planned

Description

@bjorn-supernomic

Summary

A project skill root whose entries are symlinks (for example a checked-in .claude/skills/nerd -> ../../.agents/skills/nerd) yields no project skills for that provider. The host-daemon scanner refuses every symlinked entry in a project-origin root, even when the link stays inside the repository, so the slash-command picker on Claude Code and Pi threads shows none of the repo's skills while Codex, which also scans the real directories, shows all of them. Claude Code itself loads the same links fine.

Versions and environment

  • bb 0.43.1 desktop app (macOS), reproduced on main at e9de27c with the unit test below.
  • macOS 26.6.2, Node 22.
  • Claude Code 2.1.273 (its startup system.init message lists all 200 slash commands from the same repo, including the linked ones).
  • Worktree environment; the project checkout is a normal git repository whose native skill roots are maintained by a sync script as symlinks: .claude/skills/<name> -> ../../.agents/skills/<name>, and .agents/skills/<name> is itself sometimes a link into .codex/skills/<name>.

Steps to reproduce

cd "$(mktemp -d)" && git init -q repo && cd repo
mkdir -p .agents/skills/nerd .claude/skills
printf -- '---\nname: nerd\ndescription: probe\n---\nprobe\n' > .agents/skills/nerd/SKILL.md
ln -s ../../.agents/skills/nerd .claude/skills/nerd
# open this directory as a bb project, then:
bb skill list --json | jq '[.skills[] | select(.scope=="provider-project") | .provider] | group_by(.) | map({(.[0]): length}) | add'

Unit-level: the added test in apps/host-daemon/src/command-discovery.test.ts ("follows project-origin symlinked skills whose target stays inside the workspace") fails on main and passes with the fix.

Expected vs actual

Expected: nerd listed as provider-project / claude-code and offered in the / picker on a Claude Code thread.

Actual, on a real repository with 120 such links (bb skill list --json, grouped by scope/provider):

provider-project/codex        106
provider-project/claude-code    0
provider-project/pi             0

The claude-code provider only shows provider-user rows from ~/.claude/skills (21) and plugin skills (8). Nothing is logged; the skills are simply absent.

Evidence

  • The rule:
    function canFollowSkillSymlink(root: CommandScanRoot): boolean {
    return root.origin === "user" && root.source === "skill";
    }
    (canFollowSkillSymlink returns true only for origin === "user"), applied to the directory entry at L175 and to SKILL.md at L195.
  • Project roots already carry a workspace boundary (boundaryPath) that the recursive shape enforces for the root itself:
    const resolvedRoot = await fs.realpath(root.rootPath).catch(() => null);
    if (resolvedRoot === null) {
    return null;
    }
    if (root.origin !== "project" || root.boundaryPath === undefined) {
    return resolvedRoot;
    }
    const resolvedBoundary = await fs
    .realpath(root.boundaryPath)
    .catch(() => null);
    return resolvedBoundary !== null &&
    isPathWithinDirectory(resolvedBoundary, resolvedRoot)
    ? resolvedRoot
    : null;
    }
    async function scanRecursiveSkillRootFiles(
  • The provider declaration for Claude Code is .claude/skills with ancestors: true, so the boundary is the repository root.
  • Investigation thread: bb thr_vvesswr2g5 (project proj_5rk999rgnk).

What you ruled out

Suggested priority and effort

Medium priority: every repository that keeps one skill catalog and links it into each provider's native root loses all project skills on Claude Code and Pi threads, silently. Low effort: reuse the existing boundaryPath containment for entries (fix in the linked PR).

AGENT GENERATED

Activity

  1. bjorn-supernomic commented on Sep 17, 2026

    @bjorn-supernomic
    Author

    Fix is ready in #3857 (auto-closed by the contributor gate; branch bjorn-supernomic:fix/follow-workspace-skill-symlinks, commit d0e923a). It reuses the existing boundaryPath containment for linked entries, adds a regression test, and updates docs/provider-plugin-api.md. Happy to reopen once approved.

    AGENT GENERATED

  2. added theissue type on Sep 17, 2026
  3. added
    host
    provider-claude-code
    provider-pi
    confirmed-repro
    on Sep 17, 2026
  4. bb-slop-cop commented on Sep 17, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classified as Bug · Medium priority · Low effort. Added host, provider-claude-code, provider-pi, and confirmed-repro.

    Reproduction and root-cause report: REPRODUCED, high confidence. Two clean checkouts of trusted main failed the authored regression test: the project alias returned no skill, while direct-directory and user-alias controls passed. The full build and 26 existing discovery tests passed.

    Root cause: the flat skill scanner allows symlinks only for user-origin roots, without considering the supplied project boundary.

    No PR opened: changing filesystem traversal policy crosses a security boundary and is excluded from automatic simple fixes.

    AGENT GENERATED

  5. SawyerHood commented on Sep 18, 2026

    @SawyerHood
    Collaborator

    Duplicate of #2602. The newer reproduction, linked patch, and containment requirements are preserved at #2602 (comment). Closing for consolidation, not as fixed.

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

    confirmed-reprohostprovider-claude-codeprovider-pi

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions