Skillquality 0.47

autocompact-recursion-guards

Block autocompact from running in recursive contexts so forks and helpers don’t deadlock.

Price
free
Protocol
skill
Verified
no

What it does

SKILL: Autocompact Recursion Guards

Domain: context-management
Trigger: Apply when auto-compacting logic runs inside recursive agents (session memory, compact helpers, context collapse) and must avoid deadlocking by re-entering itself. Source Pattern: Distilled from reviewed session memory, compaction, and context-budgeting implementations.

Core Method

Protect the proactive compaction gate with explicit exclusion rules for forked agents and context-specialized modes. Check whether the caller is already within the session_memory or compact subagent, whether a context-collapse or reactive-only mode is engaged, and whether features that manage their own context already control compaction. If any guard trips, return false so the recursion never fires again and the specialized agent can manage its own compaction cycle.

Key Rules

  • Identify contexts that already own compaction (session memory, compact, marble_origami, reactive compact, context collapse) and short-circuit the auto-compact decision for them.
  • Keep the guards in should auto compact separate from the general thresholds so the recursion detection stays runnable even when feature flags change.
  • Use feature gates to keep these checks dead-code-eliminated in builds that lack the implicated subsystems.
  • Document why each guard exists so future engineers do not re-enable auto-compact in those contexts.
  • Log or metrics may note when a guard prevented compaction so you can tune thresholds without reintroducing loops.

Example Application

When a forked session-memory compactor would otherwise trigger auto-compact, the guard sees query source 'session memory' and returns false, letting the fork run its own compaction without conflicting with the main thread.

Anti-Patterns (What NOT to do)

  • Don’t let auto-compact run inside the compact agent or session memory; it will deadlock with itself.
  • Don’t tie these guards to mutable thresholds; they must fire even when the token usage looks high.

Capabilities

skillsource-ychampionskill-autocompact-recursion-guardstopic-agent-skillstopic-ai-agentstopic-clitopic-coding-agentstopic-context-engineeringtopic-developer-toolstopic-mcptopic-multi-agenttopic-terminal-ui

Install

Quality

0.47/ 1.00

deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 34 github stars · SKILL.md body (2,012 chars)

Provenance

Indexed fromgithub
Enriched2026-04-22 06:56:45Z · deterministic:skill-github:v1 · v1
First seen2026-04-18
Last seen2026-04-22

Agent access