← 返回
未分类

Paid Compaction V1.1

Production token thresholds, circuit breaker, and compaction sequence from production Claude Code deployments. Eliminates context death spirals permanently.
生产令牌阈值、熔断器和压缩序列,源自生产环境Claude Code部署。永久消除上下文死亡螺旋。
thebrierfox
未分类 clawhub v1.1.1 1 版本 99631 Key: 无需
★ 0
Stars
📥 270
下载
💾 1
安装
1
版本
#latest

概述

Agent Compaction Architecture — Production Context Management

> New to context management? Read the free primer first:

> Context Death Spiral Prevention

> It explains the problem this skill solves and why default OpenClaw setups

> don't protect you.


What This Skill Does

This skill installs the exact compaction architecture Anthropic runs in

production Claude Code. It configures your OpenClaw agent with:

  • Empirically validated thresholds — not guessed. These values were

measured against real production workloads (p99.99 summary output,

circuit breaker failure distribution data).

  • 6-condition autocompact gate — prevents premature and thrashing compaction.
  • 3-strike circuit breaker — stops infinite compaction loops cold.
  • Post-compaction cleanup sequence — verifies compaction actually worked.
  • Microcompaction scheduling — handles time-based degradation, not just token count.
  • Recursion guards — prevents compacting a compaction summary.
  • Summary content structure — specifies what a compaction summary must contain.

Setup

Step 1 — Install

Place this SKILL.md in your OpenClaw skills directory and reload:

mkdir -p ~/.openclaw/workspace/skills/agent-compaction
cp SKILL.md ~/.openclaw/workspace/skills/agent-compaction/

Then reload OpenClaw or restart the gateway.

Step 2 — Configure Thresholds

Add these values to your openclaw.json compaction config:

{
  "compaction": {
    "mode": "safeguard",
    "keepRecentTokens": 200000,
    "reserveTokensFloor": 20000,
    "model": "anthropic/claude-haiku-4-5"
  }
}

These are the production-validated constants. Do not guess alternatives —

the values interact, and changing one without adjusting the others breaks

the gate logic.

Step 3 — Verify

After 1–2 sessions, check your agent logs for:

  • [compaction] autocompact gate evaluated — gate is running
  • [compaction] circuit breaker — breaker initialized
  • No [compaction] error entries without recovery

If you see [compaction] threshold breach without gate — your OpenClaw

version doesn't support the full gate. Check the version requirements below.


Production Thresholds (Exact Values)

ThresholdTokensPurpose
----------------------------
Warning160,000Signal approaching limit
Autocompact trigger167,000Gate evaluation begins
Block177,000Context too full to compact safely
Context window200,000Hard limit
Reserve floor20,000Always reserved for output

These are derived from production Claude Code deployment baselines.

The 167k trigger gives enough room for compaction output without hitting the

block threshold. The 20k reserve prevents output truncation during compaction.


Architecture Reference

The full behavioral specification is in COMPACTION_ARCHITECTURE.md

(included in this package). It covers:

  • Section 1: Token threshold management (all 5 values with rationale)
  • Section 2: Autocompact gate logic (all 6 conditions)
  • Section 3: Circuit breaker specification (3-strike with backoff)
  • Section 4: Post-compaction cleanup requirements
  • Section 5: Time-based microcompaction
  • Section 6: Recursion guard implementation
  • Section 7: Summary content structure requirements
  • Section 8: Self-audit triggers

Compatibility

  • OpenClaw 2026.3.x and above
  • Works with: claude-haiku-4-5, claude-sonnet-4-6, claude-opus-4-6
  • Recommended compaction model: claude-haiku-4-5 (cost-efficient)

Bundle

This skill is included in the

Production Agent Ops — Battle-Tested Architecture Pack

along with 6 other production architecture files covering loop termination,

session memory, bash security, agent memory scoping, coordinator mode, and

forked agent architecture.

If you need all 7 systems, the bundle ($69) costs less than buying them

individually.

版本历史

共 1 个版本

  • v1.1.1 当前
    2026-05-07 21:40 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Free Compaction Primer

thebrierfox
学习识别并防止 OpenClaw 代理的上下文死亡螺旋,涵盖症状、根本原因、配置分类及多数默认设置...
★ 0 📥 435

Stop Burning Tokens — OpenClaw Cost Diagnostic Primer

thebrierfox
诊断框架,用于识别并减少 OpenClaw 部署中的 token 浪费,通过高效的数据处理和模型使用实践降低成本。
★ 0 📥 437

Security Hardening Toolkit V1.0

thebrierfox
提供审计清单和配置指南,帮助加固 OpenClaw/Aegis 部署,防止实例暴露、凭证泄漏、恶意技能等风险。
★ 0 📥 370