claude-code - 💡(How to fix) Fix Feature: path-based Skill tool invocation for non-discovered skills [1 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#46308Fetched 2026-04-11 06:23:44
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×2cross-referenced ×1

Code Example

Skill: "path/to/skill.md"
RAW_BUFFERClick to expand / collapse

Problem

The Skill tool only supports invoking skills by their discovered name. Skills that are intentionally excluded from auto-discovery (e.g., stored in subdirectories outside the discovery path) can only be loaded via the Read tool, which injects the full skill.md content into the main conversation context permanently.

This creates an asymmetry:

Discovered SkillsNon-discovered Skills
System prompt costName + description always presentNone (the whole point)
Loading mechanismSkill tool — harness-managed, scoped injectionRead tool — raw file content enters main context
Context after executionManaged by harnessPersists for entire session

The Read approach means non-discovered skills add more context pollution than discovered skills once loaded, undermining the benefit of keeping them out of the system prompt.

Use Case

Teams with large skill libraries benefit from a two-tier structure: a small set of frequently-used skills in the system prompt, and a larger set of internal/niche skills loaded on demand. This keeps the system prompt lean for the majority of messages that don't need those skills.

However, when an internal skill is needed, loading it via Read permanently adds its full content to the conversation context. Over a multi-skill session, this accumulates and erodes the context savings that motivated the split.

Proposed Solution

Allow the Skill tool to accept a file path in addition to a skill name:

Skill: "path/to/skill.md"

This would:

  1. Parse the skill.md frontmatter (description, allowed-tools, model, etc.)
  2. Inject the skill prompt using the same scoped mechanism as discovered skills
  3. Not add the skill to the system prompt or discovery registry

The two-tier distinction would then be purely about system prompt visibility, with no penalty on the loading/execution side.

Alternatives Considered

  • Load internal skills in subagents — Works for self-contained tasks (analysis, reports) but not for skills that need to modify files or maintain conversational state in the main context.
  • Keep all skills discoverable — Defeats the purpose; adds significant always-on system prompt overhead that scales with skill count.
  • Shorter skill files — Helps but doesn't solve the fundamental issue of unmanaged context injection via Read.

extent analysis

TL;DR

Allow the Skill tool to accept a file path to load non-discovered skills without adding their content to the main conversation context permanently.

Guidance

  • Consider modifying the Skill tool to parse the skill.md frontmatter and inject the skill prompt using a scoped mechanism, similar to discovered skills.
  • Evaluate the proposed solution of passing a file path to the Skill tool, e.g., Skill: "path/to/skill.md", to load internal skills without adding them to the system prompt or discovery registry.
  • Assess the trade-offs of alternative approaches, such as loading internal skills in subagents or keeping all skills discoverable, to determine the best solution for your specific use case.
  • Review the skill library structure and identify opportunities to optimize the two-tier system, separating frequently-used skills from internal/niche skills.

Example

// Proposed usage
Skill: "path/to/internal/skill.md"

This example illustrates how the modified Skill tool could be used to load a non-discovered skill from a file path.

Notes

The solution should ensure that the Skill tool can handle file paths correctly and that the scoped injection mechanism is implemented to prevent context pollution.

Recommendation

Apply the proposed workaround by modifying the Skill tool to accept a file path, as it addresses the context pollution issue and maintains the benefits of the two-tier skill library structure.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Feature: path-based Skill tool invocation for non-discovered skills [1 participants]