strategic-compact

Prompt manual context compaction via PreToolUse hooks with configurable thresholds.

Updated Apr 2, 2026
One-click install
npx skills add https://github.com/richardnpaul/everything-vscode-copilot --skill strategic-compact-richardnpaul
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/richardnpaul/everything-vscode-copilot/tree/main/.github/skills/strategic-compact
Command: npx skills add https://github.com/richardnpaul/everything-vscode-copilot --skill strategic-compact-richardnpaul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.

Core Features & Use Cases

  • Tracks tool invocations in a session to measure activity.
  • Detects when to suggest compaction based on a configurable threshold.
  • Provides periodic reminders and clear guidance at logical phase boundaries.
  • Works via PreToolUse hooks (Edit/Write) and configurable environment variable COMPACT_THRESHOLD.

Quick Start

Configure the PreToolUse hook in your Claude settings to enable periodic compaction prompts and then trigger /compact at strategic milestones.

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 in Claude during long multi-phase workflows?

To preserve context in Claude during multi-phase workflows, you can trigger strategic manual compaction at logical phase boundaries, which keeps relevant context intact instead of relying on arbitrary auto-compaction.

What is the best way to manage context loss during frequent task switching?

The best way to manage context loss during frequent task switching is to prompt manual context compaction at logical intervals, ensuring relevant context is preserved across task phases rather than lost to automatic system truncation.

How do I configure a PreToolUse hook to trigger compaction prompts?

To configure compaction prompts, set up a PreToolUse hook for Edit or Write operations in your Claude settings and adjust the configurable COMPACT_THRESHOLD environment variable to control when reminders appear.

When should I manually compact context in a long product management session?

You should manually compact context in a long product management session when you reach logical phase boundaries or cross the configured activity threshold, triggering the /compact command to preserve essential workflow context.

Does manual context compaction work better than auto-compaction for complex workflows?

Manual context compaction works better than auto-compaction for complex workflows because it allows you to suggest context preservation at logical phase boundaries, deliberately retaining relevant information that automatic truncation might discard.

Can I adjust the threshold for when compaction reminders appear in my session?

Yes, you can adjust the threshold for compaction reminders by modifying the COMPACT_THRESHOLD environment variable, which tracks tool invocations in your session to measure activity and detect when to suggest compaction.