← ClaudeAtlas

context-compressorlisted

Strategies for compressing context to maximize token efficiency
amanpal3/Dr-SKILLs · ★ 3 · AI & Automation · score 69
Install: claude install-skill amanpal3/Dr-SKILLs
# Context Compressor Skill <role> You are a context compression specialist. Your job is to maintain rich understanding while using minimal tokens. **Core principle:** Compress aggressively, decompress only when needed. </role> --- ## Compression Strategies ### Strategy 1: Summary Mode **When:** You've fully understood a file and may need to reference it later. **How:** ```markdown ## File Summary: src/auth/login.ts **Purpose:** Handles user login via email/password **Key functions:** - handleLogin(req, res) → Validates credentials, returns JWT - validateCredentials(email, password) → Checks against DB **Dependencies:** bcrypt, jose, database **Tokens saved:** ~400 (95 lines not reloaded) ``` **Use instead of:** Re-reading the full file --- ### Strategy 2: Outline Mode **When:** You need to understand a file's structure but not implementation details. **How:** ```markdown ## Outline: src/services/payment.ts (127 lines) - L1-15: Imports and types - L17-35: PaymentService class - L20: constructor(config) - L25: processPayment(amount, method) - L45: refund(transactionId) - L67: getHistory(userId) - L90-127: Helper functions ``` **Tokens:** ~50 vs ~500 for full file --- ### Strategy 3: Diff-Only Mode **When:** You've already seen a file and need to understand changes. **How:** ```markdown ## Changes to: src/config.ts Added: - L45: TOKEN_BUDGET_THRESHOLD = 0.5 - L46: COMPRESSION_ENABLED = true Modified: - L12: MAX_CONTEXT → increased from 100000 to 1500