strategic-compact

Prompt for manual context compaction at configurable thresholds via a PreToolUse hook.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/yulong-me/Xrunner --skill strategic-compact-yulong-me
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/yulong-me/Xrunner/tree/main/.agent/skills/strategic-compact
Command: npx skills add https://github.com/yulong-me/Xrunner --skill strategic-compact-yulong-me

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Strategic-compact helps maintain critical context by prompting for manual compaction at logical milestones, preventing context drift caused by automatic, arbitrary compaction.

Core Features & Use Cases

  • PreToolUse hook integration to trigger compaction prompts.
  • Configurable thresholds and reminders to suit different workflows.
  • Lightweight, unobtrusive context management across task phases.

Quick Start

Enable strategic-compact and set your compaction thresholds to begin receiving prompts at logical 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 working context during long-running tasks without losing mid-work progress?

Manual compaction prompts at logical milestones preserve working context during long-running tasks. This approach uses a PreToolUse hook and configurable threshold to trigger reminders, preventing context drift caused by arbitrary automatic compaction.

Why does automatic context compaction cause problems during complex workflows?

Automatic compaction triggers arbitrarily, causing context drift and lost mid-work progress. Prompting for manual compaction at logical milestones instead ensures critical working context is preserved across exploratory, planning, and execution phases.

How do I set up a PreToolUse hook to trigger compaction prompts at configurable thresholds?

Enable the tool and configure your compaction thresholds to start receiving prompts. It implements a PreToolUse hook alongside a lightweight session counter to prompt for manual compaction at logical milestones during your workflow.

Can I use manual compaction prompts for context management across different task phases?

Yes, manual compaction prompts apply during exploratory, planning, and execution phases across long-running tasks. A lightweight session counter tracks progress and triggers unobtrusive reminders to ensure context isn't lost mid-work.

What are the limitations of using a lightweight session counter for context management?

Using a lightweight session counter for context management relies on configurable thresholds to trigger manual prompts. It is unobtrusive but requires you to manually execute compaction when prompted, meaning context preservation is not fully automated.