LLM agents accumulate long interaction histories, causing quadratic inference costs and performance loss as relevant details get diluted. Existing compression methods require offline training and cannot adapt to test-time dynamics. FOCUS reframes compression as preserving only the spans that causally influence future decisions, operating entirely at test time without any training or fine-tuning.
FOCUS estimates the counterfactual utility of each interaction span by simulating future trajectories with and without that span using a lightweight draft model. It selects which spans to keep based on their causal impact, preserving the structural integrity of agent traces (code, tool calls, etc.) that token-level methods might corrupt.
On five diverse agentic benchmarks (API/tool-calling, QA, web, multi-turn dialogue), FOCUS reduces peak context by up to 48% and dependency by 73%, while improving task success by up to 8.9 percentage points over uncompressed execution. It attaches as a modular, architecture-agnostic layer to any frontier model, including closed-API ones.