Agent Skills Fail at Five Stages: A Marker Test for Claude Code's Skill Pipeline
If you build Agent Skills, you now know that loading a Skill is not enough: references and scripts are separate layers that may never enter context or run. A few markers can tell you exactly which stage failed, saving you hours of guessing whether the model 'followed instructions'.
A local test with a mock model on Windows 11 exposes how Claude Code's Agent Skills really load. When a plain prompt asks the agent to say hi, the request contains 96,871 characters: the skill list includes the name and description, but the SKILL.md body never appears. An explicit /oversize-test call brings the body in, pushing the request to 108,008 characters, but references/note.md and scripts/probe.py still don't show their markers. The difference is 11,137 characters, roughly the size of the 152-line SKILL.md plus JSON overhead.
The root cause is a five-stage chain: discovery, trigger, loading, execution, and verification. Each stage has an observable exit, and any broken link makes the skill appear unused. The article provides a marker-based smoke test: add unique markers to SKILL.md, references, and scripts, then run an explicit call and check which markers appear. If only the body marker shows, the skill loaded but didn't execute references or scripts. The test also notes Claude Code's compression keeps only the last 5,000 tokens per skill (shared 25,000 token pool), and the skill list gets 1% of the context window with a 1,536-character description cap.
This method doesn't just diagnose; it prescribes fixes. Keep SKILL.md under 500 lines, put key references early, and separate deterministic scripts from judgment logic. Verify outputs with git diff or file existence, not with the model's claim. The author tested only one skill and one entry point, so the results don't cover multi-skill contention or real model behavior, but the five-stage check gives a practical debugging template for any skill.
The test isolates client-side behavior: a mock model means we see exactly what the client puts into the request, not what a real model would decide to do.
The 11,137-character difference between the two calls is almost exactly the SKILL.md's 10,832 characters plus JSON overhead, proving the body is loaded but nothing else is.
The five-stage chain is a useful debugging model, but the article stops at probe coverage: it doesn't inject failures in later stages, so claims about execution and verification are only assertions.
Character count and token count are easily conflated; the author carefully distinguishes them, a discipline many troubleshooting posts lack.