mcpbeat Sign in

Strategic Compact Skill for Claude

任意の自動コンパクションではなく、タスクフェーズを通じてコンテキストを保持するための論理的な間隔での手動コンパクションを提案します。

720 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
265
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/loulanyue/awesome-claude-notes --skill strategic-compact

The instruction itself

1 sections, as written by the author

Strategic Compactスキル

任意の自動コンパクションに依存するのではなく、ワークフローの戦略的なポイントで手動の/compactを提案します。

なぜ戦略的コンパクションか?

自動コンパクションは任意のポイントでトリガーされます:

  • 多くの場合タスクの途中で、重要なコンテキストを失う
  • タスクの論理的な境界を認識しない
  • 複雑な複数ステップの操作を中断する可能性がある

論理的な境界での戦略的コンパクション:

  • 探索後、実行前 - 研究コンテキストをコンパクト、実装計画を保持
  • マイルストーン完了後 - 次のフェーズのために新しいスタート
  • 主要なコンテキストシフト前 - 異なるタスクの前に探索コンテキストをクリア

仕組み

suggest-compact.shスクリプトはPreToolUse(Edit/Write)で実行され:

  • ツール呼び出しを追跡 - セッション内のツール呼び出しをカウント
  • 閾値検出 - 設定可能な閾値で提案(デフォルト:50回)
  • 定期的なリマインダー - 閾値後25回ごとにリマインド

フック設定

~/.claude/settings.jsonに追加:

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

設定

環境変数:

  • COMPACT_THRESHOLD - 最初の提案前のツール呼び出し(デフォルト:50)

ベストプラクティス

  • 計画後にコンパクト - 計画が確定したら、コンパクトして新しくスタート
  • デバッグ後にコンパクト - 続行前にエラー解決コンテキストをクリア
  • 実装中はコンパクトしない - 関連する変更のためにコンテキストを保持
  • 提案を読む - フックは*いつ*を教えてくれますが、*するかどうか*は自分で決める

関連

  • The Longform Guide - トークン最適化セクション
  • メモリ永続化フック - コンパクションを超えて存続する状態用

原文

  • 英語版の原文

ナビゲーション

  • 日本語ドキュメント一覧
  • skills/README.md
  • 貢献ガイド

Other skills for the same job

different authors, same section of the catalogue
Protocolsio Integration
by christophacham
×4

Integration with protocols.io API for managing scientific protocols. This skill should be used when working with protocols.io to search, create, update, or publish protocols; manage protocol steps and materials; handle discussions and comments; organize workspaces; upload and manage files; or integrate protocols.io functionality into workflows. Applicable for protocol discovery, collaborative protocol development, experiment tracking, lab protocol management, and scientific documentation.

16k tokens
Tailored Resume Generator
by frostant
×4

Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances

3k tokens
Excalidraw Diagram Generator
by github
vendor ×3

Generate Excalidraw diagrams from natural language descriptions. Use when asked to "create a diagram", "make a flowchart", "visualize a process", "draw a system architecture", "create a mind map", or "generate an Excalidraw file". Supports flowcharts, relationship diagrams, mind maps, and system architecture diagrams. Outputs .excalidraw JSON files that can be opened directly in Excalidraw.

36k tokens scripts
Expo Dev Client
by openai
vendor ×3

Build and distribute Expo development clients locally or via TestFlight

961 tokens
Executing Plans
by ZhanlinCui
×3

Use when you have a written implementation plan to execute in a separate session with review checkpoints

542 tokens
Anndata
by christophacham
×3

Data structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.

16k tokens
Benchling Integration
by christophacham
×3

Benchling R&D platform integration. Access registry (DNA, proteins), inventory, ELN entries, workflows via API, build Benchling Apps, query Data Warehouse, for lab data management automation.

14k tokens
Biopython
by christophacham
×3

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.

24k tokens

How to use it

Copy the folder

Take loulanyue/strategic-compact from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.