context-slim

context-slim is a skill for Claude Code from kochetkov-ma/claude-brewcode. It costs 69 tokens per session (5,203 once invoked), scanned A, original, MIT.

A tool for shortening the instructions and saved information that an AI coding agent loads into its context, the text it uses to decide what to do.

In plain words
What is it for?
Removing duplicate rules, trimming project and global CLAUDE.md files, compressing agent descriptions and hooks, and reducing stored memory.
Why use it?
It reduces repeated or unnecessary text that can make the agent’s context harder to manage.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; reads .claude/ paths; mentions CLAUDE.md.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the brewtools plugin — 9 skills, 3 agents shipped together

Good fit Removing duplicate rules, trimming project and global CLAUDE.md files, compressing agent descriptions and hooks, and reducing stored memory.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add kochetkov-ma/claude-brewcode
Claude Code
/plugin install brewtools

Made for: Claude Code.

Or install brewtools, the plugin that ships this one along with the rest of its 9 skills, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-slim

README.md
[![agentmods](https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/context-slim/github.svg)](https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/context-slim)
Your own site
<a href="https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/context-slim"><img src="https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/context-slim/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for context-slim

Your own site · 80×15
<a href="https://agentmods.dev/skills/kochetkov-ma/claude-brewcode/context-slim"><img src="https://agentmods.dev/badge/skills/kochetkov-ma/claude-brewcode/context-slim.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,203 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.05203
Opus 5.5 $0.00028 $0.02081
Sonnet 5.5 $0.00014 $0.01041
Haiku 4.5 $0.00007 $0.00520

Measured 1mo ago against content hash a28a482b8eea, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

context-slim scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 7 executable files (scripts/context-guard.sh, scripts/context-scan.sh, tests/run.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

brewtools/skills/context-slim/SKILL.md · 369 lines

How it starts

The opening of the file, as written. The whole thing — 369 lines — stays where its author put it; the contents beside it link to each section on 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

Read the full file on GitHub · 369 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +1 lines a28a482b8eea
  2. 1mo ago Changed · -50 lines 5bd52b7d0174
  3. 2mo ago Changed · +34 lines · -3 tokens per session 48b1553060ab
  4. 3mo ago First seen · 384 lines · 72 tokens per session scan A c0801d2ac203

Subscribe to this mod's changes

context-slim is a skill published in the GitHub repository kochetkov-ma/claude-brewcode (41 stars, last pushed yesterday), licensed MIT. It adds 69 tokens to every session and 5,203 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

context-slim compared with skills from other repositories

context-slim next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
context-slimkochetkov-ma/claude-brewcodeSkill41yesterdayMITA69Claude Code
fresh-startegorfedorov/claude-context-optimizerSkill1377d agoMITA60Claude Code
doc-digestegorfedorov/claude-context-optimizerSkill1377d agoMITA75Claude Code
project-contextegorfedorov/claude-context-optimizerSkill1377d agoMITA81Claude Code
token-checkegorfedorov/claude-context-optimizerSkill1377d agoMITA66Claude Code
brain-logtoroleapinc/claude-brainSkill965mo agoMITB10Claude Code
session-historyalivecontext/aliveSkill13213d agoMITA74Claude Code