MCP HubMCP Hub
スキル一覧に戻る

compaction-advisor

majiayu000
更新日 Today
20 閲覧
58
9
58
GitHubで表示
デザインdesign

について

このClaude Codeスキルは、利用可能なコンテキストトークンを監視し、開発者がトークン不足になる前に事前に警告します。長時間のタスク中にチェックポイント提案を提供し、コンテキスト圧縮による作業中断を防止します。最適なコンテキスト使用を維持し、重要な会話履歴の損失を回避するためにご利用ください。

クイックインストール

Claude Code

推奨
プラグインコマンド推奨
/plugin add https://github.com/majiayu000/claude-skill-registry
Git クローン代替
git clone https://github.com/majiayu000/claude-skill-registry.git ~/.claude/skills/compaction-advisor

このコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします

ドキュメント

Compaction Advisor

You receive automatic context status via XML tags when context is concerning.

Message Types

1. Context Status (on user prompts)

When you see these tags at the start of a conversation turn:

<context-status>CRITICAL: Only 12k tokens free. Run /compact before any task.</context-status>
<context-status>WARNING: 25k tokens free. Only small tasks safe.</context-status>
<context-status>CAUTION: 40k tokens free. Medium tasks OK, compact before large.</context-status>

When context is healthy (50k+ free), you won't see any tag.

2. Checkpoint Suggestions (during long tasks)

During multi-step work, you may see:

<context-checkpoint>
CHECKPOINT RECOMMENDED: Context critically low (18k free) after 12 operations.
Good time to pause and /compact. Summarize progress so far and key context to preserve.
</context-checkpoint>

This means you've been working for a while and context is running low.

3. PreCompact Warning (emergency)

Just before auto-compaction triggers:

<precompact-warning>
AUTO-COMPACTION IMMINENT
Context window is full. Compaction will happen after this message.
</precompact-warning>

How to Respond

When you see <context-status> CRITICAL

Immediately advise:

Context is critically low (12k free). Before we proceed, run:
/compact Focus on [relevant context to preserve]

When you see <context-status> WARNING

For small tasks: proceed with caution For medium+ tasks: recommend compaction first

Context is at 25k free. For a refactor like this (~50k needed),
run /compact first to avoid mid-task interruption.

When you see <context-checkpoint>

This is mid-task. Pause and offer a checkpoint:

Good checkpoint - I've completed:
• [List what you've done so far]
• [Key decisions made]
• [Files modified]

Context is at 18k. To continue safely, run:
/compact Focus on [key context for remaining work]

After compacting, I'll continue with [next steps].

When you see <precompact-warning>

This is urgent. Quickly summarize:

Compaction is about to happen. Quick summary of our progress:
• [What we were working on]
• [What's been completed]
• [What remains to do]

After compaction, remind me to [specific next step].

When you see nothing

Context is healthy. Proceed normally without mentioning it.

Task Size Reference

Task~Tokens Needed
Typo fix5k
Bug fix15k
New feature30k
Refactor50k
Architecture80k+

Compact Commands

/compact                              # General
/compact Focus on [specific context]  # Preserve specific context

Examples:

  • /compact Focus on the auth changes and test failures
  • /compact Keep the refactoring progress and file structure decisions

Key Points

  • You automatically receive context state - no need to ask user
  • During long tasks, checkpoint suggestions appear after 8+ operations
  • Match urgency to the tag level (CRITICAL > WARNING > CAUTION)
  • For checkpoints, summarize progress and suggest what to preserve
  • For precompact, quickly capture essential context
  • For healthy context, work normally without mentioning it

GitHub リポジトリ

majiayu000/claude-skill-registry
パス: skills/compaction-advisor

関連スキル

content-collections

メタ

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

スキルを見る

creating-opencode-plugins

メタ

This skill provides the structure and API specifications for creating OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It offers implementation patterns for JavaScript/TypeScript modules that intercept and extend the AI assistant's lifecycle. Use it when you need to build event-driven plugins for monitoring, custom handling, or extending OpenCode's capabilities.

スキルを見る

polymarket

メタ

This skill enables developers to build applications with the Polymarket prediction markets platform, including API integration for trading and market data. It also provides real-time data streaming via WebSocket to monitor live trades and market activity. Use it for implementing trading strategies or creating tools that process live market updates.

スキルを見る

cloudflare-turnstile

メタ

This skill provides comprehensive guidance for implementing Cloudflare Turnstile as a CAPTCHA-alternative bot protection system. It covers integration for forms, login pages, API endpoints, and frameworks like React/Next.js/Hono, while handling invisible challenges that maintain user experience. Use it when migrating from reCAPTCHA, debugging error codes, or implementing token validation and E2E tests.

スキルを見る