Skip to Content
MeowKit
Skills

mk:context-audit

Read-only audit of how much of the context window the always-on .claude setup uses, with a ranked list of what to trim.

Source.claude/skills/context-audit/SKILL.md
Ownerdocs
Runtimeclaude-code
Riskmedium
Phaseon-demand

mk:context-audit walks .claude/ and reports how much of the model context window your always-on setup takes. It prints a ranked "remove X, save Y tokens" report to the terminal and changes no files. It measures only what is loaded statically into every session, not conversation history, tool output or active edits.

When to use it

MomentWhy
Before adding an agent, skill or ruleCheck that structural overhead is under 25 percent
Sessions feel slow, off-topic or over-compactedCheck whether overhead has passed 10 percent
Quarterly or after a model upgradeCheck the always-on bundle still earns its place, alongside the dead-weight audit (.claude/skills/cook/references/harness-rules.md Rule 7)

When not to use it

ConcernUse
Runtime decisions about this session (what to read, when to compact)mk:context-engineering
Cost in USDmewkit budget

mewkit validate --substrate shows the same artifacts grouped by the responsibility they serve, which helps check a trim before removing something.

Usage

/mk:context-audit
/mk:context-audit <scan-root>

<scan-root> defaults to the current directory.

What it does

  1. scripts/inventory-context.sh counts bytes and lines per category (CLAUDE.md chain, agents, skills, rules, commands, MCP) and emits JSON.
  2. scripts/estimate-tokens.sh adds token estimates (characters divided by 4) and computes structural_overhead_pct against a fixed 200K window.
  3. scripts/format-audit-report.sh prints a markdown report.
  4. The report banner is Healthy below 10 percent, Watch from 10 to 25 percent, and Action at 25 percent or more.

The thresholds are defined in references/token-cost-model.md. They are not tied to the budget.* config keys, which are USD amounts.

Output

# Context Audit: <scan_root>
Scanned at <timestamp>, model window 200K tokens, banner: <Healthy|Watch|Action>

## Summary          Category, components, bytes, tokens, percent of window
## Top Consumers    Top 10 components with path and tokens
## Recommendations  Findings sorted by token impact, each with tokens saved
## How to Act       Cost: mewkit budget. An agent file costs tokens only when that agent is spawned, so archive agents you never use

Notes

  • The window size is fixed at 200K and there are no environment variables.
  • The skill reads .claude/, .mcp.json and .meowkit/telemetry/cost-log.json and writes nothing.
  • SCAN_ROOT is untrusted input. Paths are canonicalised with realpath and never executed.

On this page