Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

conserve

Resource optimization and performance monitoring for context window management.

Overview

Conserve helps you work efficiently within Claude’s context limits. It automatically loads optimization guidance at session start and provides tools for monitoring and reducing context usage.

Installation

/plugin install conserve@claude-night-market

Skills

SkillDescriptionWhen to Use
context-optimizationMECW principles and 50% context ruleWhen context usage > 30%
token-conservationToken usage strategies and quota trackingSession start, before heavy loads
cpu-gpu-performanceResource monitoring and selective testingBefore builds, tests, or training
mcp-code-executionMCP patterns for data pipelinesProcessing data outside context
optimizing-large-skillsLarge skill optimizationBreaking down oversized skills
bloat-detectorDetect bloated documentation, dead code, dead wrappersDuring documentation reviews, code cleanup
clear-contextContext window management strategiesWhen approaching context limits

Commands

CommandDescription
/bloat-scanDetect code bloat, dead code, and dead wrapper scripts
/unbloatRemove detected bloat with progressive analysis
/optimize-contextAnalyze and optimize context window usage
/analyze-growthPredict context budget impact of skill growth

Agents

AgentDescription
context-optimizerAutonomous context optimization and MECW compliance

Hooks

HookTypeDescription
session-start.shSessionStartLoads conservation guidance at startup

Usage Examples

Context Optimization

/optimize-context

# Analyzes:
# - Current context usage
# - Token distribution
# - Compression opportunities
# - MECW compliance

Growth Analysis

/analyze-growth

# Predicts:
# - Skill growth patterns
# - Context budget impact
# - Optimization priorities

Manual Skill Invocation

Skill(conservation:context-optimization)

# Provides:
# - MECW principles
# - 50% context rule
# - Compression strategies
# - Eviction priorities

Bypass Modes

Control conservation behavior via environment variables:

ModeCommandBehavior
NormalclaudeFull conservation guidance
QuickCONSERVATION_MODE=quick claudeSkip guidance for fast processing
DeepCONSERVATION_MODE=deep claudeExtended resource allowance

Examples

# Quick mode for simple tasks
CONSERVATION_MODE=quick claude

# Deep mode for complex analysis
CONSERVATION_MODE=deep claude

Key Thresholds

Context Usage

LevelUsageAction
LOW< 30%Normal operation
MODERATE30-50%Consider optimization
CRITICAL> 50%Optimize immediately

Token Quotas

  • 5-hour rolling cap: Prevents burst usage
  • Weekly cap: validates sustainable usage
  • Check status: Use /status to see current usage

MECW Principles

Minimum Effective Context Window strategies:

  1. Summarize Early: Compress large outputs before they accumulate
  2. Load on Demand: Fetch file contents only when needed
  3. Evict Stale: Remove information no longer relevant
  4. Prioritize Recent: Weight recent context higher than old

Optimization Strategies

For Large Files

# Don't load entire file
# Instead, use targeted reads
Read file.py --offset 100 --limit 50

For Search Results

# Limit search output
Grep --head_limit 20

For Git Operations

# Use stats instead of full diffs
git diff --stat
git log --oneline -10

CPU/GPU Performance

The cpu-gpu-performance skill monitors resource usage:

Skill(conservation:cpu-gpu-performance)

# Provides:
# - Baseline establishment
# - Resource monitoring
# - Selective test execution
# - Build optimization

MCP Code Execution

For processing data too large for context:

Skill(conservation:mcp-code-execution)

# Patterns for:
# - External data processing
# - Pipeline optimization
# - Result summarization

Superpowers Integration

CommandEnhancement
/optimize-contextUses condition-based-waiting for smart optimization
  • leyline: Provides MECW pattern implementations
  • abstract: Uses conservation for skill optimization
  • conjure: Delegates to external services when context limited