boundary-bbcr-fallback
Execute automatic BBCR (Collapse-Rebirth Correction) when knowledge boundaries are exceeded or reasoning fails.
Selectively remove low-value, outdated, or irrelevant nodes from the semantic tree to maintain quality and performance.
$ 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-pruneContext preview
What this command does when you run it.
Selectively remove low-value, outdated, or irrelevant nodes from the semantic tree to maintain quality and performance.
tools: - read - write - edit - bash arguments: $PRUNE_CRITERIA
Selectively remove low-value, outdated, or irrelevant nodes from the semantic tree to maintain quality and performance.
Based on the WFGY project: https://github.com/onestardao/WFGY
1. **Define Pruning Criteria**
2. **Identify Prune Candidates**
Candidates = nodes.filter(
age > threshold AND
importance < min_importance AND
not protected AND
not checkpoint AND
not high_deltaS
)3. **Analyze Impact**
4. **Apply Protection Rules**
5. **Execute Pruning**
MEMORY TREE PRUNING ANALYSIS ═══════════════════════════════════════ Prune Criteria: $PRUNE_CRITERIA Nodes Analyzed: [total] Candidates Found: [count] Pruning Summary: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Before: ████████████████████ [N] nodes After: ████████████ [M] nodes Pruned: ████ [N-M] nodes ([percentage]%) Prune Categories: ┌─────────────────────────────────────┐ │ Category │ Count │ % of Total │ ├─────────────────────────────────────┤ │ Old & Unused │ [N] │ [%] │ │ Dead Ends │ [N] │ [%] │ │ Low Value │ [N] │ [%] │ │ Failed Paths │ [N] │ [%] │ │ Redundant │ [N] │ [%] │ │ Orphaned │ [N] │ [%] │ └─────────────────────────────────────┘ Nodes to Prune (Top 10): ──────────────────────────────────────── 1. Node [id] - Score: 0.92 Age: [days] | Access: [count] | Value: Low Topic: "[topic]" Reason: Old and never accessed Impact: None (dead end) 2. Node [id] - Score: 0.88 Age: [days] | Access: [count] | Value: Low Topic: "[topic]" Reason: Redundant with [other_node] Impact: Low (reroute 1 reference) 3. Node [id] - Score: 0.85 Age: [days] | Access: [count] | Value: Low Topic: "[topic]" Reason: Failed reasoning path Impact: None (already bypassed) [... more nodes ...] Protected Nodes (Not Pruned): ──────────────────────────────────────── ✓ [count] Checkpoint nodes ✓ [count] High ΔS nodes (>0.7) ✓ [count] Recent nodes (<7 days) ✓ [count] User-marked important ✓ [count] Critical path nodes Impact Analysis: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Information Loss: [percentage]% • Key insights preserved: 100% • Minor details lost: [percentage]% • Redundant info removed: [percentage]% Chain Repairs Needed: [count] • [Parent] → [Pruned] → [Child] Reconnect: [Parent] → [Child] • [Node] → [Pruned] (dead end) Remove reference from [Node] Tree Health Improvement: • Avg ΔS: [before] → [after] ↑ • Noise reduction: [percentage]% • Navigation speed: +[percentage]% • Memory usage: -[percentage]% Pruning Safety: [SAFE/MODERATE/RISKY] Confirm Pruning? [Execute/Preview/Cancel] Recovery: • Backup created: .wfgy/backups/pre_prune_[timestamp].json • Undo command: /memory:restore "pre_prune_[timestamp]"
# Prune by age /memory:prune --older-than 60 # Prune by value /memory:prune --value-below 0.3 # Prune by access /memory:prune --accessed-less-than 2 # Prune failed paths /memory:prune --failed-only # Combined criteria /memory:prune --old --low-value --dead-ends
{
"pruning": {
"auto_prune": true,
"age_threshold_days": 30,
"access_threshold": 5,
"value_threshold": 0.3,
"protect_recent_days": 7,
"max_prune_percent": 30
}
}Pruning 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:…