self-managed-context

Installation
SKILL.md

Self-Managed Context

This skill covers agents that manage their own context window: the model, not the harness, decides what stays in the live context, what is compacted, what is evicted, and what is rewritten in place. The reference implementation is Context Language Models (CLMs), which mirror the editable part of the conversation into a file that the model edits with ordinary code tools, then re-parse that file into the next prompt. Applied zero-shot to existing models on a shared agent backbone, this matched or beat harness-scheduled and action-based context management on accuracy and compute across deep-research, terminal-coding, and multi-hour repository-optimization tasks (claim-self-managed-context-zero-shot-results, claim-self-managed-context-long-horizon-results).

The controlling trade-off: model control buys adaptivity (verbatim retention, surgical in-place updates, eviction on demand) and creates three problems the harness must absorb. Edits break prefix caching, so a badly placed edit can cost more compute than the tokens it frees. Models do not know how full their context is. And a model-writable context is a persistence channel for whatever the model writes into it, including instructions. Most of this skill is the harness contract that makes the first property worth the other three.

When to Activate

Activate this skill when:

  • Giving a model write access to its own live context instead of compacting on a fixed schedule
  • Designing a context-as-a-file protocol: turn headers, parse-back, pinned prefix, edit receipts
  • An agent must keep exact values, update state in place, or evict offloaded material, and fixed summarization loses or duplicates it
  • Pricing mid-context edits under prefix caching, or evaluating suffix cache reuse
  • Budget readouts, tiered nudges, or rollback for an agent that times its own compaction
  • Steering, evolving, or training a model's context-editing strategy
  • Diagnosing a self-editing agent that never edits, wipes useful state, livelocks after overflow, or carries injected instructions in its own notes

Do not activate this skill for adjacent work owned by other skills:

Installs
9
GitHub Stars
979
First Seen
13 days ago