Tooluck logoTooluck
SKILL.md

self-managed-context

Agent skill frommuratcankoylan/Agent-Skills-for-Context-Engineering

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 layout under harness control to context-optimization, file offloading to filesystem-context, and loop governance to self-improvement-loops.

How to install self-managed-context

install self-managed-context
# install the Agent-Skills-for-Context-Engineering pack with the skills CLI
npx skills add muratcankoylan/Agent-Skills-for-Context-Engineering

# or add only this skill to Claude Code: copy the folder

skills/self-managed-context/

# into

~/.claude/skills/self-managed-context/ (all projects)

.claude/skills/self-managed-context/ (one project)

skills/self-managed-context/SKILL.md

MITFull file
1# Self-Managed Context
2
3This 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).
4
5The 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.
6
7## When to Activate
8
9Activate this skill when:
10
11- Giving a model write access to its own live context instead of compacting on a fixed schedule
12…

Excerpt shown under the repository's MIT license.

More skills in Agent-Skills-for-Context-Engineering

Keep exploring

Similar skill repositories

nexu-io /

open-design
107k

The 1st Collaborative AI Design Agent Workspace. Local-first and open source. Create motion, prototypes, websites, apps, dashboards, presentations, images, and videos with your team and AI agents. Share work, exchange feedback, and iterate together in one workspace.

40 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates