Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

context-management

БесплатноБез исполняемых скриптовНе проверен

Strategies for efficient context management using context_log, context_tag, and context_checkout. Learn when to tag, how to visualize the graph, and safe ways…

Dwsyот Dwsy★ 26 звёзд на GitHub

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

Context Management

CRITICAL: THIS SKILL MANAGES YOUR MEMORY. WITHOUT IT, YOU WILL FORGET.

Your context window is limited. As conversations grow, "pollution" (noise, failed attempts) degrades your reasoning.

YOU MUST PROACTIVELY MANAGE YOUR HISTORY. Do not wait for the user to tell you.

The Core Philosophy: Build, Perceive, Navigate

Context Window = RAM (Expensive, volatile, limited)
Context Graph  = Disk (Cheap, persistent, unlimited)

→ Move finished tasks from RAM to the Graph.

Manage your context window like a Git repository. You are the maintainer.

  1. BUILD the Skeleton (context_tag):
    • Raw conversation is a flat list. Tags create structure.
    • Without tags, context_log is just a list of IDs. With tags, it is a Map.
  2. PERCEIVE the State (context_log):
    • Check the HUD: Is "Segment Size" too big? You are drifting.
    • Check the Graph: Where are you? Are you in a deep branch?
  3. NAVIGATE & MERGE (context_checkout):
    • Squash: Convert a messy "feature branch" (thinking process) into a single "merge commit" (summary).
    • Jump: Move between tasks or retry paths without carrying baggage.

Quick Start: The Loop

Follow this cycle for every major task:

  1. CHECK: Verify state. context_log
  2. START: Tag the beginning with a semantic name. context_tag({ name: "<task-slug>-start" }) // e.g., auth-login-start
  3. WORK: Execute steps.
  4. MILESTONE: Tag intermediate stable states. context_tag({ name: "<task-slug>-plan" }) // e.g., auth-login-plan
  5. SQUASH (Autonomous): If history becomes noisy or low-density, Squash with Backup.
    • Action: context_checkout({ target: "<task-slug>-start", message: "...", backupTag: "<task-slug>-raw-history" })
    • Action (Optional): context_tag({ name: "<task-slug>-done" })
    • Safety: If you need the details later, checkout the backup tag.

Tool Reference

Tool Analog Purpose When to Use
context_tag git tag Bookmark a stable state. Before risky changes. Before starting a new task.
context_log git log See where you are. When you feel lost. To find IDs for checkout.
context_checkout git reset --soft Time Travel / Squash. To undo mistakes. To compress history.

Critical Rules

Tag Wisely (Build The Skeleton)

Tags are the "Table of Contents". Name them so you can understand the history at a glance.

Naming Formula: <task-slug>-<phase>

  • task-slug: Short, kebab-case identifier for the task (e.g., auth-login, db-migration)
  • phase: The stage of work (start, plan, impl, done, fail, backup)
Bad (Generic) Good (Semantic) Why
task-start auth-oauth-start Describes WHAT task
pre-research error-log-analysis-start Future-you knows the topic
phase-1-done db-schema-plan-done Know which phase of which task
debug-retry null-pointer-fix-retry What bug?

Tag Categories:

Category Pattern Examples
Start <task>-start auth-jwt-start, docker-setup-start
Plan <task>-plan api-v2-plan, migration-plan
Milestone <task>-<milestone> auth-jwt-impl-done, tests-passed
Backup <task>-raw-history auth-jwt-raw-history
Failure <task>-fail-<reason> auth-jwt-fail-timeout

How to generate: Ask yourself "What is the task?" → Extract 1-3 keywords (e.g., "fix login timeout" → login-timeout-fix-start)

Squash Noise, Keep Signal, Focus on Goal (Context Hygiene)

Think of your conversation as a "Feature Branch" full of messy thoughts. You must distinguish Signal from Noise.

  • Signal (High Value): Design decisions, user constraints, final working code. -> KEEP.
  • Noise (Low Value): Failed attempts, long tool outputs, "thinking" steps. -> SQUASH.
  • Focus on Goal: Ask yourself: "Does this message help me achieve the current goal?" -> KEEP.

When to Squash:

  1. Task Done: Convert the messy process into one clean summary.
  2. Low Density: You read 2000 lines but only found 1 error.

Safety: Squashing is LOSSLESS. By using backupTag, you save the "Messy Branch" forever. You can always checkout the backup tag if the summary isn't enough.

  • Main Trunk: Jump back to the summary.
  • Backup Tag: Jump back to the raw details.

Fail Fast, Revert Faster

If you fail 3 times:

  1. STOP. Don't try a 4th time.
  2. context_checkout back to the last safe tag.
  3. Summarize the failure in the checkout message ("Tried X, failed because Y").
  4. Try a new approach from the clean state.

After Checkout: Execute Next Step

When context_checkout completes and injects a summary, you are in a new context.

  1. READ the injected summary carefully
  2. EXECUTE th
Полный SKILL.md на GitHub

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

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

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

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

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

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

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

FAQ

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

Strategies for efficient context management using context_log, context_tag, and context_checkout. Learn when to tag, how to visualize the graph, and safe ways to squash history. Use for complex refactoring, debugging, and long conversations.

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

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

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

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

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

Сравнить context-management с