Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
athola avatar

Compression Strategy

  • 77 installs
  • 325 repo stars
  • Updated August 2, 2026
  • athola/claude-night-market

Compression Strategy is an agent skill that prescribes filter-then-minimize-then-compress steps before pasting large logs into Claude Code.

About

Compression Strategy (Log Debugging Hygiene) is an agent skill that teaches a disciplined order of operations when log output is too large for an AI coding session. Solo and indie builders shipping with Claude Code hit this constantly: a CI failure, hook trace, or server dump can push context past 50% utilization in one paste. The skill argues compression should be the last lever, not the first, and walks through Tier 1 filtering at the source (tail, grep, jq, time windows) for roughly 90–99% byte reduction, Tier 2 minimization, and only then optional compression—with token measurement baked in via required todos. It fits anyone debugging agents, pipelines, or production services who needs forensic lines without sacrificing the rest of the conversation. Skip it when the paste is already small or when every line must remain verbatim for a formal report.

  • Three-tier workflow: filter at source, then minimize, then compress only as a last lever
  • Required TodoWrite gates: tier-1-filtered, tier-2-minimized, token-measured
  • Fixture-backed guidance: tail -n 100 beats gzip -9 by ~30 percentage points on byte savings
  • Scenario table for tail, grep, jq, and time-window filters before any compression
  • Explicit skip rules when the full log must stay verbatim (e.g. regression reports)

Compression Strategy by the numbers

  • 77 all-time installs (skills.sh)
  • Ranked #257 of 596 Debugging skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/athola/claude-night-market --skill compression-strategy

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs77
repo stars325
Security audit3 / 3 scanners passed
Last updatedAugust 2, 2026
Repositoryathola/claude-night-market

What it does

Shrink CI traces, hook logs, and debugging dumps before pasting them into Claude Code so you keep forensic signal without blowing context limits.

Who is it for?

Agent sessions debugging CI failures, hook logs, or server traces where only recent or matching lines matter.

Skip if: Tiny pastes under ~2000 tokens or audits that require the complete unfiltered log file.

When should I use this skill?

About to paste more than 100 log lines, context above 50% from a prior paste, or compression was suggested before filtering— for debugging/CI/hook logs.

What you get

You deliver a smaller, still-forensic log excerpt with measured token impact instead of blindly gzipping the whole trace.

  • Filtered log excerpt ready to paste
  • Token-measurement todo completion
  • Tier-1/2/3 hygiene checklist followed

By the numbers

  • Three-tier workflow with three required TodoWrite items
  • On repo fixture intake_queue.jsonl, tail -n 100 saves 95.0% bytes vs gzip -9 at 65.0%

Files

SKILL.mdMarkdownGitHub ↗

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:

StrategyTypical SavingsRisk
/clear and /catchup70-90%Low if state saved
Continuation agent80-95%Low, state preserved
Archive and summarize20-40%Very low
Delegate to subagent30-50%Low, parallel work
Reversible compression (CCR)47-92% per archived outputLow, original cached

The CCR row is per oversized tool output, not whole-context: a large Bash, Read, or Grep result is archived to a handle and replaced by a digest for future turns. Savings are content-type-dependent (logs compress hard, prose barely at all). See modules/reversible-compression.md.

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.

Load modules/reversible-compression.md when large tool outputs (code search, log dumps, file reads) are the bloat source. That module documents the CCR pattern: the tool_output_summarizer hook archives any oversized output to a content-addressed handle under .claude/context-archive/, and context_retrieve.py fetches the original (or a slice) on demand, so the original survives /clear without staying resident.

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

Exit Criteria

  • [ ] Context analyzed: current usage and tool-output share estimated
  • [ ] A single strategy recommended (A-D, or reversible compression) with a

stated reason

  • [ ] Savings estimated with the named risk from the Step 3 table
  • [ ] For large tool outputs, the CCR handle and context_retrieve.py

retrieval command are surfaced (not just a warning)

  • [ ] Recommendation refused or downgraded when the bloat source is dense

prose (compresses by roughly nothing)

Related skills

How it compares

Use a structured hygiene workflow instead of reaching for gzip or full-file paste as the default.

FAQ

Who is compression-strategy for?

Developers using Claude Code or similar agents who regularly paste CI, hook, or server logs into chat and need to protect context window budget.

When should I use compression-strategy?

Before pasting more than ~100 log lines, after a paste pushed context above ~50%, or when a teammate suggested compression before filtering—also during Ship CI triage and Build-time local debugging.

Is compression-strategy safe to install?

It is procedural documentation and shell examples for log handling; review the Security Audits panel on this page before installing any skill from the repo.

Debuggingdevopstesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.