strategic-compact

Prompt context compaction via a PreToolUse hook with configurable thresholds.

1|Updated Jan 11, 2026
One-click install
npx skills add https://github.com/Ying-Kai-Liao/TouchStone --skill strategic-compact-ying-kai-liao
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/Ying-Kai-Liao/TouchStone/tree/main/.claude/skills/strategic-compact
Command: npx skills add https://github.com/Ying-Kai-Liao/TouchStone --skill strategic-compact-ying-kai-liao

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Maintains continuity in AI-assisted workflows by prompting manual context compaction at logical boundaries, preventing loss of important details from arbitrary auto-compaction.

Core Features & Use Cases

  • Lifecycle-aware prompts: Triggers compaction prompts aligned with exploration, planning, and execution phases to preserve essential context.
  • Configurable thresholds: Allows adjusting the number of tool calls before the first suggestion and subsequent reminders.
  • Hook-based integration: Integrates with Claude's PreToolUse to surface compaction guidance during workflows.

Quick Start

Place the suggest-compact.sh script in ~/.claude/skills/strategic-compact and enable the PreToolUse hook to start prompting for context compaction.

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 loss during long-running AI workflows?

Trigger manual context compaction in Claude by installing a PreToolUse hook script. It counts tool invocations and prompts you when compaction is advised, preserving continuity before auto-compaction arbitrarily drops essential context.

How do I trigger manual context compaction in Claude workflows?

Trigger manual context compaction in Claude by installing a PreToolUse hook script. It counts tool invocations and prompts you when compaction is advised, preserving continuity before auto-compaction arbitrarily drops essential context.

Can I configure the threshold for context compaction prompts?

Yes, you can configure compaction prompt thresholds. The hook script allows adjusting the number of tool calls before the first suggestion and subsequent reminders, adapting to your specific workflow needs.

When should I use strategic compaction instead of automatic compaction?

Use strategic compaction during multi-phase projects and transitions between planning, exploration, and execution. It prompts compaction at logical boundaries, whereas automatic compaction may arbitrarily drop critical details mid-task.

How do I set up the PreToolUse hook for context compaction in Claude?

Set up context compaction by placing the suggest-compact.sh script in the ~/.claude/skills/strategic-compact directory and enabling the PreToolUse hook to start prompting for context compaction guidance.