Skill invocation produces hallucinated output instead of following skill instructions

Resolved 💬 6 comments Opened Mar 23, 2026 by aadilr Closed May 1, 2026

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

  1. Create a custom skill with invocable: true in ~/.claude/skills/
  2. Start a fresh Claude Code session
  3. 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_20x rate limit tier)

Key findings from session analysis:

  1. Skill content loads correctly — the SKILL.md content (10,923 chars) is injected identically in both working and broken sessions (verified via JSONL comparison)
  2. Same injection format<command-message> and <command-name> tags are identical between working and broken sessions
  3. Same modelclaude-opus-4-6 in both cases
  4. Timeline: Skill worked consistently through March 22. Started failing on March 23 across multiple fresh sessions. No local configuration changes between these dates.
  5. Works in existing sessions — invoking the skill mid-conversation works fine. Only breaks when invoked as the first message in a new session.
  6. 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.

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗