Xpersona
C

compression-strategy

CLAWHUB · Unverified

Recommends context compression strategies for bloated or quota-heavy sessions Skill: compression-strategy Owner: athola Summary: Recommends context compression strategies for bloated or quota-heavy sessions Tags: latest:1.9.19 Version history: v1.9.19 | 2026-08-26T13:09:49.027Z | user Release v1.9.19 v1.9.17 | 2026-07-30T05:32:11.662Z | user Release v1.9.17 v1.9.16 | 2026-07-14T19:49:00.108Z | user Release v1.9.16 v1.9.15 | 2026-07-04T21:22:32.273Z | user Release v1.9.15 v1.9.14 | 2026-06-30T1

62
Rank
84
Safety
1.6k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.6K downloads reported by the source. Last updated 10/10/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s17emme0e2m3cpf7k2jvp3a84984b8z9:nm-conserve-compression-strategy
  1. Setup complexity is classified as HIGH. You must provision dedicated cloud infrastructure or an isolated VM. Do not run this directly on your local workstation.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-athola-nm-conserve-compression-strategy/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

131,049 characters of source documentation, loaded on request.

Extracted files

4 files captured from the source.

SKILL.md

---
name: compression-strategy
description: Recommends context compression strategies for bloated or quota-heavy sessions
version: 1.9.8
triggers:
  - context feels sluggish or quota burns faster than expected
metadata: {"openclaw": {"homepage": "https://github.com/athola/claude-night-market/tree/master/plugins/conserve", "emoji": "\ud83e\udd9e"}}
source: claude-night-market
source_plugin: conserve
---

> **Night Market Skill** — ported from [claude-night-market/conserve](https://github.com/athola/claude-night-market/tree/master/plugins/conserve). For the full experience with agents, hooks, and commands, install the Claude Code plugin.


# 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 | 8

_meta.json

{
  "ownerId": "kn7d107jg9jv602h9ytsegydq184a42s",
  "slug": "nm-conserve-compression-strategy",
  "version": "1.9.19",
  "publishedAt": 1787749789027
}

modules/log-debugging-hygiene.md

# Log Debugging Hygiene

When pasting logs into a Claude Code session, filter at the
source before you reach for compression. On the committed
`intake_queue.jsonl` fixture in this repo, `tail -n 100` saves
95.6% of bytes; the best lossless compressor we measured saves
70.3%. Filter wins by 25 percentage points and stays forensically
useful because output remains a literal subset of the log.

This module formalizes a three-tier workflow so that compression
is the last lever pulled, not the first.

## When to Use

Reach for this module when any of the following apply:

- About to paste more than 100 log lines into a session.
- A previous paste pushed context above 50% utilization.
- A debugging trace, CI failure, or hook log is the source of
  the bloat (not chat history or code).
- A teammate or skill recommended "compression" before any
  filtering was tried.

Skip this module if the paste is already under 2000 tokens or
if the entire log is needed verbatim for a regression report.

## Required TodoWrite Items

1. `log-debug:tier-1-filtered`
2. `log-debug:tier-2-minimized`
3. `log-debug:token-measured`

## Tier 1: Filter at Source (90-99% byte reduction)

Filtering keeps the lines you actually need and discards
the rest. This step delivers the largest savings and
requires no new tooling.

| Scenario | Command | Why |
|----------|---------|-----|
| Last N lines | `tail -n 100 file.log` | Most recent state |
| First N lines | `head -n 50 file.log` | Startup or init |
| Pattern matches | `rg -n "ERROR\|FAIL" file.log` | Targeted lines |
| Context around match | `rg -B 5 -A 10 "panic" file.log` | Surrounding rows |
| JSON field filter | `jq -c 'select(.level=="error")' f.jsonl` | Structured data |
| Time window | `awk '/14:23:00/,/14:24:00/' file.log` | Slice by stamp |
| Last N unique | `sort -u file.log \| tail -n 30` | Dedup then trim |

Benchmark on this repo's `plugins/memory-palace/data/intake_queue.jsonl`
(1.05 MB, 1333 lines):

| Command | Output bytes | Reduction |
|---------|--------------|-----------|
| `tail -n 100` | 47 KB | 95.6% |
| `jq -c 'select(.tool_name)' \| tail -n 20` | 14 KB | 99.1% |
| logs-tokenizer (compress all) | 491 KB | 70.3% |

Filter beats compression by 25-29 percentage points on this
fixture and by ~99x in absolute reduction when `jq` can
specify the relevant rows. The
`tests/test_log_debugging_hygiene.py::test_filter_first_claim_is_reproducible`
test guards this property.

## Tier 2: Minimize Structurally (50-95% reduction)

When you cannot filter to specific lines, switch your tool to
its most compact output mode. Many tools have a flag for this.

| Tool | Verbose form | Compact form |
|------|--------------|--------------|
| `git log` | `git log` (full) | `git log --oneline -20` |
| `git diff` | `git diff` | `git diff --stat` |
| `pytest` | `pytest -v` | `pytest --tb=short -x` |
| `cargo build` | full output | `2>&1 \| rg "^(error\|warning)" \| head -50` |
| `jq` | pretty | `jq -c` (single-line) |
| `npm install` 

skill-card.md

## Description:

Recommends context compression strategies for bloated or quota-heavy sessions.

This skill is ready for commercial/non-commercial use.

## Publisher:

[athola](https://clawhub.ai/user/athola)

### License/Terms of Use:

MIT-0

## Use Case:

Developers and engineers use this skill to assess context bloat, choose a compression or delegation strategy, and reduce token pressure before or during long agent sessions.

### Deployment Geography for Use:

Global

## Known Risks and Mitigations:

Risk: Clearing or compacting context can lose unsaved state or recent decisions.

Mitigation: Confirm critical session state is saved before /clear, and use catchup or an archive summary to reload active context.

Risk: Pasted logs and archived session files can expose secrets or sensitive operational data.

Mitigation: Filter and redact logs before pasting, and avoid archiving secrets into .claude files.

Risk: Optional token counting can depend on third-party tooling availability and version drift.

Mitigation: Prefer a pinned or preinstalled tiktoken environment before relying on token measurements.

## Reference(s):

- [ClawHub Skill Page](https://clawhub.ai/athola/skills/nm-conserve-compression-strategy)
- [Conserve Plugin Homepage](https://github.com/athola/claude-night-market/tree/master/plugins/conserve)
- [Log Debugging Hygiene Module](modules/log-debugging-hygiene.md)
- [Drain3](https://github.com/logpai/Drain3)
- [logs-tokenizer](https://github.com/sergeivaskov/logs-tokenizer)
- [LLMLingua](https://github.com/microsoft/LLMLingua)

## Skill Output:

**Output Type(s):** [Text, Markdown, Shell commands, Guidance]

**Output Format:** [Markdown with analysis, recommendations, estimates, and inline shell commands]

**Output Parameters:** [1D]

**Other Properties Related to Output:** [May propose manual session-state saves, context archiving, filtering, summarization, delegation, or continuation-agent handoff.]

## Skill Version(s):

1.9.19 (source: server release evidence; artifact frontmatter lists 1.9.8)

## Ethical Considerations:

Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.

Sponsored

Ads related to compression-strategy and adjacent AI workflows.