ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified utilities Safety 5/5

context-management

Manage AI agent context window consumption, prevent compaction death spirals, and enforce sub-agent spawn policies. Use when: (1) context is filling up and work quality may degrade, (2) deciding whether to spawn a sub-agent or work in main session, (3) preparing for compaction or session handoff, (4) user asks "what's eating my context?" or "how much runway left?", (5) after compaction to restore working state from checkpoint files. NOT for: general memory/workspace management (use memory-keeper or workspace-standard).

Why use this skill?

Optimize your OpenClaw agent performance by managing context windows, enforcing sub-agent policies, and preventing memory exhaustion with this essential utility.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/marcus-daemon/context-management
Or

What This Skill Does

The context-management skill is a specialized utility designed to govern the OpenClaw agent's context window. It prevents the 'compaction death spiral'—a common phenomenon where recurring context summaries progressively consume memory, leaving less room for actual work. By implementing strict spawn policies and usage thresholds, this skill ensures the agent remains functional and performant over long-running sessions.

Installation

To install this skill, run the following command in your terminal: clawhub install openclaw/skills/skills/marcus-daemon/context-management

Use Cases

  • Proactive Maintenance: Use this when you notice the agent starting to 'forget' previous instructions or losing coherence during complex tasks.
  • Sub-Agent Orchestration: Perfect for when you need to perform deep research or large-scale file auditing without bloating your main interaction history.
  • System Monitoring: Call upon this tool when you need to audit 'what is eating the context' to determine if you need to compact, clean up, or start a fresh session.
  • Pre-Handoff Planning: Essential before performing system compactions, ensuring that a '.context-checkpoint.md' is generated to preserve critical working state.

Example Prompts

  • 'What is eating my context right now and how much runway do I have left before I need to compact?'
  • 'I need to run a large multi-file audit; should I spawn a sub-agent or run this directly in the main session?'
  • 'Context is at 75%, please write a checkpoint and prepare the environment for a session reset.'

Tips & Limitations

  • Respect the 60/40 Rule: Remember that tool outputs typically account for 60% of context consumption. Keeping tool-heavy tasks in sub-agents is the most effective way to protect your session length.
  • Understand Lossy Compaction: Compaction is not a perfect save-state; it is a lossy summary. Each cycle raises your 'floor' (the baseline context consumed). Use checkpoints to mitigate this.
  • Use Policy Files: If your workspace has a .context-policy.yml file, this skill will read it to determine specific spawn rules for your project, ensuring highly tailored context management.

Metadata

Stars1401
Views5
Updated2026-02-24
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-marcus-daemon-context-management": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#context#memory#optimization#agent-management#productivity
Safety Score: 5/5

Flags: file-write, file-read