ask-matt
MAmattpocock/skills336k近 7 天新增 4,217 个 star
This skill should be used when deciding, for a specific model and workload, whether the harness or the model should control compaction, and when qualifying or calibrating that choice with measurements: context-budget sweeps that compare harness-driven and model-driven compaction on one harness, the context-pressure regime where delegation pays, a per-model compaction behavior profile (interface uptake, compression factor per call, reopen rate of archived content, context fill at first compaction, response to pressure warnings), context anxiety and timing-instruction calibration, reversible collapse-and-archive interfaces, and re-qualification after a model or prompt change. Route the editable-file protocol, harness invariants, and edit-position cache cost of self-editing agents to self-managed-context, summary content to context-compression, harness thresholds and cache layout to context-optimization, and general evaluation design to evaluation.
This skill covers the decision that comes before any self-compacting agent design: for this model, on this workload, should the harness or the model decide when and what to compact? The answer is measured, not assumed. In a cross-model study that gave four current models one compaction interface and one set of instructions, one model nearly tripled its score at a tight context budget while another called the interface in a small minority of tasks and trailed the harness baseline until budgets were large (claim-compaction-control-tight-budget-gain, claim-compaction-control-uptake-variance).
The operating rule: treat compaction control as a property of one model at one context pressure under one prompt. The study saw the outcome change across models, across budgets, and with a single timing sentence. It did not test model versions or alternative wordings, so re-qualifying on those changes is a precaution this skill adds, not a measured result. Qualify the model with a budget sweep and a behavior profile, calibrate the timing instruction, assign control per model and pressure regime, and re-qualify when the model or the prompt changes.
Activate this skill when:
Do not activate this skill for adjacent work owned by other skills:
self-managed-context. This skill decides whether a model qualifies for that control and at which settings.context-compression.context-optimization.context-degradation.evaluation.long-horizon-prompting.Read a model's compaction behavior on four axes together, never one alone: whether it calls the interface, how much each call removes, whether it goes back for what it removed, and when it starts. Models given an identical interface diverge on all four (claim-compaction-control-uptake-variance, claim-compaction-control-compression-reopen, claim-compaction-control-context-anxiety). In the study, uptake was similar across the three models that used the interface, yet their gains differed; the one that gained most had the largest shrink per call and the highest reopen rate. Uptake alone is not the goal.
The table below is an operating rule derived from those results. The study observed the signals; it did not test the actions.
| Signal | Reading | Action |
|---|---|---|
| Low uptake, score at or below the harness baseline at tight budgets | The model is declining control | Keep harness-driven, or hybrid with a harness fallback |
| Low uptake, tasks end below the timing threshold | Compaction was never needed | Not a failure; the budget is loose for this task |
| First compaction far below the instructed threshold, or at low fill with no instruction | Context anxiety | Compare accuracy at large budgets with and without a timing floor. Add or raise the floor where early compaction costs accuracy; where accuracy holds, the floor is optional |
| Uptake collapses when a timing instruction is added | The instruction may be suppressing use | Check whether those tasks reach the warning or the fallback; if they do, lower the threshold or pair the floor with an explicit expectation to act |
| Large shrink per call with a high reopen rate | Aggressive, recovering through the archive | Acceptable; count the tokens spent on reopens |
| Large shrink per call, low reopen rate, score drop | State lost and not recovered | Require richer summaries; route summary content to context-compression |
| First pressure warning resolves as a returned answer | Warning read as a stop signal | Reword the warning to name compaction as the expected action |
Estimate context pressure, the ratio of what the task needs to what the window holds, before choosing a policy. Delegated control pays where pressure is high: the strongest gains appeared at tight budgets and shrank as budgets grew, and the one model that trailed the harness baseline caught up only at large budgets. On a second benchmark, whose tasks the authors believe need far less context, the effect was much smaller and confined to the tightest budgets (claim-compaction-control-tight-budget-gain, claim-compaction-control-low-demand-benchmark). When an unconstrained run peaks well inside the window, keep the harness policy: delegation has little to buy and an anxious model can only lose state.
Qualify a model with a sweep, never a single budget, because the ranking of policies changes with pressure. Run both policies on the same harness, model, tools, tasks, and grader across a ladder of hard context budgets that brackets the task's natural peak (claim-compaction-control-study-setup).
| Condition | Definition |
|---|---|
| Harness-driven | At a fixed fraction of the budget, the harness summarizes earlier history and keeps the initial instructions and a fixed number of recent events verbatim |
| Model-driven | The model receives the compaction interface, a live usage readout, a timing instruction, and a pressure warning near the limit |
| Overflow fallback, both conditions | A request over the hard budget drops the oldest events and retries; after a fixed number of failures the task scores as failed |
Shrinking the budget stands in for longer tasks. It is a proxy, and the fallback that keeps runs alive at the smallest budgets is a context policy of its own that can move scores.
Log five metrics per budget. Definitions follow the study so results stay comparable with it.
| Metric | Definition | What it separates |
|---|---|---|
| Uptake | Share of tasks with at least one compaction call | Using control from declining it |
| Compression factor | Input tokens of the request in which the model decided to compact, divided by input tokens of the next request | Aggressive from timid calls; below one means the context grew |
| Reopen rate | Share of compaction calls whose archived events were later retrieved | Recovered state from state that was unneeded or lost; a lower bound |
| First-compaction fill | Fraction of the budget in use at the first compaction call in a task; median over tasks | Timely from anxious |
| Warning resolution | From the first pressure warning to episode end: returned an answer, compacted at once, read interface docs then compacted, inspected history then compacted, other | Compacting from wrapping up |
Calibrate the timing instruction per model, in both directions. Context anxiety is compaction that starts while ample space remains. With an instruction to consider compacting only past a high usage threshold, most models in the study waited until near it. Without it, two models started at under half of the budget and scored below the harness baseline at large budgets, and a third, which almost never compacted with the instruction, compacted early and regularly (claim-compaction-control-context-anxiety). The timing instruction is therefore a per-model dial that can err in two directions: absent, some models over-compact; present, one model in the study all but stopped compacting. The study reports no accuracy change for that model either way, so treat suppressed uptake as a signal to investigate, not as a demonstrated loss. One hypothesized cause of early compaction is training that penalizes long rollouts (claim-compaction-control-rollout-penalty). Treat the cause as conjecture and the behavior as measurable. Early compaction is the signal; its accuracy cost is a separate measurement, and the study found that cost in two of the three models that compacted early.
Profile against an interface where compaction is reversible: the model replaces a tagged range of events with a summary it writes, the harness archives the originals, and any archived event stays retrievable by its original tag (claim-compaction-control-reference-interface). Reversibility is what makes aggressive compaction safe to allow, and it makes the cost observable once the harness logs every read of an archived event. The reference harness does not log those reads itself; the study counted them from traces. A delete-only interface hides the same loss inside repeated tool calls.
Interface properties that keep the measurements clean:
Price a compaction policy in recomputed tokens, not only in tokens sent. A model-driven run can reach equal or better accuracy with fewer cumulative input tokens (claim-compaction-control-token-savings), but cumulative input counts every input token on every turn, cached or not. Under prefix caching an edit invalidates everything after it, so a shorter context is not automatically cheaper. A serving prototype that reused the cached state of the unchanged suffix reduced prefill per request with no measurable accuracy change, most where the surviving suffix was large (claim-compaction-control-suffix-kv-reuse). Report tokens and, where the serving stack is observable, prefill compute. Route edit placement and suffix reuse mechanics to self-managed-context.
These assignments, including hybrid layering, are design inferences from the study's results. The study compared the two policies separately and tested none of them as interventions.
| Regime | Profile | Assignment |
|---|---|---|
| Low pressure | Any | Harness threshold as backstop; if the interface is exposed, keep a timing floor so an anxious model does not compact needlessly |
| High pressure | Calls the interface near the threshold and recovers what it needs | Model-driven, with the overflow fallback kept |
| High pressure | Declines control or wraps up on the warning | Harness-driven, or hybrid once a reworded warning restores uptake |
| Any | Compacts early without a timing instruction | Model-driven with a calibrated timing floor wherever early compaction costs accuracy at large budgets; where accuracy holds, the floor is optional and the extra edits are priced instead |
For a hybrid, order the triggers so they cannot race: the model's timing threshold sits below the pressure warning, the warning below the harness fallback threshold, and the fallback below the hard limit. The harness then acts only when the model has declined to. Check that order at every budget: at tight budgets one large tool output is a large share of the window, which can push the warning and the fallback below a floor calibrated as a fraction of the budget. Lower the floor, cap tool output size, or run a single policy at that budget.
The study's instruction and warning text are not reproduced in the report or its companion post, so treat wording as an experimental variable and re-measure after every change.
Example 1: Behavior profile from run traces
def behavior_profile(tasks, budget):
calls = [c for t in tasks for c in t.compactions]
idle = [t for t in tasks if not t.compactions]
med = lambda values: median(values) if values else None # no calls at a budget is a result
return {
"uptake": len([t for t in tasks if t.compactions]) / len(tasks),
"declined": len([t for t in idle if t.warned or t.fallback_fired]) / len(tasks),
"never_needed": len([t for t in idle if not (t.warned or t.fallback_fired)]) / len(tasks),
"compression_factor": med(
[c.input_tokens_at_decision / c.input_tokens_next_request for c in calls]
),
"reopen_rate": (
len([c for c in calls if c.archived_tags & c.tags_retrieved_later]) / len(calls) if calls else None
),
"first_compaction_fill": med(
[t.compactions[0].input_tokens_at_decision / budget for t in tasks if t.compactions]
),
"warning_resolution": Counter(t.first_warning_outcome for t in tasks if t.warned),
"fallback_firings": sum(t.fallback_count for t in tasks),
}
Example 2: Reversible collapse with reopen telemetry
class Events:
def collapse(self, start_tag, end_tag, summary_text=None):
span = self.active_range(start_tag, end_tag) # inclusive; flattens nested summaries
for event in span:
self.archive[event.tag] = event # archived, never deleted
tag = f"{span[0].first}..{span[-1].last}"
self.replace(span, Summary(tag, summary_text, children=[e.tag for e in span]))
self.log("collapse", tag=tag, fill=self.fill(), tokens_removed=count(span))
return tag
def get(self, tag):
if tag in self.archive:
self.log("reopen", tag=tag, fill=self.fill()) # numerator of reopen rate
return self.archive[tag]
return self.active.get(tag)
Example 3: Instruction pair under test
Authored for this skill as a starting point for the ablation, not quoted from the study. {floor} is set per model from the sweep.
Timing instruction (floor plus expectation):
The context readout shows usage as a share of the budget. Do not compact below {floor}.
At or above {floor}, collapse settled work into a summary and continue the task.
Pressure warning:
Context is at {fill} of the budget. Collapse completed work now and keep working.
This is not a request to finish early. Archived events stay retrievable by tag.
Example 4: Assignment record
model: <model id and version>
prompt_hash: <hash of interface docs, timing instruction, warning text>
workload: document research; natural peak several times the production budget
profile: # illustrative values
uptake: 0.44
declined: 0.03
first_compaction_fill: 0.83
compression_factor: 2.4
reopen_rate: 0.08
timing_ablation: without the floor, first compaction moves to low fill and the large-budget score drops
assignment: model-driven with timing floor; harness fallback above the warning
requalify_on: [model version, prompt_hash, interface change]
This skill connects to:
Internal references:
Related skills in this collection:
External resources:
Created: 2026-11-26 Last Updated: 2026-11-26 Author: Agent Skills for Context Engineering Contributors; primary technical source Devoto et al., Letting Models Manage Their Own Context: Where We Stand (arXiv 2611.34147) and the public NOOA harness code Version: 1.0.0
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
MAmattpocock/skills336k近 7 天新增 4,217 个 star
OBobra/superpowers331k近 7 天新增 5,030 个 star
AFaffaan-m/ECC314k近 7 天新增 3,503 个 star
AFaffaan-m/ECC314k近 7 天新增 3,503 个 star