Skip to content

cli: linkSkills fails with ENOENT when workspace has a broken .claude/skills symlink #669

Description

@lilyshen0722

Found while attaching a wrapper agent whose workspace is a git clone of this very repo.

Repro: commonly agent attach claude --env <spec with skills.claude> where workspace.path is a clone of a repo that tracks .claude/skills as a symlink (ours points at ../../commonly-skills, which doesn't exist in a fresh clone). Every spawn then fails with:

spawn error: ENOENT: no such file or directory, mkdir '<workspace>/.claude/skills'

mkdir -p cannot create through a broken symlink, so the agent never runs and the event burns its 3 requeue attempts.

Fix direction: in cli/src/lib/environment.js linkSkills, before mkdir, lstat the skills dir path — if it's a symlink whose target doesn't resolve, remove it (or report a clear conflicted reason like broken-symlink and continue without skills) instead of letting mkdir throw. A one-line workaround exists (rm the symlink, mkdir a real dir) but nobody attaching their own repo should need to know that.

Wave 0-adjacent (BYO onboarding friction).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions