strategic-compact

Suggest manual context compaction at logical task intervals via PreToolUse hook.

1|Updated Mar 4, 2026
One-click install
npx skills add https://github.com/flatrick/mdt --skill strategic-compact-flatrick
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/flatrick/mdt/tree/main/skills/strategic-compact
Command: npx skills add https://github.com/flatrick/mdt --skill strategic-compact-flatrick

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill prevents the loss of critical context during long AI sessions by suggesting manual context compaction at logical workflow intervals, rather than relying on arbitrary auto-compaction.

Core Features & Use Cases

  • Proactive Compaction Suggestions: Recommends when to manually compact context based on tool usage and task phases.
  • Preserves Key Information: Helps maintain focus on essential elements by avoiding mid-task context loss.
  • Use Case: When transitioning from a research phase to an implementation phase in a complex project, this skill will prompt you to compact the research notes, ensuring your implementation plan remains clear and accessible.

Quick Start

Ask the AI to suggest when to manually compact the context to preserve important information.

Frequently Asked Questions about strategic-compact

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent AI context loss during long sessions?

Manual context compaction involves intentionally summarizing and compacting context at logical workflow intervals, such as between research and implementation phases. Unlike arbitrary auto-compaction, this approach preserves critical information by proactively suggesting compaction based on monitored tool usage and task phases.

When should I manually compact context in a multi-phase project?

You should manually compact context when transitioning between task phases, such as moving from a research phase to an implementation phase. This ensures that essential research notes are preserved and your implementation plan remains clear before the context window fills up.

How does a PreToolUse hook trigger context compaction suggestions?

A PreToolUse hook monitors tool calls and triggers compaction suggestions based on configurable thresholds. When tool usage indicates a logical interval or task phase transition, it proactively recommends manual context compaction to prevent the loss of valuable information.

Can I configure context management thresholds for AI productivity workflows?

Yes, you can configure context management thresholds for AI productivity workflows. The system uses a PreToolUse hook to monitor tool calls and triggers manual context compaction suggestions based on your specific threshold settings to preserve context through extended tasks.

What is the best way to manage token optimization across extended AI tasks?

The best way to manage token optimization across extended AI tasks is strategic compaction at logical workflow intervals. By suggesting manual context compaction based on tool usage and task phases, this method preserves key information and maintains focus without arbitrary auto-compaction.