본문으로 건너뛰기
Skillpedia
에이전트18k · #10651

self-managed-context

하는 일

이 스킬은 고정된 시스템이 대신 정하는 대신, 에이전트가 자신의 실시간 컨텍스트를 제어하며 무엇을 유지하고, 압축하고, 제거할지 정하는 경우를 다룹니다. 모델이 자신의 작업 메모리를 편집하는 방식을 실험하는 팀을 위한 스킬입니다.

사용하는 경우

  • ✓고정된 압축 일정 대신 모델이 자신의 컨텍스트를 직접 편집하기를 원할 때.
  • ✓자체 편집이 캐싱을 깨뜨리거나 숨은 지시를 추가하지 않도록 안전 규칙이 필요할 때.
  • ✓에이전트가 필요할 때 원래 그대로의 세부 내용은 남기고 관련 없는 내용은 제거해야 할 때.

스킬 링크

https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/self-managed-context/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/muratcankoylan/Agent-Skills-for-Context-Engineering/blob/main/skills/self-managed-context/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“긴 작업 중에 제 에이전트가 작업 메모를 직접 편집하게 해 주세요. 실수로 지시를 망가뜨리지 않도록 확실히 막아 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

스킬은 컨텍스트를 편집 가능한 파일로 노출하는 방법과, 고정된 접두부, 편집 게이트, 편집 영수증, 컨텍스트가 넘칠 때의 롤백 같은 안전장치를 설명합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 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:

  1. Split the context into a pinned prefix (system prompt and task) and an editable region (every later turn).
  2. Before each command, render the editable region to a file, each turn preceded by a header such as [[CTX_TURN 7 role=tool]].
  3. 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.
자주 묻는 질문

자체 관리 컨텍스트란 무엇인가요?

고정된 시스템이 대신 정하는 것이 아니라, 모델 자신이 실시간 컨텍스트에 무엇을 남길지 결정하는 방식입니다.

편집에 왜 비용이 더 드나요?

편집은 프리픽스 캐싱을 깨뜨릴 수 있으므로, 잘못 놓인 편집은 확보한 공간보다 더 많은 연산 비용을 들게 할 수 있습니다.

어떤 안전장치를 설명하나요?

고정된 접두부, 편집 게이트, 편집 영수증, 예산 표시, 컨텍스트가 넘칠 때의 롤백입니다.

상세 정보

작성자의 원본 설명

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

repo: muratcankoylan/Agent-Skills-for-Context-Engineering

인기도

GitHub 스타
18k
순위
#10651
라이선스
MIT
업데이트
2026. 10. 11.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬