self-managed-context
Was er macht
Dieser Skill behandelt Agenten, die ihren eigenen laufenden Kontext steuern und entscheiden, was sie behalten, verdichten oder entfernen, statt dass ein festes System das ĂŒbernimmt. Er ist fĂŒr Teams gedacht, die mit Modellen experimentieren, die ihr eigenes ArbeitsgedĂ€chtnis bearbeiten.
Wann du ihn nutzt
- âWenn ein Modell seinen eigenen Kontext bearbeiten soll, statt einem festen Verdichtungsplan zu folgen.
- âWenn du Sicherheitsregeln brauchst, damit Selbstbearbeitungen das Caching nicht brechen oder versteckte Anweisungen hinzufĂŒgen.
- âWenn ein Agent Details wortgetreu behalten und irrelevante auf Abruf entfernen muss.
Link zum Skill
https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/self-managed-context/SKILL.mdKopiere ihn und fĂŒge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.
So nutzt du ihn
Am einfachsten: Kopiere die Nachricht und fĂŒge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.
Fertige Nachricht zum EinfĂŒgen
FĂŒr Claude Code, Codex oder Cursor: FĂŒhre den Befehl in deinem Projektordner aus, dann wird der Skill installiert.
Lade die SKILL.md herunter und lege sie in den Skills-Ordner deines Agenten.
Beispielanfrage an deine KI
âLass meinen Agenten wĂ€hrend einer langen Aufgabe seine eigenen Arbeitsnotizen bearbeiten, und stell sicher, dass er seine Anweisungen nicht versehentlich beschĂ€digt.â
5 neue Skills pro Woche. 1 Minute Lesezeit.
So funktioniert es
Der Skill beschreibt, den Kontext als bearbeitbare Datei verfĂŒgbar zu machen, mit Schutzmechanismen wie einem festen PrĂ€fix, einer Bearbeitungsschranke, Bearbeitungsbelegen und Rollback, wenn das Fenster ĂŒberlĂ€uft.
Technischer Inhalt (originale SKILL.md)
Originaltext des Autors, auf Englisch, direkt von GitHub.
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:
- Replacement-note content and fixed-threshold summarization:
context-compression. - Cache-stable layout and observation masking under harness control:
context-optimization. - File offloading while the live context stays append-only:
filesystem-context. - Latent KV transfer between agents:
latent-briefing. - Cross-session stores:
memory-systems. - Loop governance and acceptance gates:
self-improvement-loops. This skill supplies the context-editing signal; that skill governs the loop.
Core Concepts
The Control Spectrum
Context-management designs differ in who decides the transition from one context to the next. Append-only agents extend the context each step; a self-managing agent produces the whole next context as a function of the current one.
| Level | Who decides | Examples | Characteristic failure |
|---|---|---|---|
| Harness-scheduled | Harness, at a threshold or every turn | Threshold summarization, per-turn state rewrite | Wrong timing; summaries lose or invent verbatim state |
| Action-based | Model chooses when; harness defines what | Self-compaction tools, offload-and-retrieve tools, context folding | Strategy bounded by the action set; offload without eviction |
| Model-controlled | Model chooses when and what, with general tools | Context as an editable file | Edit cache cost, budget blindness, persisting self-written instructions |
A diagnostic built to isolate context management from reasoning (verbatim retention, in-place board updates, offload-and-evict) found no fixed strategy perfect even on simple synthetic tasks (claim-self-managed-context-contextbench-pilot). Each failure maps to a missing capability: summaries cannot hold exact values, append-only designs re-emit full state for every small update, and tool-based offloading cannot remove the original from the window.
Context as an Editable File
The implementation needs no new model capability:
- Split the context into a pinned prefix (system prompt and task) and an editable region (every later turn).
- Before each command, render the editable region to a file, each turn preceded by a header such as
[[CTX_TURN 7 role=tool]]. - The model edits the file with the same shell and code tools it uses for the task, locating text with code (header regexes, unique anchors) instead of retyping it.
HĂ€ufige Fragen
Was ist ein selbstverwalteter Kontext?
Das Modell entscheidet selbst, was in seinem laufenden Kontext bleibt, statt dass ein festes System es entscheidet.
Warum kosten Bearbeitungen extra?
Bearbeitungen können das PrĂ€fix-Caching brechen. Eine ungĂŒnstig platzierte Ănderung kann daher mehr Rechenaufwand verursachen als der freigewordene Platz.
Welche Schutzmechanismen beschreibt er?
Ein festes PrĂ€fix, eine Bearbeitungsschranke, Bearbeitungsbelege, Budgetanzeigen und Rollback, wenn der Kontext ĂŒberlĂ€uft.
Details
Originalbeschreibung des Autors
This skill should be used when a model gets read-write control over its own live context window instead of a harness-scheduled compaction policy: the context exposed as an editable file the model rewrites with code tools, model-driven eviction and in-place updates, the harness invariants that keep self-editing safe (pinned prefix, edit gate, edit receipts, budget readouts, rollback on overflow), the prefix-cache cost of mid-context edits, and steering or training the model's own context-editing strategy. Route note content and fixed-threshold summarization to context-compression, cache-stable
Beliebtheit
- GitHub-Sterne
- 18k
- Platz im Ranking
- #10651
- Lizenz
- MIT
- Aktualisiert
- 11.10.2026
Kommentare
- âŠ
Weitere Skills aus diesem Repository
context-engineering-collection
18kHilft deinem Agenten, zu verwalten, was in das Kontextfenster eines KI-Modells kommt, von GedÀchtnis und Werkzeugen bis zu Multi-Agenten-Setups und Evaluation.
advanced-evaluation
18kBringt deinem Agenten bei, KI-Antworten mithilfe einer anderen KI zu beurteilen, mit Bewertung, direktem Vergleich und PrĂŒfungen auf Verzerrungen.
bdi-mental-states
18kBringt deinem Agenten bei, Ăberzeugungen, Ziele und PlĂ€ne nach dem BDI-Ansatz zu modellieren, damit seine Entscheidungen nachvollziehbar und erklĂ€rbar sind.
context-compression
18kHilft deinem Agenten, lange KI-Sitzungen in Zusammenfassungen zu kĂŒrzen, die Entscheidungen, Dateien, Risiken und nĂ€chste Schritte erhalten.
Ăhnliche Skills
add-model-provider
394kLĂ€sst deinen Agenten einen neuen KI-Modellanbieter mit sicheren Befehlen an OpenClaw anbinden, API-SchlĂŒssel nicht im Klartext speichern und einen Live-Test starten.
acp-router
394kHilft deinem Agenten, eine Aufgabe ĂŒber OpenClaw an einen Coding-Assistenten wie Claude Code oder Cursor zu senden, damit die Arbeit in diesem Tool lĂ€uft.
browser-automation
394kBringt deinem Agenten bei, Webseiten Schritt fĂŒr Schritt zu steuern, einschlieĂlich Anmeldungen, Tabs und Wiederherstellung, wenn eine Seite nicht mehr reagiert.