Context management
Keeping long agent threads inside a token budget without losing what matters led to sliding-window and priority-window context managers, per-tool staleness, compaction and residency — compared on token spend by an offline benchmark.