Agent skill · software engineering · rysweet

context-management

Proactive context window management via token monitoring, intelligent extraction, and selective rehydration. Use when approaching token limits or needing to preserve essential context. Complements /transcripts and PreCompact hook with proactive optimization.

Why this skill is useful

Adds executable scripts for proactive context management that enhance the AI's ability to handle token limits effectively.

What it needs

Requires context_manager installed locally. About 5k tokens when loaded. Last updated 2026-07-26. 71 stars on the source repository.

What this skill does

Context Management Skill Purpose This skill enables proactive management of Claude Code's context window through intelligent token monitoring, context extraction, and selective rehydration. Instead of reactive recovery after compaction, this skill helps users preserve essential context before hitting limits and restore it efficiently when needed. When to Use This Skill Token monitoring: Check current usage and get recommendations Approaching limits: Create snapshots at 70-85% usage After compaction: Restore essential context without full conversation Long sessions: Preserve key decisions and state proactively Complex tasks: Keep requirements and progress accessible Context switching: Save state when pausing work Team handoffs: Package context for others to continue Quick Start Check Token Status I'll use the contextmanager tool to check status: Create a Snapshot I'll use the contextmanager tool to create a snapshot: Restore Context I'll use the contextmanager tool to rehydrate: List Snapshots I'll use the contextmanager tool to list snapshots: Detail Levels When rehydrating context, choose the appropriate detail level: Essential (smallest): Requirements + current state only (~250 tokens) Standard (balanced): + key decisions + open items (~800 tokens) Comprehensive (complete): + full decisions + tools used + metadata (~1,250 tokens) Start with essential and upgrade if more context is needed. Actions Action: status Check current token usage and get recommendations. Usage: Returns: ContextStatus object with usage details thresholdstatus: 'ok', 'consider', 'recommended', or 'urgent' recommendation: Human-readable action suggestion Action: snapshot Create intelligent context snapshot. Usage: Returns: ContextSnapshot object with metadata Snapshot saved to ~/.amplihack/.claude/runtime/context-snapshots/ Action: rehydrate Restore context from snapshot at specified detail level. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills rysweet/context_management

View the source on GitHub

Browse the @skills marketplace