Skill invocation produces hallucinated output instead of following skill instructions
Description
When invoking custom skills (e.g., /editthispic-cro), the model ignores the skill's SKILL.md instructions and instead generates completely unrelated hallucinated content — including Anthropic SDK documentation, random conversation snippets, and text containing non-Claude special tokens (</s>, <|end|>, <bos>).
Steps to Reproduce
- Create a custom skill with
invocable: truein~/.claude/skills/ - Start a fresh Claude Code session
- Immediately invoke the skill as the first message (e.g.,
/editthispic-cro)
Expected Behavior
The model should follow the skill's SKILL.md instructions (in this case, spawning 4 data collection agents and running a CRO audit).
Actual Behavior
The model produces completely unrelated output such as:
The **call** tells me it's from a `total` session in a `chat` thread.
# Usage
## Install
pip install anthropic
...
Followed by random hallucinated content (911 dispatcher guides, prime number functions, etc.) with non-Claude special tokens (</s>, <|end|>, <bos>).
Investigation Details
- Claude Code version: 2.1.81
- Model: claude-opus-4-6 (1M context)
- Platform: Linux (Hetzner VPS)
- Auth: OAuth (Max subscription,
default_claude_max_20xrate limit tier)
Key findings from session analysis:
- Skill content loads correctly — the SKILL.md content (10,923 chars) is injected identically in both working and broken sessions (verified via JSONL comparison)
- Same injection format —
<command-message>and<command-name>tags are identical between working and broken sessions - Same model —
claude-opus-4-6in both cases - Timeline: Skill worked consistently through March 22. Started failing on March 23 across multiple fresh sessions. No local configuration changes between these dates.
- Works in existing sessions — invoking the skill mid-conversation works fine. Only breaks when invoked as the first message in a new session.
- Multiple fresh sessions affected — reproduced across 3+ independent fresh sessions on the same day
Session IDs (for Anthropic-side investigation):
- Working (March 22):
8768cd7f-d823-473b-aa43-d1bee35c9fd7— skill invoked as first message, model correctly spawned 4 agents - Broken (March 23):
9196b9ad-485a-49a7-94c6-99e5f5e0f98a— skill invoked as first message, model hallucinated SDK docs - Broken (March 23):
e3123bc5-0cb9-4450-98ce-774fa32b6d45— skill invoked as first message, model hallucinated random content
Environment context:
- 40 skills loaded (34 user + 1 plugin + 8 bundled)
- 7 MCP servers configured (most failing to connect — Clay, GSC, reddit-read-only, sovereign-firm, posthog-analytics)
- Large CLAUDE.md (~21KB)
effortLevel: "high"in settings
Workaround
Sending a brief message before invoking the skill (e.g., "hi") prevents the issue. The skill works correctly when it's not the first message in a session.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗