meta-context-diet
БесплатноБез исполняемых скриптовНе проверенAudit CLAUDE.md and .claude/rules for always-loaded content that should become an on-demand skill. Use when CLAUDE.md feels bloated, trimming context, or…
от laurigates★ 61 звезда на GitHubОб этом скилле
meta-context-diet
Audit always-loaded context — CLAUDE.md files and .claude/rules/*.md — for material that would be cheaper and clearer as an on-demand skill, then migrate approved candidates — per-candidate confirmation for lossy edits, batched approval for the safe ones.
The premise: CLAUDE.md and unscoped rules are paid for on every turn. A skill costs only its name + description in the listing budget until its intent fires, then loads its body on demand. Anything that is not a hard, always-respected invariant is a candidate to move off the always-loaded surface.
When to Use This Skill
| Use this skill when... | Use a different skill when... |
|---|---|
CLAUDE.md or .claude/rules/ has grown heavy and you want to find what can move to on-demand skills |
You want to move rules/skills between scopes (project → user-global) — use meta-promote |
| A rule is really a procedure/workflow triggered by intent, not an always-true invariant, and should be a skill | You want to turn a finished session's learnings into new rules — use session-distill |
| You want a per-item keep / path-scope / promote-to-skill / consolidate decision over the always-loaded surface | You want skill-to-skill overlap and split-pressure analysis — use health-skill-audit |
| You suspect rules duplicate plugin skills already loaded for the session | You only want frontmatter/size hygiene on existing skills — use scripts/plugin-compliance-check.sh |
Context
- Current directory: !
pwd - CLAUDE.md files in tree: !
find . -maxdepth 3 -name 'CLAUDE.md' -not -path '*/node_modules/*' -not -path '*/.claude/worktrees/*' - Local rules: !
find . -path '*/.claude/rules/*' -maxdepth 3 -name '*.md' -not -path '*/.claude/worktrees/*' - User-global rules are resolved during execution (Step 1), not here —
$HOMEpaths and error redirection are disallowed in Context commands.
Parameters
Parse $ARGUMENTS:
scope-path(optional, default.) — the directory whoseCLAUDE.mdand.claude/rules/are audited. Use a child path (e.g.someplugin) to scope the diet to one area. The user-global~/.claude/surface is audited too unlessscope-pathnames a non-.project.
Your task
Execute this audit and, on approval, migrate each candidate. Never make a lossy or destructive edit to an always-loaded file without explicit per-candidate confirmation — CLAUDE.md and rules are shared, every-turn context and a lossy edit degrades every downstream turn. Non-destructive dispositions on a large surface may be batch-approved (Step 4).
1. Inventory the always-loaded surface
Build the candidate list from three sources:
| Source | Path | Loaded |
|---|---|---|
| Root memory | <scope>/CLAUDE.md (+ nested CLAUDE.md) |
Every turn, in full |
| Unscoped rules | <scope>/.claude/rules/*.md without a paths: frontmatter glob |
Every turn, in full |
| Path-scoped rules | <scope>/.claude/rules/*.md with a paths: glob |
Only when editing matching files |
When scope-path is . (or names the user-global tree), also Glob(pattern="$HOME/.claude/rules/**/*.md") and the root $HOME/.claude/CLAUDE.md during execution — that surface is the heaviest every-turn cost. The plugin-skill list already loaded for this session is in the session prompt; scan it by name when checking the Consolidate disposition.
For each file, record its size in bytes (wc -c, est. tokens ≈ bytes/4, slightly high on multi-byte text — report-format.md) and, for CLAUDE.md, treat each ## section as a separately-classifiable unit. Path-scoped rules already pay only on matching turns — flag them only if they are also intent-shaped (a better skill) or duplicate a loaded plugin skill.
Then run the consumer sweep per candidate and record its path consumers; Step 2 uses them to choose Promote or a docs/ move.
2. Classify every unit against the diet rubric
For each rule file or CLAUDE.md section, assign exactly one disposition. The deciding question is "must this be true on every turn regardless of what the user asked?"
| Disposition | The unit is… | Signal |
|---|---|---|
| Keep — hard invariant | An always-respected constraint whose violation is a bug even when unmentioned (security boundaries, "never force-push", commit-format that drives release automation, destructive-op guards) | Imperative, unconditional, cheap to keep; the cost of missing it is high |
| Keep but lean | A hard invariant wrapped in explanation, examples, or tables that belong in a linked doc/REFERENCE, or docs/<topic>.md on a sweep path consumer |
The invariant is one sentence; the file is 200 lines |
| Lean-to-pointer | Keep-but-lean's destructive shape: the body moves to docs/<topic>.md and the rule keeps only a one-line po |
Установить meta-context-diet в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
GlobGrepReadEditWriteBash(git status *)Bash(git diff *)Bash(git add *)Bash(git commit *)Bash(git switch *)Bash(wc *)Bash(ls *)AskUserQuestionTodoWriteВложенные файлы
FAQ
Что делает скилл meta-context-diet?
Audit CLAUDE.md and .claude/rules for always-loaded content that should become an on-demand skill. Use when CLAUDE.md feels bloated, trimming context, or promoting a rule into a skill.
Как установить скилл meta-context-diet?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл meta-context-diet запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic