strategic-compact

Suggests manual compaction based on configurable thresholds and PreToolUse hook triggers.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/semaes111/PROYECTO-SKILLS --skill strategic-compact-semaes111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/semaes111/PROYECTO-SKILLS/tree/main/09-SKILLS-UTILIDADES/compactacion-estrategica
Command: npx skills add https://github.com/semaes111/PROYECTO-SKILLS --skill strategic-compact-semaes111

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Long interactive AI sessions and multi-phase workflows often exceed context limits or trigger arbitrary auto-compaction that discards important, phase-specific information; this Skill provides timely, manual compaction suggestions so you keep essential context and discard bulky exploration when appropriate.

Core Features & Use Cases

  • Hook integration: Adds a PreToolUse hook pattern to detect Edit/Write events and run a local suggester that counts tool calls and emits compaction prompts.
  • Configurable thresholds & reminders: Uses an environment-configurable threshold for the first suggestion and periodic reminder intervals afterward to fit different workflows.
  • Real-world use case: During a research→plan→implement workflow, the Skill suggests compacting after research so the implementation phase keeps distilled plans without noisy exploration history.

Quick Start

Add the PreToolUse hook to run the strategic compact suggester so that it monitors tool calls and prompts you to run /compact at configured checkpoints.

Frequently Asked Questions about strategic-compact

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I preserve context across task phases in long AI sessions?

To preserve context across task phases in long AI sessions, use manual context compaction suggestions that trigger at configurable token thresholds. This retains essential phase-specific information while discarding bulky exploration history before auto-compaction arbitrarily removes it.

Why does auto-compaction discard important information during multi-phase workflows?

Auto-compaction discards important information during multi-phase workflows because it triggers arbitrarily at token limits without recognizing phase boundaries. Manual compaction suggestions detect tool call counts and prompt you to compact strategically between phases like research and implementation.

How do I set up PreToolUse hooks for context management in Claude?

To set up PreToolUse hooks for context management in Claude, add a local suggester script that monitors Edit and Write events, counts tool calls against a configurable threshold, and emits periodic compaction prompts without requiring external network access.

Can I configure token thresholds for when compaction reminders appear?

Yes, you can configure token thresholds for compaction reminders. The system uses an environment-configurable threshold for the first suggestion and supports periodic reminder intervals afterward to fit different multi-phase workflow needs.

When should I manually compact context instead of relying on automatic compaction?

You should manually compact context instead of relying on automatic compaction when transitioning between workflow phases like research, planning, implementation, and testing. This ensures distilled plans are kept for the next phase while noisy exploration history is safely discarded.

Does this context management approach require external network access?

No, this context management approach does not require external network access. The PreToolUse hook runs a local suggester that counts tool calls and emits compaction prompts entirely locally, making it suitable for offline or restricted environments.