mk:context-audit

mk:context-audit is a skill for Claude Code from ngocsangyem/MeowKit. It costs 108 tokens per session (1,450 once invoked), scanned A, original, MIT.

A read-only checker for the structural overhead in a project’s .claude/ files. It estimates how much of the model’s context window those always-loaded files consume and suggests what to trim.

In plain words
What is it for?
Use it before adding agent configuration, after context quality degrades, or during periodic project health checks.
Why use it?
It helps explain why coding-agent sessions may feel slow, distracted, or repeatedly compressed. It separates context-window usage from monetary cost and transcript length.

Skill for Claude Code

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/ngocsangyem/meowkit/context-audit
Any agent
npx skills add ngocsangyem/MeowKit --skill context-audit
Clone the repo
git clone --depth 1 https://github.com/ngocsangyem/MeowKit

Made for: Claude Code.

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 mk:context-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/ngocsangyem/meowkit/context-audit.svg)](https://agentmods.dev/skills/ngocsangyem/meowkit/context-audit)
Your own site
<a href="https://agentmods.dev/skills/ngocsangyem/meowkit/context-audit"><img src="https://agentmods.dev/badge/skills/ngocsangyem/meowkit/context-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,450 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00108 $0.01450
Opus 5 $0.00054 $0.00725
Sonnet 5 $0.00022 $0.00290
Haiku 4.5 $0.00011 $0.00145

Measured 2d ago against content hash 805fa304b84e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

mk:context-audit 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 2d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/estimate-tokens.sh, scripts/format-audit-report.sh, scripts/inventory-context.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.

.claude/skills/context-audit/SKILL.md · 154 lines

How it starts

The opening of the file, as written. The whole thing — 154 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/mk:context-audit — Context Window Structural Audit

Read-only audit of .claude/ structural overhead. Surfaces what is loaded into every host-runtime session and how much of the context window it consumes, then recommends the highest-leverage trims.

Complementary lens: mewkit inventory --substrate shows the same artifact set grouped by the responsibility each serves (covered / partial / missing), so a trim can be checked against responsibility coverage before removing an artifact. The per-phase read budget that bounds what an audit-driven session should load lives in rules/context-budget-rules.md.

When to Use

Three concrete triggers:

  1. Pre-add capacity check — before adding a new agent, skill, or rule file, confirm the project is below the 25% structural-overhead threshold.
  2. Post-degradation diagnostic — when sessions feel slow, off-topic, or over-compacted, audit to see if structural overhead has grown past 10%.
  3. Periodic health audit — quarterly or on model upgrades, confirm the always-on bundle still pays its keep (paired with the dead-weight audit in harness-rules.md Rule 7).

Context vs Cost (Boundary)

Concern Mechanism Unit
Monetary cost /mk:budget + ../autobuild/scripts/budget-tracker.sh USD
Window utilization (this skill) /mk:context-audit + scripts/inventory-context.sh tokens / %

The three concerns are deliberately separate. This skill measures only what is statically loaded into every session — the always-on bundle. Conversation history, tool output, and active edits live elsewhere.

Workflow

The slash command runs the pipeline:

SCAN_ROOT="${1:-$PWD}"
bash .claude/skills/context-audit/scripts/inventory-context.sh "$SCAN_ROOT" \
  | bash .claude/skills/context-audit/scripts/estimate-tokens.sh \
  | bash .claude/skills/context-audit/scripts/format-audit-report.sh

Read the full file on GitHub · 154 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 2d ago First seen · 154 lines · 108 tokens per session scan A 805fa304b84e

Subscribe to this mod's changes

mk:context-audit is a skill published in the GitHub repository ngocsangyem/MeowKit (14 stars, last pushed 1mo ago), licensed MIT. It adds 108 tokens to every session and 1,450 once invoked, about $0.0005 per session on Opus 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-09-03.