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★ 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.
- BUILD the Skeleton (
context_tag):- Raw conversation is a flat list. Tags create structure.
- Without tags,
context_logis just a list of IDs. With tags, it is a Map.
- 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?
- 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:
- CHECK: Verify state.
context_log - START: Tag the beginning with a semantic name.
context_tag({ name: "<task-slug>-start" })// e.g.,auth-login-start - WORK: Execute steps.
- MILESTONE: Tag intermediate stable states.
context_tag({ name: "<task-slug>-plan" })// e.g.,auth-login-plan - 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.
- Action:
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:
- Task Done: Convert the messy process into one clean summary.
- 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:
- STOP. Don't try a 4th time.
context_checkoutback to the last safe tag.- Summarize the failure in the checkout message ("Tried X, failed because Y").
- 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.
- READ the injected summary carefully
- EXECUTE th
Установить 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), без исполняемых скриптов.
Похожие скиллы
patterns
Find patterns worth sharing from recent PRs and repo history, both repeats to fix and good practices worth spreading. Use when a champion wants to know what…
от Anthropiccopilot-cli-quickstart
Use this skill when someone wants to learn GitHub Copilot CLI from scratch. Offers interactive step-by-step tutorials with separate Developer and…
от GitHubvardoger-analyze
Use when the user asks to personalize the GitHub Copilot CLI assistant, adapt Copilot to their style, use vardoger, or analyze their Copilot CLI conversation…
от GitHubpolicy-lookup
Find and explain company policies in plain language. Trigger with "what's our PTO policy", "can I work remotely from another country", "how do expenses work"…
от Anthropic