What problem does it solve
At the end of the design phase, the OpenSpec requirement specifications (proposal, design, tasks, delta spec) need to be handed over to the build phase as the implementation basis. By default, all these contents are fully passed in, resulting in high token overhead. Context compression reduces redundant transmission through hash references and structured projections.Two modes

off retains the complete summary, beta retains the delta spec and references the supporting file
with hash”off mode”
Generate a complete but traceable summarydesign-context.json- Machine Index (change, phase, canonical spec, Source File path, per-file sha256, context_hash)design-context.md- Superpowers readable context, each file with source path, line range, sha256 and deterministic digest. Files with more than 80 lines are truncated and marked with[TRUNCATED]andFull source:Pointers.
--full flag can be used to output the complete verbatim content without truncation.
beta Mode
Generate structured spec projectionspec-context.json- Machine index, with each file labeled asrole: spec(delta spec) orrole: supporting(proposal/design/tasks)spec-context.md- Compact Context: ** verbatim projection of delta spec file ** (fully retaining the acceptance scenario), proposal/design/tasks only store hash references
In beta mode,
—full is ignored (a warning will be output). beta only performs verbatim projection on the delta spec, and other files are referenced by hash, thus saving the full text from Proposals/designs /tasks that are not repeatedly transmitted.How the delta spec is handled
The OpenSpec delta spec (specs/<capability>/spec.md) contains requirements and acceptance scenarios. Beta writes it verbatim and uses hash references for proposal, design, and tasks files:
- The delta spec is not summarized.
- Proposal, design, and tasks remain linked to their source files by sha256 and can be read again when needed.
When to trigger
Context compression is triggered at the “design→build handover” and is generated bycomet-handoff.mjs <change> design --write.
The design guard will check the existence and validity of the handover package: handoff_context/handoff_hash must be written to .comet.yaml, and the markdown package must carry the Generated-by: tag and a traceable source /hash reference. In beta mode, spec-context.json must also have a valid structure and reference the current source file.
Active compression
During the design phase, after writingbrainstorm-summary.md and before creating the Design Doc, the platform’s native compact/compaction mechanism will be triggered (if supported by the platform), or it will be paused for you to execute manually. Compress and reload the handover file. This is a runtime optimization independent of context_compression.
Current benchmark
The table records the current Comet benchmark. Results apply only to this task set and test configuration:
In this benchmark, beta reduced token use by about 25–30% and spec coverage changed from 100% to 95% because supporting files (proposal/design/tasks) keep hash references instead of full text.
How to enable beta
Project level (Recommended
Editor:.comet/config.yaml
.comet.yaml.
”Single change”
Through thecomet-state command:
Temporary overwriting of environment variables
How to choose
Next step
- Classic configuration - context_compression field and configuration priority
- Code review mechanism ](/en/concepts/review-mode) - Another project configuration item
- The position of the workflow concept ](/en/concepts/workflow) - design→build handover in the five stages
- comet-handoff](/en/scripts/comet-handoff) - Script details for generating handover packages

