strategic-compact

Prompt manual context compaction at workflow boundaries via a Claude hook.

Updated Feb 5, 2026
One-click install
npx skills add https://github.com/deepan-alve/Tcsinthacks --skill strategic-compact-deepan-alve
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/deepan-alve/Tcsinthacks/tree/main/.claude/skill/strategic-compact
Command: npx skills add https://github.com/deepan-alve/Tcsinthacks --skill strategic-compact-deepan-alve

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

此技能在工作流程的策略點提供手動壓縮建議,避免任意自動壓縮造成上下文遺失,確保在關鍵邊界保持重要資料與計畫的連續性。

Core Features & Use Cases

  • 在 PreToolUse(Edit/Write)階段自動觸發壓縮建議,避免中途造成上下文遺失。
  • 支援三個策略點:探索後、執行前;完成里程碑後;主要上下文轉換前,清理或維持必要上下文。
  • 可自訂門檻與提醒頻率,並提供示例設定與 Hook 配置。

Quick Start

Configure the PreToolUse hook to run suggest-compact.sh and set COMPACT_THRESHOLD in ~/.claude/settings.json.

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 multi-step AI workflows?▼

To prevent context loss during multi-step AI workflows, trigger manual compaction at logical boundaries like post-exploration or milestone transitions. This preserves critical context continuity across workflow phases instead of relying on arbitrary automatic compaction.

What is strategic context compaction and when should I trigger it?▼

Strategic context compaction is the practice of manually compressing context at specific workflow boundaries to maintain data continuity. You should trigger it after exploration, before execution, or after completing a major milestone to preserve important plans.

How do I configure a PreToolUse hook for manual compaction suggestions?▼

To configure manual compaction suggestions, set up a PreToolUse hook for Edit and Write phases by adding the suggest-compact.sh script to your ~/.claude/settings.json file. You can also define a custom COMPACT_THRESHOLD to control reminder frequency.

Does automatic context compaction cause data loss in AI prompting workflows?▼

Yes, automatic context compaction can cause data loss in AI prompting workflows by arbitrarily compressing context mid-task. Using a hook-based manual approach ensures reminders trigger only at safe logical boundaries, protecting necessary data.

Can I customize the threshold for workflow context management reminders?▼

Yes, you can customize the threshold for workflow context management reminders by setting the COMPACT_THRESHOLD variable in your ~/.claude/settings.json file. This allows you to tune the frequency of manual compaction suggestions for your specific process.

When should I avoid automatic context compaction in multi-step processes?▼

You should avoid automatic context compaction in multi-step processes when transitioning between major phases or completing milestones. Arbitrary compression here risks losing critical context, making strategic manual compaction at logical boundaries necessary.