What problem does it solve?
Long agent chat histories overflow the model's context window, and debugging or tuning stagewise's history compression requires deep knowledge of its trigger logic, boundary selection, serialization format, and model cascade that is scattered across the codebase.
Core Features & Use Cases
- Pipeline Internals Reference: Documents the trigger formula, boundary selection walk, token estimation quirks, chained compression behavior, and the three-model fallback cascade with all tuning knobs.
- SQLite Test Harness: Replays real compression events from local stagewise SQLite databases into playground-ready bundles (system prompt, user message, serialized history, actual output) for LLM playground comparison.
- Use Case: When a user reports context-window overflow or lossy compression, use this Skill to check the trigger formula, adjust
compactionThreshold or COMPRESSION_TARGET_CHARS, and replay the failing compression against alternative models to diff output quality.
Quick Start
Ask the agent to explain why history compression did not trigger for a chat and to extract the real compression test data from the local stagewise SQLite database for replay in an LLM playground.