context-window

Manage LLM context-window budgets with token zoning and 80% compaction rules.

1|Updated May 6, 2026
One-click install
npx skills add https://github.com/jacob-balslev/skill-graph --skill context-window-jacob-balslev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-window
Source: https://github.com/jacob-balslev/skill-graph/tree/main/marketplace/skills/context-window
Command: npx skills add https://github.com/jacob-balslev/skill-graph --skill context-window-jacob-balslev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents LLM agent sessions from silently failing due to context-window overrun by enforcing budget zoning and an 80% compaction rule with checkpointed recovery.

Core Features & Use Cases

  • Context health states & budgeting: Defines ok, compact, and exhausted states and allocates tokens across System, Skill injection, and Working zones.
  • Pre/post compaction protocols: Specifies what to checkpoint before compaction and how to rebuild the session afterward using continuation signals and durable artifacts.
  • Token-cost patterns & reduction techniques: Guides deterministic CLI vs heavy tool-result paths, targeted reads (offset + limit), search-before-read, progressive skill disclosure, and count-mode exploration.

Quick Start

Use this skill when you see tool results or file reads truncating mid-task and you need to decide when to compact and what must be preserved before compaction.

Frequently Asked Questions about context-window

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my LLM agent session silently fail when the context window fills up?

LLM agent sessions fail due to context-window overrun when token budgets are unmanaged. This Skill prevents silent failures by enforcing budget zoning across System, Skill injection, and Working data, along with an 80% compaction rule.

How do I checkpoint and recover a long-running agent session after compaction?

Session recovery after compaction requires pre-compact checkpointing of decision trails and durable artifacts, followed by post-compact selective recovery using continuation signals to rebuild the working state without losing critical progress.

What is the best way to reduce token costs from heavy tool results in LLM agents?

Token-cost reduction is achieved through deterministic CLI shaping, targeted file reads using offset and limit, search-before-read patterns, progressive skill disclosure, and count-mode exploration to minimize heavy tool-result injection.

How does context window compaction preserve decision trails in multi-step audits?

Context window compaction preserves decision trails by checkpointing critical session artifacts before compaction and applying post-compact selective recovery to ensure multi-step audit continuity across the 80% threshold.

Can I use context window budgeting for agent sessions with different context limits like 1M or 200K tokens?

Context window budgeting applies to long-running agent sessions across various context sizes including 1M, 200K, and 128K tokens, dynamically allocating budgets across System, injected skill content, and working data zones.

When should I trigger compaction in an iterative tool-calling agent workflow?

Compaction should be triggered when the context health state reaches the 80% compaction rule threshold, indicated by tool results or file reads truncating mid-task, transitioning the session from the ok state to the compact state.