anthropics / anthropics/skills

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

Open
#1,153 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
176k
Forks
20.8k
Avg merge
7h 21m
Merged PRs (30d)
5

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.