Long-running tasks often do not fail at the start; they fail at the 80% mark—at the point when the context window is stuffed with reread files and the original plan is buried in a long rollback history. Instead of relying on model memory, treat the context window as a budget and spend tokens where they will leave a durable impact.
Plugin Introduction¶
This is a DSH plugin designed to prevent long-running tasks from failing at the 80% mark due to rereading and re-derivation by managing the context budget. It is maintained by ChenneyZhuang and belongs to the memory plugin category. The core goal of the plugin is to address the two budget-wasting patterns in long-running tasks—“rereading” and “re-derivation”—while ensuring that critical information remains available when the window is compressed.
Core Features¶
-
Tiered reading
First read the file header (about 100 lines) to understand the file’s shape, then read specific sections as needed, and finally perform targeted search. A full read is performed only when the header read confirms that middle parts of the file are relevant. This is a deliberate purchase, avoiding indiscriminate full-file loading. -
Notes over memory
As soon as facts, decisions, file paths, or caveats become established, write them immediately to a persistent “working notes file.” Notes files can survive window compression, whereas conversation logs usually cannot. This preserves information persistently. -
Checkpoint restatement
At task phase boundaries (for example, before a long build or after a major discovery), restate the plan and current state in three lines. This serves as an anchor for later phases and helps the model quickly recover context when the window is compressed.
Installation and Activation¶
Install using the official command:
npx skills add ChenneyZhuang/context-budget
MIT licensed, version v0.1.0.
Typical Usage¶
- Before reading a file completely, perform a “header read” to understand the file structure.
- When establishing a new fact, immediately write it to a persistent “working notes file.”
- When switching task phases, restate the plan as a three-line summary to use as the starting point for the next phase.
Applicable Scenarios and Cautions¶
- Applicable scenarios: Complex long-running tasks that require reading multiple files and more than 10 steps.
- Notes:
- Notes files introduce small write overhead.
- For tasks with few steps, the operating cost of the budget mechanism may exceed the tokens saved.
- Compression behavior varies by runtime, and exact guarantees depend on the runtime.
Short Closing¶
By shifting context management from “memory” to “budget,” this plugin helps avoid task failures at the 80% mark. See the plugin directory and GitHub repository for related resources.