본문으로 건너뛰기
cccskills
무료GitHub에 공개

strategic-compact

Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md2.0 KB
  • suggest-compact.sh1.6 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Strategic Compact Skill

Suggests manual /compact at strategic points in your workflow rather than relying on arbitrary auto-compaction.

Why Strategic Compaction?

Auto-compaction triggers at arbitrary points:

  • Often mid-task, losing important context
  • No awareness of logical task boundaries
  • Can interrupt complex multi-step operations

Strategic compaction at logical boundaries:

  • After exploration, before execution - Compact research context, keep implementation plan
  • After completing a milestone - Fresh start for next phase
  • Before major context shifts - Clear exploration context before different task

How It Works

The suggest-compact.sh script runs on PreToolUse (Edit/Write) and:

  1. Tracks tool calls - Counts tool invocations in session
  2. Threshold detection - Suggests at configurable threshold (default: 50 calls)
  3. Periodic reminders - Reminds every 25 calls after threshold

Hook Setup

Add to your ~/.claude/settings.json:

{
  "hooks": {
    "PreToolUse": [{
      "matcher": "tool == \"Edit\" || tool == \"Write\"",
      "hooks": [{
        "type": "command",
        "command": "~/.claude/skills/strategic-compact/suggest-compact.sh"
      }]
    }]
  }
}

Configuration

Environment variables:

  • COMPACT_THRESHOLD - Tool calls before first suggestion (default: 50)

Best Practices

  1. Compact after planning - Once plan is finalized, compact to start fresh
  2. Compact after debugging - Clear error-resolution context before continuing
  3. Don't compact mid-implementation - Preserve context for related changes
  4. Read the suggestion - The hook tells you when, you decide if

Related

  • The Longform Guide - Token optimization section
  • Memory persistence hooks - For state that survives compaction

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

WorldFlowAI/everything-claude-code5천2026년 1월 23일 업데이트

ClickHouse database patterns, query optimization, analytics, and data engineering best practices for high-performance analytical workloads.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

WorldFlowAI/everything-claude-code5천2026년 1월 23일 업데이트

Universal coding standards, best practices, and patterns for TypeScript, JavaScript, React, and Node.js development.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

WorldFlowAI/everything-claude-code5천2026년 1월 23일 업데이트

Automatically extract reusable patterns from Claude Code sessions and save them as learned skills for future use.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

WorldFlowAI/everything-claude-code5천2026년 1월 23일 업데이트

Frontend development patterns for React, Next.js, state management, performance optimization, and UI best practices.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

WorldFlowAI/everything-claude-code5천2026년 1월 23일 업데이트

Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

WorldFlowAI/everything-claude-code5천2026년 1월 23일 업데이트

WorldFlowAI의 스킬 모두 보기

이 스킬의 문제 신고