Automatically prune unused context to save tokens
Automatically prune unused context to save tokens. Use when you're at critical usage or want to clean up old files, logs, and temporary data from your context window.
/plugin marketplace add vzwjustin/Claudecontext/plugin install vzwjustin-context-window-manager@vzwjustin/ClaudecontextExecute automatic context pruning to free up tokens immediately.
Run a comprehensive pruning analysis using an agent to:
Scan Current Context
Identify Pruning Candidates
High Priority (Safe to Remove):
Medium Priority (Review Before Removal):
Low Priority (Keep):
Calculate Savings For each candidate, estimate:
Execute Pruning
Based on current usage level:
If Critical (>85% usage):
If Warning (60-85% usage):
If Healthy (<60% usage):
Pruning Report
╔══════════════════════════════════════════════╗
║ CONTEXT PRUNING REPORT ║
╠══════════════════════════════════════════════╣
║ Files Analyzed: 25 ║
║ Pruning Candidates: 8 ║
║ Potential Savings: 45,000 tokens (22%) ║
║ ║
║ AUTO-PRUNE ACTIONS: ║
║ ✓ Removed test-output.log (12K tokens) ║
║ ✓ Removed old-schema.sql (18K tokens) ║
║ ✓ Removed backup-config.json (8K tokens) ║
║ ✓ Cleared old tool results (7K tokens) ║
║ ║
║ Total Freed: 45,000 tokens ║
║ New Usage: 55% (down from 77%) ║
║ Status: 🟢 Healthy ║
╚══════════════════════════════════════════════╝
Configure automatic pruning rules in your config:
{
"pruning": {
"enabled": true,
"auto_prune_threshold": 70,
"rules": {
"remove_after_minutes": 30,
"keep_patterns": ["src/**/*.js", "core/**"],
"always_prune_patterns": ["*.log", "*.tmp", "*backup*"],
"min_file_size_kb": 5
}
}
}
Option 1: Automatic (Recommended for Critical)
Please auto-prune my context immediately. I'm at critical usage.
Option 2: Interactive (Recommended for Warning)
Show me what can be pruned and let me choose.
Option 3: Dry Run (Recommended for Healthy)
Show me what would be pruned but don't execute.
Option 4: Aggressive (Emergency Only)
Aggressively prune everything not used in last 15 minutes.
Please specify your preference or let me choose based on current usage level.