anthropics / anthropics/skills

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

Offen
#1,153 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
176k
Forks
20.9k
Ø Merge
7 Std. 21 Min.
Gemergte PRs (30 T.)
5

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.