strategic-compact

Track tool calls and prompt manual compaction via a PreToolUse hook.

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/XiaoPuOuO/VFactory --skill strategic-compact-xiaopuouo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/XiaoPuOuO/VFactory/tree/main/paperclip-official/AgentSetting/skills/strategic-compact
Command: npx skills add https://github.com/XiaoPuOuO/VFactory --skill strategic-compact-xiaopuouo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manual context management is error-prone in long-running AI sessions. This Skill prompts strategic, manual compaction at logical boundaries to preserve critical information and maintain coherence across task phases.

Core Features & Use Cases

  • Tracks session progress and detects phase boundaries such as exploration, planning, implementation, and testing.
  • Provides configurable thresholds (COMPACT_THRESHOLD) and periodic reminders to prompt compaction.
  • Integrates via a PreToolUse hook to trigger compaction prompts before tool-heavy transitions.
  • Includes a lightweight shell script (suggest-compact.sh) to surface prompts during manual workflows.

Quick Start

Prompt for a strategic compact whenever you reach a logical boundary in your workflow to preserve context for the next phase.

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 bloat during long-running Claude sessions?

You can prevent context bloat by prompting strategic compaction at logical phase boundaries such as exploration to planning transitions, which preserves critical task context and maintains coherence across multi-phase projects.

When should I trigger manual context compaction in a multi-phase workflow?

Trigger manual context compaction when reaching phase boundaries such as milestone completions, or moving from planning to implementation, using a configurable tool call threshold to detect when context preservation is needed.

How does a PreToolUse hook automate context compaction reminders?

A PreToolUse hook tracks session tool calls and issues reminders to compact when a configurable threshold is exceeded, prompting strategic context preservation before tool-heavy transitions in long-running workflows.

Can I configure the threshold for triggering compaction prompts?

Yes, you can configure the threshold for triggering compaction prompts using the COMPACT_THRESHOLD setting, allowing you to tune when reminders surface based on tracked tool calls during your workflow.

Does manual context compaction work with shell-based workflows?

Yes, manual context compaction works with shell-based workflows by utilizing a lightweight shell script that surfaces compaction prompts during manual operations to preserve context at phase boundaries.