context-shredding
Skill3 starsChanged 8 months agoMITArchived repositoryView on GitHub
Runtime context compression for agents approaching model context limits. Defines 3 compression tiers (full/summarized/minimal) with per-artifact templates. USE FOR: reducing artifact loading size at runtime, context budget management. DO NOT USE FOR: diagnostic context auditing (use context-optimizer), Azure infrastructure.
In this repository48 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- appinsights-instrumentationSkill
- azure-adrSkill
- azure-aigatewaySkill
- azure-aiSkill
- azure-artifactsSkill
- azure-bicep-patternsSkill
- azure-cloud-migrateSkill
- azure-complianceSkill
- azure-computeSkill
- azure-cost-optimizationSkill
- azure-defaultsSkill
- azure-deploySkill
- azure-diagnosticsSkill
- azure-diagramsSkill
- azure-hosted-copilot-sdkSkill
- azure-kustoSkill
- azure-messagingSkill
- azure-prepareSkill
- azure-quotasSkill
- azure-rbacSkill
- azure-resource-lookupSkill
- azure-resource-visualizerSkill
- azure-storageSkill
- azure-validateSkill
- context-optimizerSkill
- copilot-customizationSkill
- count-registrySkill
- docs-writerSkill
- drawioSkill
- entra-app-registrationSkill
- excalidrawSkill
- github-operationsSkill
- golden-principlesSkill
- iac-commonSkill
- make-skill-templateSkill
- mermaidSkill
- microsoft-code-referenceSkill
- microsoft-docsSkill
- microsoft-foundrySkill
- microsoft-skill-creatorSkill
- python-diagramsSkill
- session-resumeSkill
- terraform-patternsSkill
- terraform-search-importSkill
- terraform-testSkill
- workflow-engineSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Before loading a predecessor artifact file (01 through 07)
- Distinctive: line 15
When conversation length suggests >60% of model context is used
- Distinctive: line 16
When an agent needs to load multiple large artifacts
- Distinctive: line 28
Before loading any artifact file:
- Distinctive: line 33
If loading multiple artifacts, compress the older/less-critical ones first
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Context Shredding Skill
Runtime compression system that actively reduces context when agents approach model limits. Agents check approximate context usage before loading artifact files and select the appropriate compression tier.
When to Use
- Before loading a predecessor artifact file (01 through 07)
- When conversation length suggests >60% of model context is used
- When an agent needs to load multiple large artifacts
Compression Tiers
| Tier | Context Usage | Strategy |
full | < 60% | Load entire artifact — no compression |
summarized | 60-80% | Load key H2 sections only |
minimal | > 80% | Load decision summaries only (< 500 chars) |
Action Rules
Before loading any artifact file:
- Estimate context usage — count approximate conversation tokens
- Select tier based on the thresholds above
- Apply compression template from the reference doc below
- If loading multiple artifacts, compress the older/less-critical ones first
Tier Selection Protocol
1. Estimate current context usage (rough: 1 token ≈ 4 chars)
2. Check model limit (Opus: 200K, GPT-5.3-Codex: 128K)
3. Calculate usage percentage
4. Select tier:
< 60% → full (no compression needed)
60-80% → summarized (key sections only)
> 80% → minimal (decision summaries only)
5. Load artifact/skill using the appropriate variantSkill Loading Tiers
Skills also have compression tiers (digest and minimal variants):
| Context Usage | Skill Variant | Path Pattern | Approx Tokens |
| < 60% | Full | SKILL.md | 400-800 |
| 60-80% | Digest | SKILL.digest.md | 150-320 |
| > 80% | Minimal | SKILL.minimal.md | 40-100 |
Available for: azure-defaults, azure-artifacts, session-resume,
golden-principles, context-shredding.
Reference Index
| Reference | File | Content |
| Compression Templates | references/compression-templates.md | Per-artifact H2 sections per tier |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

