Repository navigation
Description
Summary
bb's slash-command typeahead shows no project commands when .claude/commands/*.md are symlinks. The host-daemon command scanner skips every symlinked directory entry, so a repo that symlinks its commands into a shared location gets an empty "project commands" section, while Claude Code's own CLI loads them fine.
Where
host-daemon src/command-discovery.ts, walkMarkdownTree:
for (const entry of entries) {
if (entry.isSymbolicLink()) {
continue;
}
...
}Symlinks are followed only for user-origin skill roots:
function canFollowSkillSymlink(root: CommandScanRoot): boolean {
return root.origin === "user" && root.source === "skill";
}walkMarkdownTree backs the command shape (resolveCommandScanRoots -> <cwd>/.claude/commands, origin: "project"), so a project command that is a symlink is never discovered, in any shape.
Reproduce
- In a project,
mkdir -p .agents/skills/foo && printf -- '---\ndescription: demo\n---\nhi\n' > .agents/skills/foo/SKILL.md ln -s ../../.agents/skills/foo/SKILL.md .claude/commands/foo.md- Open the slash-command menu in bb (or
GET /api/v1/projects/<id>/commands?provider=claude-code&environmentId=<env>).
Expected: foo listed under project commands.
Actual: absent. Replacing the symlink with a regular file makes it appear immediately, which isolates the cause to the symlink check rather than the path, the environment, or caching.
Impact
Sharing one instruction file between Claude Code and Codex via symlinks is a common monorepo layout (.claude/commands/x.md -> .agents/skills/x/SKILL.md keeps the two harnesses from drifting). In our repo all 14 project commands are invisible in bb for this reason; the only visible non-builtin command is a regular file in ~/.claude/commands/.
Suggested fix
For the command shape, resolve symlinked entries with fs.stat and accept them when the target is a regular file inside the root's boundary. The cycle and root-escape concerns that motivate the blanket skip apply to recursive directory traversal; a symlinked leaf .md can be followed safely with a boundary check. Alternatively, extend canFollowSkillSymlink to project roots for file (non-directory) entries.
Version
bb 0.39.0, macOS (darwin 25.6.0), provider claude-code.
Activity
Borjampm commentedon Aug 31, 2026
Same cause, second symptom: skill directories are dropped by the same rule, so
.claude/skills/x -> ../../.agents/skills/xis invisible for exactly the reason your.claude/commands/*.mdlinks are. Adding evidence rather than opening a duplicate.Reproduced on
main@8d926c3(also packaged 0.40.0), macOS 26.4, Node v26.4.0,claude 2.1.251 / codex 0.150.1 / pi 0.84.4.
Minimal A/B — one real directory, one in-repo symlink, same skills root:
Three additions to what you documented:
1. It is not provider-specific.
codexdrops an entry link in.codex/skillsandpiin.pi/skills, identically. One rule, every provider.2. Containment is not what is being enforced. I pointed a link at a sibling inside
the same skills directory — it cannot escape anything — and it is still dropped:
3. The rule is inverted, not merely strict. While in-repo entry links are refused, a
non-recursive root link is followed straight out of the repository —
.claude/skills -> /outsideloads everything under it. So today bb blocks the link thatcannot escape and follows the one that does. I filed that half separately as #2769 since it is
the opposite failure and lands independently.
The existing test that pins the current behavior only ever uses an outside target
(
command-discovery.test.ts:501),so the in-repository case looks unconsidered rather than deliberately refused — even
though PR #92 (
27361799e) did intend "keep project-origin symlinked skills skipped".On your suggested fix: it works, and it generalises. Replacing the origin check with
the containment check the docblock already describes fixes commands and skills from one
rule, reusing the
boundaryPaththat is already plumbed to every project root — nocontract or
HOST_DAEMON_PROTOCOL_VERSIONchange. Following linked leaf files only,and still skipping linked directories during the markdown walk, keeps your cycle and
escape concerns intact.
I have this implemented and tested against your repro shape and mine:
Happy to open it as a PR against this issue if that is welcome — or to split the skills
half into its own issue if you would rather keep this one scoped to commands.
SawyerHood commentedon Sep 18, 2026
Consolidating #3856 here at the maintainer's request. This tracker's existing comments already reproduce the same project skill-directory symlink case, in addition to the command-file case in its title.
Preserve the newer evidence: bb 0.43.1 / main e9de27c skips
.claude/skills/nerd -> ../../.agents/skills/nerdeven though the resolved target stays inside the repository. The same project-origin rule affects Pi. Independent reproduction in two clean checkouts failed for the project alias while real-directory and user-alias controls passed; the build and 26 existing discovery tests passed. Report: https://get-bb.github.io/reports/issues/3856.htmlProposed implementation #3857 was closed without merging by the contributor gate; it is patch evidence, not a shipped fix. Its containment checks and regression test should be reviewed alongside both this tracker's command-file and skill-directory cases. Preserve rejection of links escaping the project boundary; #2769 tracks root containment separately, and #3238 concerns the distinct bb-user scanner.
Closing #3856 consolidates tracking only. This issue remains open until the command and skill cases are addressed.
SawyerHood commentedon Sep 30, 2026
Verified command-file scanner report: https://get-bb.github.io/reports/issues/2602.html
REPRODUCED in two clean checkouts: three readable in-project file aliases are omitted by the actual command scanner; regular and nested-file controls pass, and replacing the aliases with identical regular files restores all names. This adds the command-file evidence missing from the preserved #3856 skill-directory report. Live slash UI/provider behavior is not tested; #3857 remains closed unmerged.
iandreitsev commentedon Oct 21, 2026
Another use case for this tracker, with one difference: the links point outside the repository on purpose.
I keep one canonical set of development skills in ~/.agents/dev-skills/ and attach it to every dev project with per-skill links, next to a few project-only skills that are real folders:
Claude Code and Codex load all of them in bb threads. bb's picker and
bb skill list --projectshow only the real folders (4 of ~25 in my case), so I have to remember the names of the rest.I understand that links escaping the project boundary should stay rejected by default. Could they be allowed as an explicit opt-in instead? For example:
Making the global skills user-level isn't a good alternative: they'd then load into every non-dev project and collide with built-in names such as code-review.
bb 0.46.1, macOS, desktop.
brzvsk commentedon Oct 22, 2026
Additional reproduction on bb 0.46.1 desktop (macOS 26), project-root case.
Layout:
.agents/skills/<name>are 18 per-skill symlinks into one canonical catalog outside the project (../../managed-skills/catalog/...). OpenCode, Claude Code and Codex load all 18 natively inside bb threads.bb skill list --project <id> --environment <env> --json: zero project-scoped skills, no warning. Pointing a shared root at the same catalog materialized as real directories lists them normally, so discovery itself is fine — only the linked entries are refused.Workaround that works on 0.46.1: app-managed
sharedSkillRootsuser roots do follow symlinks. WithsharedSkillRoots.user: ["<home>/projects/<repo>/.agents/skills"], all 18 appear asshared-userand reach the runtime/commandscatalog (53 unique skill commands, no duplicates). It is global across projects, so it is not equivalent to per-project materialization.So project roots refuse linked entries while user roots follow them. If #2602 keeps the workspace containment rule, an explicit opt-in for links escaping the workspace (or documenting the shared-root workaround) would cover the common "one canonical skill set, link it into each repo" layout.
Unify skill indexing and explicit provider selection
Unify skill discovery and dedupe; pass picked skills to Codex (get-bb…