context-slim
БесплатноЗапускает вложенные скриптыНе проверенCompresses potential LLM context sources - project and global CLAUDE.md, rules, agent descriptions, hook text, memory - by cross-layer dedup…
от 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.
- Mode: an explicit mode token wins outright; else the most distinct whole-word keyword hits
(table below). Tie with a destructive mode ->
AskUserQuestion; withmeasure->measure; of two mutating modes -> the keyword that comes first. No hit or empty ->measure. - Scope: prose that is not a mode/path is still input: take the target, the ratio and the layer from
it (
сожми контекст на 40%, глобальный тоже-> modeslim,--target=40%,--global). - 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:
- Write to the global layer, or read it as authority only?
- Include the memory directories?
- Include agent bodies (PER-SPAWN)?
- 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 |
Установить context-slim в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadEditWriteBashGrepGlobAgentAskUserQuestionВложенные файлы
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 запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic