claude-code - 💡(How to fix) Fix Skills: relative file paths in SKILL.md are not resolved [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#56325Fetched 2026-05-06 06:31:08
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

When a skill's SKILL.md references a file using a relative path (e.g. references/style-guide.md), the LLM has no way to resolve it because it doesn't know the skill's install directory. This causes the agent to use Search/Glob instead of Read, which fails to find the file.

Root Cause

When a skill's SKILL.md references a file using a relative path (e.g. references/style-guide.md), the LLM has no way to resolve it because it doesn't know the skill's install directory. This causes the agent to use Search/Glob instead of Read, which fails to find the file.

Fix Action

Workaround

Instruct the LLM to locate the file dynamically: "Read the file references/style-guide.md located in this skill's directory"

RAW_BUFFERClick to expand / collapse

Summary

When a skill's SKILL.md references a file using a relative path (e.g. references/style-guide.md), the LLM has no way to resolve it because it doesn't know the skill's install directory. This causes the agent to use Search/Glob instead of Read, which fails to find the file.

Reproduction

  1. Create a skill with a references/ subdirectory containing a file
  2. Reference it in SKILL.md with a relative path: See `references/style-guide.md`
  3. Install and invoke the skill
  4. The agent searches for the file and gets 0 results

Expected behavior

The skill system should resolve relative paths in SKILL.md to absolute paths before injecting the prompt, or expose the skill's base directory to the LLM so it can construct the correct path.

Workaround

Instruct the LLM to locate the file dynamically: "Read the file references/style-guide.md located in this skill's directory"

extent analysis

TL;DR

Instruct the LLM to locate the file dynamically by specifying the skill's directory in the file path.

Guidance

  • To resolve the issue, modify the SKILL.md file to include the skill's base directory in the file path, allowing the LLM to construct the correct absolute path.
  • Verify that the LLM can successfully locate the file by checking the search results after invoking the skill.
  • Consider exposing the skill's base directory to the LLM as an alternative solution, enabling it to resolve relative paths on its own.
  • When referencing files in SKILL.md, use the workaround provided: "Read the file references/style-guide.md located in this skill's directory".

Example

No code snippet is necessary, as the solution involves modifying the natural language prompt in SKILL.md.

Notes

This solution assumes that the LLM has the capability to understand and execute dynamic file location instructions. If this is not the case, an alternative approach may be required.

Recommendation

Apply the workaround by instructing the LLM to locate the file dynamically, as this provides a straightforward solution to the issue without requiring changes to the underlying skill system.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The skill system should resolve relative paths in SKILL.md to absolute paths before injecting the prompt, or expose the skill's base directory to the LLM so it can construct the correct path.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING