compact

Suggest context compression at logical breakpoints during development sessions.

49|3|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/xiaobei930/claude-code-best-practices --skill compact-xiaobei930
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compact
Source: https://github.com/xiaobei930/claude-code-best-practices/tree/main/skills/compact
Command: npx skills add https://github.com/xiaobei930/claude-code-best-practices --skill compact-xiaobei930

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Strategic context compression helps maintain focus and save cognitive load by proposing compression at logical breakpoints during development sessions.

Core Features & Use Cases

  • Automatically suggests contextual compression at milestones.
  • Integrates with a hook (suggest-compact.js) to remind when to compact after a threshold of tool usage.
  • Provides a configurable threshold and a summary template for compression notes.

Quick Start

Prompt the system to suggest a context compression at the next logical milestone in your development session.

Frequently Asked Questions about compact

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

FAQPage Schema
How do I manage context length during long-running development sessions?

To manage context length during long-running development sessions, strategic context compression automatically suggests summarizing conversation history at logical breakpoints like milestone reviews or feature completion to optimize efficiency and reduce cognitive load.

When should I compress conversation context in a development workflow?

You should compress conversation context in a development workflow at logical breakpoints such as research-to-implementation transitions, milestone reviews, or after completing a feature module to maintain focus and save cognitive load.

How does automatic context compression trigger during coding sessions?

Automatic context compression triggers via a hook script that monitors tool usage, sending reminders to compact after reaching a configurable threshold of calls, defaulting to 40, and at subsequent intervals.

Can I configure the tool usage threshold for context compression reminders?

Yes, you can configure the threshold for context compression reminders. The suggest-compact hook script allows you to set a custom tool usage limit, which defaults to 40 calls, to trigger strategic compression notifications.

Does context compression provide a template for summarizing development milestones?

Yes, context compression provides a summary template. When suggesting a compression plan at logical breakpoints, the system generates a template to help you summarize milestone progress and the completed development context.