context-pruning-directive
Installation
SKILL.md
Dynamic Context Pruning (Sliding Memory Compactor)
Overview
In long-running autonomous agent sessions, every new message appends the entire historical transcript to the input array. If an agent executes 40 tool calls (reading files, executing bash commands, running test suites), historical tool outputs accumulate in the context window.
This unpruned history causes Quadratic Token Growth ($O(N^2)$): a 5,000-token file read at Turn 2 is needlessly re-sent on Turns 3 through 50, consuming 240,000 redundant input tokens and causing "Lost-in-the-Middle" Attention Degradation.
The Dynamic Context Pruning Protocol actively sanitizes historical turns: replacing stale, completed tool outputs with compact 1-line tombstone summaries and maintaining a high-density rolling memory buffer.