ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

clear-context

Automatic context management with graceful handoff to a continuation subagent at 80% usage

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/athola/nm-conserve-clear-context
Or

Night Market Skill — ported from claude-night-market/conserve. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

Table of Contents

  • Quick Start
  • When to Use
  • The Auto-Clear Pattern
  • Thresholds
  • Auto-Clear Workflow
  • Integration with Existing Hooks
  • Self-Monitoring Pattern

Clear Context Skill

Quick Start

When context pressure reaches critical levels (80%+), invoke this skill to:

  1. Save current session state
  2. Delegate continuation to a fresh subagent
  3. Continue work without manual intervention
Skill(conserve:clear-context)

When To Use

  • Proactively: Before starting large multi-chained tasks
  • Reactively: When context warning indicates 80%+ usage
  • Automatically: Integrated into long-running workflows

When NOT To Use

  • Context usage is under 50% - continue working normally
  • Mid-critical-operation where handoff would lose state
  • Consider "Summarize from here" first (Claude Code 2.1.32+): Before full auto-clear, try partial summarization via the message selector. This compresses older context while preserving recent work — often sufficient to relieve pressure without a full handoff.

The Auto-Clear Pattern

Since /clear requires user action, we achieve automatic context clearing without interruption through subagent delegation:

Main Agent (high context)
    ↓
    Saves state to .claude/session-state.md
    ↓
    Spawns continuation subagent (fresh context)
    ↓
    Subagent reads state, continues work

Thresholds

LevelThresholdAction
WARNING40%Monitor, plan optimization
CRITICAL50%Prepare for handoff
EMERGENCY80%Execute auto-clear now

Configuration (environment variables):

  • CONSERVE_EMERGENCY_THRESHOLD: Override 80% default (e.g., 0.75 for 75%)
  • CONSERVE_SESSION_STATE_PATH: Override .claude/session-state.md default

Auto-Clear Workflow

Step 1: Assess Current State

Before triggering auto-clear, gather:

  • Current task/goal description
  • Progress made so far
  • Key decisions and rationale
  • Files being actively worked on
  • Open TodoWrite items

Step 1.5: Finalize Task List Before Handoff

Important: Before saving state or spawning a continuation agent, reconcile the task list:

Metadata

Author@athola
Stars4473
Views0
Updated2026-05-01
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-athola-nm-conserve-clear-context": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.