Skip to content
youdede

Compaction Handoff Guard

OperationsHookv1.0.0

A deterministic fail-open PreCompact and PostCompact observer that records only byte counts and SHA-256 digests in a bounded toolkit-owned local state file.

Runs on

Scope
$npx @youdede/toolkit add compaction-handoff-guard --target claude-code

What it does

Record bounded, content-free receipts before and after conversation compaction.

When it fires

  • handoff
  • operations

How it behaves

Persist bounded content-free receipts around context compaction for local audit continuity.

It does not store transcript text, compacted summaries, custom instructions, or session identifiers.

It does not block automatic or manual compaction when a receipt cannot be written.

It does not claim that matching digests prove semantic completeness of the compacted summary.

It does not write outside the bounded toolkit-owned project state file.

Configuration

targets/claude-code/compaction-handoff-guard.mjsnode · writes-files

Version
1.0.0
Requires
node
Licence
RiskThis observer records bounded, content-free receipts before and after conversation compaction; it writes only bounded local receipts and cannot block the event.
Low
ModeHow it works: fixed rules, model instructions, or both.
Deterministic only
Behaviour
Observes, does not intervene
On failure
Allows and continues
LatencyTo record bounded, content-free receipts before and after conversation compaction, the entrypoint reads or writes bounded local state before returning.
Bounded
Data retentionWhether data remains after use and who manages its storage.
Kept locally, bounded

Often used with

All in Operations