strategic-compact

Prompt strategic context compaction during long Claude sessions via a PreToolUse hook.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/SOLEROM/cldlab --skill strategic-compact-solerom
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/SOLEROM/cldlab/tree/main/ecc/ref_claude/.agents/skills/strategic-compact
Command: npx skills add https://github.com/SOLEROM/cldlab --skill strategic-compact-solerom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Preserves essential exploration context during long Claude sessions by prompting strategic compaction.

Core Features & Use Cases

  • Tracks tool invocations in a session to surface opportunistic compaction points.
  • Applies at logical boundaries (post-exploration, post-milestone, before major context shifts) to refresh context.
  • Provides configurable thresholds and reminders to maintain flow without disruptive prompts.

Quick Start

Install or enable the suggest-compact.js script and configure the PreToolUse hook in your Claude settings to point to the script.

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 during long Claude sessions with multi-phase tasks?

Context compaction preserves context during long Claude sessions by prompting strategic compaction at logical boundaries. It tracks tool invocations and applies compaction post-exploration or before major context shifts to refresh the session state.

When should I trigger context compaction in a research and implementation workflow?

Context compaction should be triggered at logical boundaries such as post-exploration, post-milestone, or before major context shifts. It relies on a configurable threshold and periodic reminders to maintain workflow flow without disruptive prompts.

How does a PreToolUse hook manage context compaction thresholds?

A PreToolUse hook manages context compaction by executing a script that tracks tool calls and issues compaction prompts when a configurable threshold is met. This setup surfaces opportunistic compaction points during active sessions.

Can I configure context compaction reminders to avoid disrupting my coding flow?

Yes, context compaction reminders are configurable to avoid disrupting coding flow. You can adjust the compaction threshold and reminder frequency to maintain session control without interrupting active tool calls.

What is the best way to reset context after switching between unrelated tasks in Claude?

The best way to reset context after switching between unrelated tasks is strategic context compaction. By applying compaction at logical boundaries, it clears irrelevant exploration data and preserves essential context for the next milestone.

Why does my Claude session lose track of earlier research after multiple tool calls?

Claude sessions lose track of earlier research after multiple tool calls due to context window saturation. Strategic context compaction prevents this by tracking tool invocations and prompting compaction to preserve essential exploration context.