compression-strategy
Recommends context compression strategies for bloated or quota-heavy sessions. Use when context feels sluggish or quota burns faster than expected.
What this skill does
# Compression Strategy Analyze current context usage and recommend optimal compression strategies. ## When To Use - Context feels bloated or sluggish - Before major task phase transitions (plan complete, starting implementation) - Token quota burning faster than expected - After large tool output accumulations ## When NOT To Use - Context-optimization skill already handling the scenario - Simple queries with minimal context - Freshly cleared context ## Required TodoWrite Items 1. `compression-strategy:analyze-context` 2. `compression-strategy:recommend-strategy` 3. `compression-strategy:estimate-savings` ## Step 1 – Analyze Context (`analyze-context`) Run `/context` to check current usage. Then estimate: 1. **Tool output accumulation**: How much context is from tool results vs. conversation? 2. **Stale content age**: How many turns since critical decisions were made? 3. **Active files**: Which files are still relevant vs. historical? ## Step 2 – Recommend Strategy (`recommend-strategy`) Based on analysis, recommend one of: ### Option A: `/clear` and `/catchup` Best when: - Task phase complete (planning done, implementation starting) - Context > 60% full - Most content is stale Process: 1. Save critical state to `.claude/session-state.md` 2. Run `/clear` 3. Run `/catchup` to reload active files ### Option B: Spawn Continuation Agent Best when: - Context > 80% full - Work in progress, can't stop - Delegatable tasks remain Process: 1. Run `Skill(conserve:clear-context)` to spawn continuation agent 2. Agent receives fresh context with saved state ### Option C: Archive and Summarize Best when: - Context 40-60% full - Some stale content mixed with active - Not ready for full clear Process: 1. Archive old decisions/errors to `.claude/context-archive/` 2. Summarize completed work in memory 3. Continue with leaner context ### Option D: Delegate to Subagent Best when: - Parallel work possible - Independent subtasks exist - Context pressure moderate Process: 1. Identify delegatable tasks 2. Spawn specialized agents via `Task` tool 3. Main context stays lean ## Step 3 – Estimate Savings (`estimate-savings`) For the recommended strategy, estimate: | Strategy | Typical Savings | Risk | |----------|-----------------|------| | /clear and /catchup | 70-90% | Low if state saved | | Continuation agent | 80-95% | Low, state preserved | | Archive and summarize | 20-40% | Very low | | Delegate to subagent | 30-50% | Low, parallel work | ## Context Archive Location Preserved context is saved to: ``` .claude/context-archive/pre-compact-YYYYMMDD-HHMMSS-SESSIONID.md ``` This is automatically created by the `pre_compact_preserve` hook before any `/compact` operation. ## Integration Points - **PreCompact hook**: Automatically preserves context before compression - **Tool output summarizer**: Warns when tool outputs accumulate - **Context warning hook**: Three-tier alerts at 40%/50%/80% ## Specialized Modules Load `modules/log-debugging-hygiene.md` when the bloat source is pasted log output (debug traces, CI failures, hook logs, JSONL). That module documents a three-tier filter-first workflow with benchmarked snippets and an honest framing of when compression is and is not warranted. On the committed `intake_queue.jsonl` fixture, `tail -n 100` beats lossless compression by 25 percentage points; the module formalizes that asymmetry. ## Example Usage ``` /compression-strategy ``` Output: ``` Context Analysis: - Current usage: 52% - Tool output: ~15KB (3 tool results) - Stale content: ~40% (decisions from 8+ turns ago) Recommendation: Option C - Archive + Summarize - Archive old decisions to context-archive - Keep active files and recent decisions - Estimated savings: 25-35% Commands: 1. Read .claude/context-archive/ to see what's preserved 2. Summarize completed work 3. Continue with leaner context ```
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.