anthropics / anthropics/skills

references/ relative paths don't resolve from the skill's directory

オープン
#1,153 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
176k
フォーク
20.9k
平均マージ
7時間 21分
マージ済み PR(30日)
5

説明

The `skill-creator` skill recommends the `references/` progressive-disclosure pattern, but in practice neither Claude.ai's `view` nor Claude Code's `Read` resolves relative paths from the skill's own directory.

**Reproduction (Claude Code, 2026-05-17):**

Skill at `~/.claude/skills/path-test/` with `references/spec.md`. SKILL.md instructs Claude to read `references/spec.md`. Result:

```
File does not exist. Note: your current working directory is /Users//Documents/.
```

The path is resolved against the process cwd, not the skill's directory. The "Base directory for this skill: ..." header that Claude Code injects into the turn is informational and doesn't affect path resolution.

**On Claude.ai**, `view` rejects relative paths outright:

```
references/spec.md is not an absolute path.
```

Passing an absolute path works on both. So skills wanting to load their own `references/` files need to construct an absolute path at runtime, which isn't covered in `skill-creator`.

**Suggested fix:** either expose a `$SKILL_DIR` variable that resolves to the triggered skill's path, or update `skill-creator` to explicitly instruct authors to construct absolute paths from the skill's own location.

Reproduction details and a related cross-platform investigation at https://github.com/livlign/claude-skills-pitfalls.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。