strategic-compact

Prompt manual session context consolidation at logical task boundaries via PreToolUse hooks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Compacts session context by prompting manual consolidation at logical task boundaries.

Core Features & Use Cases

  • Context-aware compaction prompts at strategic points in a workflow to preserve coherence across phases.
  • Configurable thresholds and reminder cadence to balance guidance with interruptions.
  • Seamless integration via PreToolUse hooks triggering a compacting script.

Quick Start

Run the strategic-compact skill by enabling the PreToolUse hook and adjusting COMPACT_THRESHOLD if needed.

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 drift in long, multi-phase AI sessions?

Context compaction prevents context drift in long AI sessions by prompting manual consolidation at logical task boundaries. This approach preserves workflow coherence across milestones by triggering periodic reminders before the context window degrades.

How do I configure context compaction thresholds using a PreToolUse hook?

Configuring context compaction via a PreToolUse hook involves enabling the suggest-compact script and adjusting the COMPACT_THRESHOLD variable. This setup balances guidance with interruptions by triggering reminders at specific cadences during your workflow.

When should I trigger context compaction during task boundaries?

Trigger context compaction at logical task boundaries, specifically during milestone transitions in long, multi-phase sessions. Compacting at these strategic points prevents context drift while maintaining workflow coherence across different phases.

Can I adjust the reminder cadence for context management prompts?

You can adjust the reminder cadence for context management prompts by modifying the configurable threshold. This allows you to balance the frequency of compaction guidance with the level of interruptions during your active workflow.

What is the best way to compact session context without losing workflow coherence?

The best way to compact session context without losing coherence is prompting manual consolidation at strategic points. This context-aware approach uses PreToolUse hooks to trigger compaction at logical task boundaries, preserving workflow continuity.

Does strategic compaction work for milestone transitions in extended workflows?

Strategic compaction works for milestone transitions in extended workflows by applying a PreToolUse hook to prompt manual consolidation. This preserves coherence across phases, preventing context drift during long, multi-phase sessions.