strategic-compact

Track tool calls and prompt context compaction at logical workflow boundaries.

1|Updated Mar 8, 2026
One-click install
npx skills add https://github.com/vinitgirdhar/GRID_ --skill strategic-compact-vinitgirdhar
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/vinitgirdhar/GRID_/tree/main/.agent/.agents/skills/strategic-compact
Command: npx skills add https://github.com/vinitgirdhar/GRID_ --skill strategic-compact-vinitgirdhar

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Preserves task context by prompting strategic compaction at logical boundaries to avoid context loss during long tasks.

Core Features & Use Cases

  • Tracks tool calls within a session to determine when compaction is warranted.
  • Enables a configurable threshold and periodic reminders to perform context pruning.
  • Provides a hook-based workflow that activates before phase transitions (research → planning, planning → implementation).

Quick Start

Configure the PreToolUse hooks in your CLAUDE settings to run suggest-compact.js and begin a session that prompts strategic compaction at logical boundaries.

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 long-running multi-phase workflows?

To prevent context loss, strategic compaction prompts context pruning at logical boundaries like phase transitions. It tracks tool calls within a session and triggers reminders to compact before context degrades between research, planning, and implementation phases.

What is strategic compaction and when do I need it for session context management?

Strategic compaction is a context management technique that preserves task state by prompting context pruning at logical boundaries. It is needed for long-running sessions and multi-phase workflows where context may degrade between phases.

How do I configure PreToolUse hooks to suggest context compaction?

You configure context compaction by setting up PreToolUse hooks in your CLAUDE settings to run suggest-compact.js. This establishes a hook-based workflow that tracks tool calls and reminds you when to compact based on a configurable threshold.

Can I set a custom threshold for context pruning reminders in long sessions?

Yes, strategic compaction supports a configurable threshold for context pruning reminders. The hook-based workflow uses this threshold to track tool calls within a session and determine when compaction is warranted.

Does context compaction work for multi-phase workflows transitioning from planning to implementation?

Yes, strategic compaction specifically activates before phase transitions such as moving from research to planning, or planning to implementation. This hook-based workflow ensures task context is preserved before shifting focus between distinct workflow phases.

Why does context degrade between phases in long-running sessions?

Context degrades in long-running sessions because accumulated tool calls and interactions gradually consume the available context window. Strategic compaction mitigates this by prompting context pruning at logical boundaries before degradation impacts task performance.