strategic-compact

Suggest manual context compaction at logical boundaries in Claude workflows.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces context loss by encouraging manual compaction at logical milestones rather than relying on automatic, arbitrary truncation.

Core Features & Use Cases

  • Tracks tool usage and prompts strategic context compact at meaningful boundaries (after exploration, after milestones, before major shifts).
  • Reminds users at regular intervals beyond a configurable threshold to review and refresh context.
  • Configurable via COMPACT_THRESHOLD and integrates with Claude PreToolUse hooks for seamless workflow support.

Quick Start

Install and configure the PreToolUse hook and place the suggest-compact.sh script in the specified path, then set COMPACT_THRESHOLD to your preferred value.

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 Claude workflow sessions?

Context compaction at logical milestones prevents context loss. This Skill tracks tool usage and suggests manual compaction after exploration, milestones, or before major context shifts in Claude workflow sessions.

How does PreToolUse hook context compaction work?

PreToolUse hook context compaction works by tracking tool calls with a local counter and triggering suggest-compact.sh at logical boundaries. It prompts manual context review at configurable intervals to preserve session state.

Can I configure the compaction threshold for Claude workflow automation?

You can configure compaction threshold for Claude workflow automation by setting the COMPACT_THRESHOLD variable. This controls when periodic reminders trigger to review and refresh context during sessions.

When should I manually compact context instead of relying on automatic truncation?

You should manually compact context after exploration, after milestone completion, or before major context shifts. This ensures preservation of critical information at logical boundaries rather than losing it to arbitrary automatic truncation.

What do I need to set up before using strategic context compaction with Claude?

To use strategic context compaction, you need to install and configure the PreToolUse hook, place the suggest-compact.sh script in the specified path, and set the COMPACT_THRESHOLD to your preferred value.

Are there limitations to using tool call tracking for context management?

Tool call tracking for context management relies on a local counter to trigger suggestions, meaning it prompts manual action rather than automatically compacting context. It does not override automatic truncation but supplements it at logical boundaries.