Repository navigation
fix(cli): mount skills only into a real .claude/skills directory; the Seatbelt no-key hint names a route that carries the key (F171) - #3974
Merged
Conversation
… Seatbelt no-key hint names a route that carries the key (F171) mountSkills now reads .claude and .claude/skills with lstat, one component at a time, and never follows a link. A missing component is created with a plain mkdir inside the real directory just checked, then read again. When either is a link (wherever it points) or is not a directory, every declared source is reported as 'unsafe-skill-dir' and none of the write steps runs. The Seatbelt "Not logged in" hint said to set ANTHROPIC_API_KEY "in the service env for daemon seats", but `commonly daemon install` never carries that key: the claude adapter declares no providerKeyEnv. It now says to run the agent with the key set from a shell that has it, and that the background daemon does not carry it. Carrying the key in the daemon would move unsandboxed claude seats from the subscription login to API billing, which is the row's open billing ruling, so this change only rewords. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MDs9DRAHByY1PAF8eh1wdf
lilyshen0722
commented
Nov 12, 2026
lilyshen0722
left a comment
Contributor
Author
There was a problem hiding this comment.
Head 3be392d: PASS. One Opus subagent review (effort medium, read-only) at this head. Tier 2: public seat boundary.
What it checked:
- Every write step in
mountSkills: mkdir, the refresh, copy, marker and the read-only pass now run only after.claudeand.claude/skillsare confirmed, bylstat, to be real directories.- Nothing after the check follows a link, verified on Node in scratch folders: the slot
rmremoves a link itself; the read-only pass skips links; the marker write lands on fresh copied content.
- Nothing after the check follows a link, verified on Node in scratch folders: the slot
- The caller: handles
unsafe-skill-dirwith one warning per source. Nothing downstream reads the folder when no mount happened. - Tests: none are vacuous.
- The new tests fail on main's
environment.js(19 failures, run locally) and pass at this head. - The four touched suites pass: 309 tests.
- The new tests fail on main's
- The reworded hint: true. Only pi and goose declare
providerKeyEnv, sodaemon installnever carriesANTHROPIC_API_KEY.commonly agent runfrom a shell with the key reaches the Seatbelt key route.- It goes through
cli-hint.js, and the F435 guard passes.
- It goes through
Lows, no change needed:
- The per-step tests share one early return. That's by design: the check comes before every write. Each test still sets up the state its own step would touch, so moving the check after any step fails it.
- A theoretical race between the check and the writes. It needs a writer process alive during the mount, and public seats have no shell. If that changes, a future hardening is to mount into a host-private folder and rename it into place.
- Unverified: whether a Windows junction reads as a link to
lstat. Claude public seats confine with Seatbelt or bwrap, not on Windows.
Evidence at this head:
- CI: 26 pass, 11 skipped, CLEAN.
- Local:
eslint srcis clean. The full CLI suite's two remaining failures also fail on main on this Mac (/private/var,xcrun).
GATE: PASS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@coderabbitai ignore
What changes
Skill mounts write only into a real
.claude/skillsdirectory (F171 a).mountSkillsreads.claudeand.claude/skillsunder the workspace withlstat, one component at a time, and never follows a link.mkdirinside the real directory just checked, then read again.unsafe-skill-dirand none of the write steps runs: mkdir, refresh, copy, marker, read-only pass.The Seatbelt "Not logged in" hint names a route that carries the key (F171 b).
ANTHROPIC_API_KEY"in the service env for daemon seats".commonly daemon installnever writes that key: the claude adapter declares noproviderKeyEnv.commonly agent runfrom a shell that has it), and that the background daemon does not carry it. The command goes throughcli-hint.js.Part (c), the access-only login copy, is not in this PR.
Tests
cli/__tests__/environment.test.mjsadds 21 tests. Each write step is tested against these layouts:.claudeor.claude/skillsas a link outside the workspace;Two controls check that real directories, existing or created, still mount.
environment.js, 19 of the new tests fail. With this change, all 69 in the file pass.adapters.claude.state-symlinksandturn-failure-noticeare updated. The new assertion checks that the hint doesn't mention a service env.adapters.claude.environment(/varvs/private/var);seatbelt.commit-hooks.smoke(noxcrun).The third was
cli-hint, fixed in this change. CI runs on Linux.eslint src: clean.Review
One Opus review at 3be392d (tier 2, public seat boundary), filed as the gate.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MDs9DRAHByY1PAF8eh1wdf