# Compress Agent Context Without Losing Critical Details

Long agent sessions can lose critical decisions, file changes, and error details when history is compressed. This skill provides structured compression and probe-based evaluation methods that preserve useful context while reducing repeated exploration.

## Install

```bash
npx skillstore add sickn33/context-compression
```

## Metadata

- Status: approved
- Slug: sickn33-context-compression
- Skillstore revision: r2
- Version status: missing
- Tree hash: 42d390a87ce3585f5ac01e47dffc9043da718f0c53e6440332167dbc791b8a58
- Author: sickn33
- GitHub username: sickn33
- License: MIT
- Repository: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/context-compression
- Ref: f9e2c34b4f19c7f3e6b0a1e93227b5f77cc12526
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/sickn33-context-compression
- Manifest: https://skillstore.pages.dev/api/skills/sickn33-context-compression/manifest

## Capabilities

- Compares anchored iterative, opaque, and regenerative compression strategies
- Defines structured summary sections for intent, files, decisions, state, and next steps
- Explains fixed-threshold, sliding-window, importance-based, and task-boundary triggers
- Provides a three-phase workflow for research, planning, and implementation
- Defines functional probes for recall, artifacts, continuation, and decisions
- Frames compression quality around total tokens consumed per completed task

## Use Cases

- Preserve Long Coding Sessions: Create durable summaries that preserve modified files, decisions, errors, test results, and next actions during long coding sessions.
- Plan Context Window Management: Select trigger thresholds and compression methods for agents operating near model context limits.
- Evaluate Compression Quality: Build recall, artifact, continuation, and decision probes that measure whether compressed context supports task completion.

## Prompt Templates

### Create a Structured Summary

```
Compress the provided session into Session Intent, Files Modified, Decisions Made, Current State, and Next Steps. Preserve exact file paths, errors, and test results.
```

### Choose a Compression Strategy

```
Compare anchored iterative, opaque, and regenerative compression for this workload. Recommend one approach using context size, interpretability, and refetching costs.
```

### Design Functional Probes

```
Create recall, artifact, continuation, and decision probes for the supplied compressed session. Include expected answers and explain what each probe measures.
```

### Build a Tokens-Per-Task Experiment

```
Design a tokens-per-task experiment comparing two compression strategies across repeated compression cycles. Measure token savings, refetching, factual accuracy, artifact retention, and completion quality.
```

## Limitations

- Provides guidance and examples, not an executable compression implementation
- Cannot guarantee complete artifact retention across repeated compression cycles
- Requires workload-specific thresholds and evaluation data
- Referenced benchmark results and external sources are not bundled with the skill

## Best Practices

- Preserve exact file paths, errors, decisions, and test status in dedicated sections
- Merge newly truncated content into an anchored summary instead of regenerating everything
- Evaluate tokens per completed task, including refetching and repeated exploration

## Anti Patterns

- Optimize only for the smallest possible summary
- Regenerate the entire summary without checking for information drift
- Trust a high compression ratio without functional retention probes

## Security Audit

- Audited at: 2026-07-23T21:01:20.869\+00:00
- Summary: All three external-command findings are Markdown fence markers, not executable Ruby or shell syntax. The reconnaissance findings are technical examples, and no prompt injection or malicious intent appears in SKILL.md.

## Stats

- Views: 160
- Downloads: 31
- Favorites: 0
- Popularity score: 0
