strategic-compact

Track tool usage and prompt for manual context compaction via PreToolUse hooks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Reduces context loss by prompting for manual compaction at logical boundaries rather than relying on automatic, arbitrary truncation.

Core Features & Use Cases

  • track tool calls
  • threshold-based reminders
  • configurable via COMPACT_THRESHOLD
  • PreToolUse hook setup
  • use cases: long Claude sessions, multi-phase tasks

Quick Start

Install the suggest-compact.sh script in ~/.claude/skills/strategic-compact, set COMPACT_THRESHOLD, and configure the PreToolUse hook 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 long Claude sessions?

Context compaction at logical boundaries prevents context loss during long Claude sessions by tracking tool usage and prompting for manual compaction instead of relying on automatic arbitrary truncation.

How do I set up a PreToolUse hook for context management in Claude?

Setting up context management involves installing a suggest-compact.sh script in the Claude skills directory, configuring a COMPACT_THRESHOLD environment variable, and registering a PreToolUse hook in the Claude settings.json file.

When should I use manual context compaction instead of automatic truncation?

Manual context compaction should be used during multi-phase tasks and long Claude workflows when reaching logical boundaries, ensuring context is preserved at strategic milestones rather than lost through arbitrary automatic truncation.

Can I configure the threshold for context compaction reminders?

Yes, context compaction reminders are configurable via the COMPACT_THRESHOLD environment variable, allowing you to set the specific number of tool calls before a manual compaction prompt is triggered.

What is the best way to manage context across multiple Claude workflow phases?

The best way to manage context across multiple workflow phases is using threshold-based reminders tied to tool call tracking, coordinating exploration, planning, and implementation phases by prompting for compaction at logical boundaries.