Reserved summary output budget

From ychampion/cskill-agents · View interactive version

Reserved summary output budget is an AI agent skill from the GitHub repository ychampion/cskill-agents. Reserve part of the context window for summary output so proactive compaction does not kill the response budget.

How to use this skill

Skill file

SKILL: Reserved Summary Output Budget

Domain: context-management

Trigger: Apply when proving that proactive compaction must shrink the usable context window to keep the summary output under a known token budget.

Source Pattern: Distilled from reviewed session memory, compaction, and context-budgeting implementations.

Core Method

Before inviting a compaction, shrink the effective context window by reserving room for the post-compaction summary (and any optionally re-injected skills/output). Calculate the base context window for the model, subtract a fixed upper bound on the summary tokens (20k here), and feed that reduced window to downstream budgeting logic so warning thresholds and blocking limits reflect the diminished headroom.

Key Rules

Example Application

When autocompact fires, compute the effective window as context window reserved summary tokens, then generate warnings based on that clipped value so autocompact threshold, warning threshold, and blocking limit stay consistent even though the API still sees the full context.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.