Documentation Index
Fetch the complete documentation index at: https://docs.selftune.dev/llms.txt
Use this file to discover all available pages before exploring further.
The problem
You write a skill. It works great on the first message. By the fifth message, the agent has forgotten half the instructions because the context window is full of conversation history, tool outputs, and other loaded skills. This is the most common frustration skill authors report: the skill “gets forgotten after five minutes.” The solution isn’t writing more instructions — it’s writing less, and loading them at the right time.Progressive disclosure in practice
The agent skills spec defines three tiers of loading:| Tier | What | When | Token cost |
|---|---|---|---|
| Catalog | Name + description | Session start | ~50-100 per skill |
| Instructions | Full SKILL.md body | When skill activates | <5000 recommended |
| Resources | Scripts, references, assets | When referenced | Varies |
Tier 1: Keep descriptions tight
Your description carries the entire burden of triggering. But it only needs to be a few sentences — the hard cap is 1024 characters.Tier 2: SKILL.md as a router, not a manual
If your SKILL.md is over 300 lines, you’re probably loading too much at activation. Use the router pattern to keep it lean:Tier 3: Load references only when needed
Don’t pre-load reference material. Tell the agent when to fetch it:CLI feedback loops
The most effective context management technique is moving intelligence out of the skill and into deterministic code that gives the agent feedback in real time. Instead of documenting every error path in your skill:- Smaller context footprint — error handling lives in code, not in the skill
- More reliable — deterministic code doesn’t hallucinate error handling
- Self-correcting — the agent gets immediate, specific feedback
What to keep in SKILL.md vs. code
| In SKILL.md | In scripts/CLI |
|---|---|
| When to use the skill | How to validate inputs |
| High-level workflow steps | Data transformation logic |
| Judgment calls (which approach to use) | Error messages with fix instructions |
| User-facing output formatting | File parsing and generation |
Practical token budgets
For a skill that coexists with conversation:| Component | Budget | Notes |
|---|---|---|
| Description (always loaded) | 50-100 tokens | Part of catalog |
| SKILL.md body | 1000-3000 tokens | Loaded at activation |
| Active workflow | 500-1500 tokens | One workflow at a time |
| Reference (if needed) | 500-1000 tokens | Only when referenced |
| Total peak | ~2000-5000 tokens |
Selftune’s role
selftune helps you stay lean by detecting when skills have context problems:- Grading tier 2 (process) catches when the agent deviates from skill instructions — often a sign that instructions were pushed out of context
- Evolution keeps descriptions optimally sized — not too broad, not too narrow
- Session analysis shows you which parts of your skill the agent actually uses, so you can move unused sections to references
Next steps
Structuring Skills
Organize skills with routers and workflows.
Iterating with selftune
Use real usage data to improve your skills.