# Context compaction

[4 · Read](/category/read/)

| Context compaction |
| --- |
| Category | [Read](/category/read/) |
| Also known as | compaction, trajectory folding, compact mode |
| Related | [Model Context Protocol](/protocols/mcp/), [llms.txt](/protocols/llms-txt/), [Markdown for Agents](/protocols/cloudflare-markdown-for-agents/) |

[Read](/category/read/) Context compaction is the set of protocol and runtime patterns used to keep an AI agent's working context window bounded across multi-turn tool invocations—preventing attention degradation and redundant token spend. On the network side, agentic protocols support compaction by serving Markdown twins (Accept: text/markdown instead of raw DOM HTML), exposing compact: true projections on verbose discovery/probe tools, and isolating noisy exploratory searches inside disposable subagents that return only structured summaries to the parent trajectory. Used by: mcp, llms-txt, cloudflare-markdown-for-agents.

## Instances

Not applicable.

## See also

- [Model Context Protocol](/protocols/mcp/)
- [llms.txt](/protocols/llms-txt/)
- [Markdown for Agents](/protocols/cloudflare-markdown-for-agents/)

## References

- [https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/](https://developers.cloudflare.com/fundamentals/reference/markdown-for-agents/) (2026-09-05) VERIFIED
- [https://agenticweb.wiki/AGENTS.md](https://agenticweb.wiki/AGENTS.md) (2026-10-15) VERIFIED

[JSON](/terms/context-compaction/index.json) · [Markdown](/terms/context-compaction/index.md) · [OKF v0.2](/okf/terms/context-compaction.md)
