Proactive context window management via token monitoring, intelligent extraction, and selective rehydration. Features predictive budget monitoring, context health indicators, and priority-based retention. Use when approaching token limits or needing to preserve essential context. Complements /transcripts and PreCompact hook with proactive optimization.
View on GitHub.claude/skills/context-management/SKILL.md
January 21, 2026
Select agents to install to:
npx add-skill https://github.com/rysweet/amplihack/blob/main/.claude/skills/context-management/SKILL.md -a claude-code --skill context-managementInstallation paths:
.claude/skills/context-management/# 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.
**Version 3.0 Enhancements:**
- **Predictive Budget Monitoring**: Estimate when capacity thresholds will be reached
- **Context Health Indicators**: Visual indicators for statusline integration
- **Priority-Based Retention**: Keep requirements and decisions, archive verbose logs
- **Burn Rate Tracking**: Monitor token consumption velocity for early warnings
## 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
- **Predictive planning**: Get early warnings before capacity is reached
- **Session health**: Monitor context health for sustained productivity
## Quick Start
### Check Token Status
```
User: Check my current token usage
```
I'll use the `context_manager` tool to check status:
```python
from context_manager import check_context_status
status = check_context_status(current_tokens=<current_count>)
# Returns: ContextStatus with usage percentage and recommendations
```
### Create a Snapshot
```
User: Create a context snapshot named "auth-implementation"
```
I'll use the `context_manager` tool to create a snapshot:
```python
from context_manager import create_context_snapshot
snapshot = create_context_snapshot(
conversation_data=<conversation_history>,
name="auth-implementation"
)
#