---
slug: "ContextCompress"
name: "ContextCompress"
type: "Memory"
layer: "Mind"
ref: "ContextCompress#0bf5"
sema_id: "sema:ContextCompress#mh:SHA-256:0bf5ce89d0ad9cac74bb69f253f06331989714d3c34bb0b385f9674439ce30b0"
tags: ["Mind","Memory"]
updated: 2026-11-11
mindscape: "bootstrap"
index_url: https://mindscape.pages.dev/bootstrap/index.json
url: https://mindscape.pages.dev/bootstrap/ContextCompress/
related: ["Compress","Constraint","Context","State","CapacityPressure","DataMinimization"]
---

# ContextCompress

Semantic compression for long-running contexts

Layer: Mind · Category: Memory

## Mechanism

A memory management primitive that uses [Compress](https://mindscape.pages.dev/bootstrap/Compress.md) to reduce the token footprint of a [Context](https://mindscape.pages.dev/bootstrap/Context.md) while preserving critical [State](https://mindscape.pages.dev/bootstrap/State.md). It explicitly retains active [Constraint](https://mindscape.pages.dev/bootstrap/Constraint.md)s and unresolved goals.

## Invariants

- Reduces the [Context](https://mindscape.pages.dev/bootstrap/Context.md)'s token footprint by at least `min_reduction`.
- Retains every active [Constraint](https://mindscape.pages.dev/bootstrap/Constraint.md) and every unresolved goal.
- Re-evaluates which constraints are active and which goals unresolved on each pass.

## Failure modes

- Silent over-compression: a discarded [Constraint](https://mindscape.pages.dev/bootstrap/Constraint.md) surfaces only when a later step violates it.
- Stale activeness: a pass reuses an earlier pass's list of active constraints instead of recomputing it, so a lapsed constraint is preserved and a new one is dropped.

## Parameters

- `min_reduction` (Ratio, (0.0, 1.0)): Share of the token footprint a pass must remove to count as a compression.

## Builds on

- [Compress](https://mindscape.pages.dev/bootstrap/Compress.md) (Infrastructure; References)
- [Constraint](https://mindscape.pages.dev/bootstrap/Constraint.md) (Infrastructure; References)
- [Context](https://mindscape.pages.dev/bootstrap/Context.md) (Infrastructure; References)
- [State](https://mindscape.pages.dev/bootstrap/State.md) (Infrastructure; References)

## Used by

- [CapacityPressure](https://mindscape.pages.dev/bootstrap/CapacityPressure.md) (Mind; References)
- [DataMinimization](https://mindscape.pages.dev/bootstrap/DataMinimization.md) (Society; References)

## Identity

- Sema ID: `sema:ContextCompress#mh:SHA-256:0bf5ce89d0ad9cac74bb69f253f06331989714d3c34bb0b385f9674439ce30b0`
- Ref: `ContextCompress#0bf5`
- Supersedes:
  - `sema:ContextCompress#mh:SHA-256:6dbdad39d305207e19f80a38fbb7622505d35259338335493053eb49cfe4d817`
  - `sema:ContextCompress#mh:SHA-256:81bff304fb7fe57e71c152ac04faa987e06787468369ea65ab3cd2339c8739cb`

## Links

- [Pattern page](https://mindscape.pages.dev/bootstrap/ContextCompress/)
- [View in the interactive graph](https://mindscape.pages.dev/bootstrap/#ContextCompress)
- [JSON](https://mindscape.pages.dev/bootstrap/ContextCompress.json)
- [Index of all patterns](https://mindscape.pages.dev/bootstrap/index.json)
