Skip to content

Slash commands for skills inject raw content AND expose the skill tool, causing duplicate context #26185

@JB-SCHREMPP-DEGETEL

Description

@JB-SCHREMPP-DEGETEL

Description

Problem

When invoking a skill via a slash command with an argument (e.g. /osiris 21709), OpenCode:

  1. Injects the raw SKILL.md content directly into the user message
  2. Still exposes the skill tool to the model

Less capable models (observed with Claude Haiku 4.5) don't realize the skill content
is already present in the conversation and call the skill tool again, resulting in
the full skill being loaded twice into context.

Impact

  • Token waste: ~850 lines of skill instructions duplicated in context. Significant
    cost/context overhead, especially for smaller models.
  • Argument loss: the argument passed after the slash command (21709 in
    /osiris 21709) ends up buried between two copies of the skill content. Less capable
    models fail to extract it and re-ask the user for the information already provided.

Evidence

Transcript excerpt — the user message ends with the full SKILL.md content, then
the model immediately re-loads it via the skill tool:

[... end of SKILL.md injected in user message ...]

21709

---

## Assistant (Build · Claude Haiku 4.5 · 8.8s)

I'm going to load the **osiris** skill to automate Pull Request reviews.

**Tool: skill**

**Input:**
{
  "name": "osiris"
}

**Output:**
<skill_content name="osiris">
# Skill: osiris
# Automatic Azure DevOps PR review — Back-end
## Configuration
[... same content again ...]

Plugins

No response

OpenCode version

1.14.40

Steps to reproduce

  1. Create a skill with a substantial SKILL.md (400+ lines)
  2. Invoke it with an argument: /my-skill some-argument
  3. Use a less capable model (e.g. Haiku 4.5)
  4. Observe: the model calls the skill tool redundantly, and may fail to pick up
    the argument

Screenshot and/or share link

No response

Operating System

windows 11

Terminal

WSL

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions