Command Palette

Search for a command to run...

Назад к скиллам
скилл № 25986

core-context-compressor

Use when the user asks to compress context, summarize the conversation, save tokens, fit the context window, set a context budget or condense a long session…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить core-context-compressor в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Core Context Compressor

Purpose

Compress long conversation histories into structured, token-efficient summaries for continuing work within context window limits. Extracts decisions, file changes, configuration values, and next steps into bullet-point format optimized for AI agent consumption.

LLMs have finite context windows (~32K-200K tokens). As conversations grow over dozens of exchanges, quality degrades because relevant information is buried. This skill produces a lossy-but-critical compression sacrificing implementation detail while preserving every decision, file change, configuration value, and unresolved question.

Agent Protocol

Trigger

"compress context", "context summary", "token save", "compression", "condense", "summarize conversation", "context budget", "reduce tokens", "context window"

Input Context

  • Full conversation history up to this point
  • List of files modified with absolute or relative paths and change descriptions
  • Key decisions with rationale and alternatives considered and rejected
  • Configuration values: env vars, port numbers, URLs, feature flags
  • User preferences: code style, naming conventions, formatting rules
  • Current task state: what phase is complete, what is in progress
  • Blocking issues and unresolved open questions
  • Next steps stated or implied at the end of last exchange

Output Artifact

Structured compressed summary with exactly 5 sections: Decisions, Files Changed, Current State, Next Steps, Open Questions. Maximum 50 lines.

Response Format

  • Decisions — each bullet contains: decision made, rationale, alternatives considered and rejected
  • Files Changed — format: path/file.ts:startLine-endLine + brief change description
  • Current State — exactly one line describing position relative to overall plan
  • Next Steps — numbered list ordered by dependency. Each starts with action verb, specific enough to be actionable without additional context
  • Open Questions — bullet list of unresolved decisions with what each blocks
  • Maximum 50 lines total — hard limit. If exceeded, run compression again on output.
  • Compression footer appended as final line
  • No preamble. No postamble. No explanations. No filler/hedging/transitions.

Completion Criteria

  • Compressed summary is under 50 lines
  • All critical decisions preserved with rationale
  • Current state clear in one line
  • Next steps ordered by dependency and actionable
  • All unresolved questions captured
  • Someone could pick up the summary and continue work without reviewing full history

Max Response Length

1000 tokens

Compression Strategies

Truncation Strategy

Remove oldest conversation exchanges while keeping most recent N exchanges. Sliding window keeps last M exchanges (default M=10) plus exchanges containing key decisions, file changes, or configuration settings. Lossy but fast — no processing beyond counting exchanges and identifying decision-bearing messages. Use as first pass before more sophisticated strategies.

Summarization Strategy

Replace verbose exchanges with condensed bullet-point summaries. Each exchange reduced to essential info: user request, action taken, result, decisions made. A 20-line debugging exchange becomes Debugged PG connection timeout — increased pool to 20, added connection retry with 3 attempts. Most common strategy, works well for mixed technical and explanatory content.

Hierarchical Strategy

Organize compressed information by topic/domain rather than chronologically. Group all DB decisions together, all config changes together, all file modifications together. Useful when conversation spans multiple independent topics (backend, frontend, infrastructure) or when same file was modified multiple times. Apply when conversation covers 3+ distinct domains.

Priority Scoring Strategy

Assign each info item a priority score based on impact on future work:

  • P1 (Critical): Technology choices, breaking changes, security decisions, configuration values affecting behavior
  • P2 (Important): Bug root causes, architectural decisions, schema changes, API contract changes
  • P3 (Normal): File modifications for reference, testing decisions, tooling setup
  • P4 (Low): Progress updates, exploratory discussion, alternative evaluation Include all P1-P2 items, include P3 if space permits, discard P4 first when compressing to fit 50 lines.

Streaming Compression

When conversation history exceeds 50 exchanges or 40K tokens, process in chunks of 20-30 exchanges. Compress each chunk independently. Merge segment summaries into single output, applying priority scoring to decide what to keep from each segment. Prevents context overflow during compression itself.

Multi-Turn Session Merging

For conversations spanning multiple compressed sessions, merge previous summary's Decisions, Open Questions, and Current State with new history. Conflicts resolved by preferring most recent decision. Duplicates deduplicated. Merged

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/compression-strategies.md
  • references/context-compressor-advanced.md
  • references/context-compressor-fundamentals.md
  • references/context-retrieval.md
  • references/context-window-management.md
  • references/summary-templates.md
  • references/token-management.md

FAQ

Что делает скилл core-context-compressor?

Use when the user asks to compress context, summarize the conversation, save tokens, fit the context window, set a context budget or condense a long session. Produces a structured compressed summary of the session state to carry forward. Not for writing project docs (use dev-loop-readme-writer).

Как установить скилл core-context-compressor?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл core-context-compressor запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить core-context-compressor с