strategic-compact

Count tool invocations and remind users to compact context at configurable thresholds.

Updated Dec 18, 2025
One-click install
npx skills add https://github.com/JahanzaibTayyab/hackathon-2 --skill strategic-compact-jahanzaibtayyab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/JahanzaibTayyab/hackathon-2/tree/main/.claude/skills/strategic-compact
Command: npx skills add https://github.com/JahanzaibTayyab/hackathon-2 --skill strategic-compact-jahanzaibtayyab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Strategic compaction is often needed to preserve important context as you move between exploration and execution phases. This skill suggests manual context compacting at logical boundaries to prevent context loss from auto-compaction.

Core Features & Use Cases

  • Tracks tool invocations within a session and identifies transitions from exploration to execution.
  • Uses a configurable threshold (default: 50 calls) to trigger compact prompts and reminders.
  • Provides a PreToolUse hook integration to prompt manual compaction without interrupting ongoing work.
  • Use case: during iterative task workflows, compact after planning milestones to retain plan details while starting new phases.

Quick Start

Install and configure the suggest-compact.sh hook to run on PreToolUse and begin counting tool invocations to receive strategic compact prompts.

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
How do I prevent context loss during AI-assisted workflows?

Manual context compaction at logical boundaries prevents context loss during AI-assisted workflows by prompting you to run /compact after planning milestones, retaining critical details before auto-compaction triggers.

When should I manually compact context in Claude sessions?

You should manually compact context in Claude sessions at logical boundaries, specifically when transitioning from exploration to execution phases, to ensure plan details survive across task phases.

How do I configure a PreToolUse hook to remind me to compact context?

Configure a PreToolUse hook with the suggest-compact.sh script to count tool invocations. Set a configurable threshold, defaulting to 50 calls, to issue periodic compact prompts without interrupting ongoing work.

Does strategic compaction interrupt my ongoing coding tasks?

Strategic compaction does not interrupt ongoing coding tasks. The PreToolUse hook integration issues periodic reminders to compact context at logical boundaries, prompting manual action without halting execution.

Why does auto-compaction cause problems during iterative task workflows?

Auto-compaction causes problems during iterative task workflows because it automatically drops context at arbitrary limits, losing crucial plan details. Strategic compaction prompts manual /compact execution at milestones to avoid this.