AGENTS.md tells it what to do.
COMPRESSION.md keeps it from forgetting.
COMPRESSION.md is a plain-text Markdown file you place in the root of any AI agent repository. It defines the rules for compressing context when token limits approach — what to keep, what to summarize, what to discard, and how to verify the result.
What problem does COMPRESSION.md solve?
Long-running AI agents fill their context window with conversation history, tool outputs, and intermediate reasoning. As the window fills, the agent loses access to earlier instructions, forgets decisions made earlier in the session, and degrades in quality. Without compression rules, this is either handled ad-hoc (unreliably) or not at all.
How does COMPRESSION.md work?
Drop COMPRESSION.md in your repo root and define: when to compress (75% context utilisation or token budget exceeded), what always to preserve (system prompt, active task, last 3 turns), what to compress aggressively (brainstorming, redundant information), and what to discard (completed work, redundant acknowledgements). After compression, a coherence check verifies no critical information was lost.
What regulations require COMPRESSION.md?
The EU AI Act (effective 2 August 2026) requires AI systems to maintain consistent and reliable behaviour. COMPRESSION.md provides the documented context management controls that long-session reliability requires.
How do I add COMPRESSION.md to my project?
Copy the template from GitHub and place it in your project root:
├── AGENTS.md
├── THROTTLE.md
├── COMPRESSION.md ← add this
├── README.md
└── src/
What did teams use before COMPRESSION.md?
Before COMPRESSION.md, context compression was either absent (agent silently degraded), hardcoded in the system prompt, or handled by ad-hoc logic no one documented. COMPRESSION.md makes context management version-controlled, auditable, and transparent.
Who benefits from COMPRESSION.md?
The AI agent reads it on startup. Your engineer reads it during code review. Your compliance team reads it during audits. Your regulator reads it if something goes wrong. One file serves all four audiences.
A complete protocol.
From slow down to shut down.
COMPRESSION.md is one file in a complete 12-part open specification for AI agent safety. Each file addresses a different level of control and recovery.
Frequently asked questions.
What is COMPRESSION.md?
A plain-text Markdown file defining context compression rules for AI agents. It specifies when to compress (based on context utilisation and token budgets), what to preserve (system prompt, active task, recent exchanges), what to compress or discard (brainstorming, completed work, redundant acknowledgements), and how to verify the result.
What does "preserve always" mean?
Items in the preserve_always list are never summarized or discarded during compression — they are copied verbatim into the compressed context. This includes the system prompt, active task instructions, the last 3 conversation turns, flagged bookmarks, recent error states, and pending actions.
What happens if compression verification fails?
The agent restores the pre-compression checkpoint, notifies the operator, and escalates to COLLAPSE.md for collapse prevention handling. Compression is rolled back rather than silently completing with data loss.
How does COMPRESSION.md relate to COLLAPSE.md?
COMPRESSION.md is proactive — compress context before it becomes a problem. COLLAPSE.md is reactive — detect and recover when context health has already degraded. Use both together. Compression prevents collapse; collapse detection catches what compression missed.
Can I set different compression rules for different agent types?
Yes — COMPRESSION.md supports adjustable compression_ratio_targets (light, standard, aggressive), configurable preserve_always lists, and scheduled compression intervals. Each agent project maintains its own COMPRESSION.md tuned for its specific context patterns.
Does COMPRESSION.md work with all AI frameworks?
Yes — it is framework-agnostic. It defines the policy; your agent implementation enforces it. Works with LangChain, AutoGen, CrewAI, Claude Code, custom agents, or any AI system that can monitor its own token consumption.
Own the standard.
Own compression.md
This domain is available for acquisition. It is the canonical home of the COMPRESSION.md specification — the context management layer of the AI agent safety stack, essential for any long-running agent deployment.
Inquire About AcquisitionOr email directly: [email protected]