Command Palette

Search for a command to run...

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

context-slim

БесплатноЗапускает вложенные скриптыНе проверен

Compresses potential LLM context sources - project and global CLAUDE.md, rules, agent descriptions, hook text, memory - by cross-layer dedup…

kochetkov-maот kochetkov-ma★ 41 звезда на GitHub

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

Context Slim

Cuts the size of potential context sources with three levers — cross-layer dedup, default-knowledge removal, deep per-file compression. Every exact value, key, path, pin and non-default instruction survives byte-exact or acceptance fails. Orchestration only: every decision rule lives in references/, read at the phase that needs it.

Prompt contract

$ARGUMENTS is one free-form RU/EN prompt; mode tokens and flags (--target=N%, --global, --memory, --noask) may sit anywhere in it.

  1. Mode: an explicit mode token wins outright; else the most distinct whole-word keyword hits (table below). Tie with a destructive mode -> AskUserQuestion; with measure -> measure; of two mutating modes -> the keyword that comes first. No hit or empty -> measure.
  2. Scope: prose that is not a mode/path is still input: take the target, the ratio and the layer from it (сожми контекст на 40%, глобальный тоже -> mode slim, --target=40%, --global).
  3. Ask: at most ONE AskUserQuestion (max 4 questions) to resolve mode and scope, before any work, only when the answer changes what gets written. A read-only run asks nothing.

Print once, before the first action (labels literal, INPUT verbatim, authored values follow the active work-artifact language policy):

PLAN — brewtools:context-slim
INPUT:  <arguments verbatim, or "(empty)">
MODE:   <resolved> — <explicit | matched keyword: X | default>
SCOPE:  <resolved roots / tiers / flags>
DO:     <2-5 imperative bullets>
RESULT: <what the user ends up holding>

Modes

Mode EN keywords RU keywords Mutates?
measure (empty), measure, status, show, how much, weigh замер, статус, покажи, сколько no
preview preview, dry run, what would, plan превью, посмотри, что будет no
slim slim, compress, squeeze, dedupe, clean сожми, ужми, почисти, дедуп yes
hard hard, aggressive, more, deeper, still too big жёстко, сильнее, ещё, агрессивно yes, destructive
bodies bodies, skill bodies, skills, references тела, скиллы, референсы yes
restore restore, rollback, undo, revert восстанови, откати, верни yes, destructive

DEFAULT = measure. bodies is a scope extension: combine it with preview, slim or hard; alone it means bodies + slim.

Scope tiers

Tier Content In default scope
ALWAYS-ON Startup CLAUDE.md files (subdirectory ones on access), recursive rules (path-scoped = conditional), imported/read conventions, AGENTS.md, memory, agent descriptions, hook text yes
PER-SPAWN Agent .md files; only the selected agent loads at spawn yes
PER-INVOCATION Invoked SKILL.md bodies + recursive references read on demand opt-in via bodies only

Totals are potential inventory, not observed context (measurement.actual_loading_observed=false; membership: references/measurement.md). --memory adds the memory directories; --target=N% uses THIS run's fresh scan (measurement.md, "Target-ratio baseline rule").

Layer scope and what is never touched

Layer Read Written
Project (L1/L2) always in every mutating mode
Global ~/.claude, or CLAUDE_CONFIG_DIR when set (L3) ALWAYS, as authority only when --global is granted
MCP servers, plugin enablement, settings.json, the plugin cache signals only NEVER — advice rows per references/mcp-advice.md

Rewriting the global layer to serve one project is a cross-project regression: references/dedup-arbitration.md section 5 binds every mutation.

Phases

# Phase Mutates Barrier
0 Resolve mode + scope no —
1 Discover + measure, print PLAN no —
2 Snapshot (fail-closed) backups only yes
3 Cross-layer dedup analysis no yes
4 One optimizer subagent per file yes —
5 Verify + independent checker checkpoint-proven recovery on miss only yes
6 Re-measure, lossy escalation gate conditional —
7 Ratchet state + report state file only —

measure stops after phase 1, preview after phase 3; restore runs alone (see Restore).

Phase 0 — resolve

After the Prompt contract, one AskUserQuestion (max 4 questions), only for answers that change writes:

  1. Write to the global layer, or read it as authority only?
  2. Include the memory directories?
  3. Include agent bodies (PER-SPAWN)?
  4. Target ratio — only when the prompt implies one without naming it.

measure and --noask skip it (report the literal Skipped (--noask)). The gates below and every STOP still fire under --noask: each guards an irreversible write.

Gate Fires on Ask
Destructive mode hard, restore Name the
Полный SKILL.md на GitHub

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

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

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

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

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

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

Read
Edit
Write
Bash
Grep
Glob
Agent
AskUserQuestion

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

README.mdreferences/contradiction-policy.mdreferences/dedup-arbitration.mdreferences/drop-catalog.mdreferences/keep-catalog.mdreferences/language-policy.mdreferences/mcp-advice.mdreferences/measurement.mdscripts/context-guard.shscripts/context-scan.sh

FAQ

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

Compresses potential LLM context sources - project and global CLAUDE.md, rules, agent descriptions, hook text, memory - by cross-layer dedup, default-knowledge removal and deep per-file compression. Triggers - slim context, compress context, dedupe rules, сожми контекст, ужми правила.

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

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

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

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

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