boundary-bbcr-fallback
Execute automatic BBCR (Collapse-Rebirth Correction) when knowledge boundaries are exceeded or reasoning fails.
Compress the semantic tree by merging similar nodes and removing redundancy while preserving essential information.
$ npx -y skills add qdhenry/Claude-Command-Suite --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
/memory-compressContext preview
What this command does when you run it.
Compress the semantic tree by merging similar nodes and removing redundancy while preserving essential information.
tools: - read - write - edit - bash
Compress the semantic tree by merging similar nodes and removing redundancy while preserving essential information.
Based on the WFGY project: https://github.com/onestardao/WFGY
1. **Analyze Tree for Compression**
2. **Apply Compression Algorithms**
3. **Preserve Critical Information**
4. **Build Compressed Tree**
{
"original_nodes": N,
"compressed_nodes": M,
"compression_ratio": N/M,
"preserved_insights": [...],
"merged_groups": [
{
"merged_nodes": ["id1", "id2"],
"result_node": "new_id",
"combined_insight": "..."
}
]
}5. **Validate Compression**
MEMORY COMPRESSION COMPLETE ═══════════════════════════════════════ Original Nodes: [N] Compressed Nodes: [M] Compression Ratio: [N:M] ([percentage]% reduction) Compression Analysis: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Before Compression: ████████████████████ [N] nodes After Compression: ████████████ [M] nodes Space Saved: [size] ([percentage]%) Quality Score: [percentage]% Compression Actions: ──────────────────────────────────────── Merged Nodes: [count] • Group 1: [Nodes A,B,C] → [Summary Node] Combined insight: [merged insight] • Group 2: [Nodes D,E] → [Summary Node] Combined insight: [merged insight] • Group 3: [Nodes F,G,H,I] → [Summary Node] Combined insight: [merged insight] Simplified Paths: [count] • Path 1: [A→B→C→D] simplified to [A→D] • Path 2: [E→F→G] simplified to [E→G] Removed Redundancies: [count] ✗ Duplicate: [Node] (merged with [Node]) ✗ Circular: [Node→Node→Node] (broken) ✗ Dead end: [Node] (removed) Preserved Critical Nodes: ──────────────────────────────────────── ✓ Checkpoint nodes: [count] preserved ✓ High ΔS nodes: [count] preserved ✓ Branch points: [count] preserved ✓ Recovery nodes: [count] preserved ✓ User-marked: [count] preserved Information Retention: ┌─────────────────────────────────────┐ │ Category │ Before │ After │ % │ ├─────────────────────────────────────┤ │ Key Insights │ [N] │ [M] │98%│ │ Logic Chains │ [N] │ [M] │95%│ │ Relationships │ [N] │ [M] │92%│ │ Context │ [N] │ [M] │88%│ │ Overall │ 100% │ 93% │93%│ └─────────────────────────────────────┘ Quality Metrics: • Semantic Coherence: [percentage]% maintained • Logic Integrity: [percentage]% preserved • Navigation Paths: [percentage]% intact • Insight Value: [percentage]% retained Compression Summary: • Algorithm: Semantic clustering + path optimization • Protected nodes: [count] • Merge threshold: ΔS < 0.2 • Quality threshold: 90% Recovery Options: • Undo compression: /memory:restore "[pre-compress checkpoint]" • View detailed log: .wfgy/logs/compression.log • Export compressed: /semantic:tree-export Next Steps: • Continue building: /semantic:node-build • View compressed tree: /semantic:tree-view • Create checkpoint: /memory:checkpoint "post-compress"
{
"compression": {
"auto_compress_at": 1000,
"merge_threshold": 0.2,
"min_quality": 0.9,
"protect_recent": 50,
"protect_high_deltaS": 0.7
}
}# Light compression /memory:compress --level light # Target specific size /memory:compress --target-nodes 500 # Compress specific range /memory:compress --from "node_100" --to "node_500" # Dry run (preview only) /memory:compress --dry-run
Compression works with:
A comprehensive development toolkit designed following Anthropic's Claude Code Best Practices for AI-assisted software development.
Repo: qdhenry/Claude-Command-Suite
Execute automatic BBCR (Collapse-Rebirth Correction) when knowledge boundaries are exceeded or reasoning fails.
Analyze semantic position relative to knowledge boundaries to prevent hallucination and identify uncertainty zones.
Generate a visual heatmap of knowledge boundaries showing safe zones, risk areas, and semantic coverage.
Evaluate the current risk level and provide detailed analysis of potential hallucination or reasoning failure.
Find and construct semantic bridges to safely navigate from current position to target concept without crossing dangerous boundaries.
Takes an input prompt and returns ONLY a token-optimized version that preserves meaning while minimizing token count. Based on LLM tokenization principles:…