Audits agent context composition, token budgets, and static vs dynamic inflation across system prompts, tool schemas, and conversation history. Use when assessing prompt overhead, analyzing session tokens, or optimizing tool/skill catalogs.
Ships in Context Window & Token Audit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Read-only, evidence-based context auditing and optimization for agent sessions.
Context auditing identifies what consumes the context window, distinguishes static prefix overhead (system prompts and tool schemas) from dynamic accumulation (conversation history and tool outputs), and measures actual token changes across iterations without guessing.
Russian reference: references/methodology.md covers methodology, attribution, and OMP runtime context internals. Additional schema details are documented in references/omp_schema_evidence.md.
The bundled standard-library script scripts/audit_context.py inspects native OMP session JSONL traces and verified /dump request sidecars.
python3 scripts/audit_context.py inspect /path/to/session.jsonl --snapshot last
Select first, last, or an explicit record ID (--snapshot 01a16083-322e-7424-8edd-de60baac85fb).
Output provides:
prompt_tokens: Provider usage-backed prompt counter (usage.contextTokens ?? (input + cacheRead + cacheWrite)). Output tokens excluded.non_message_tokens: Local tokenizer estimate for system prompt and tool schemas.tool_schema_tokens: Optional local tokenizer estimate for tool schemas (subset of non_message_tokens).non_tool_static_tokens: Derived static remainder (non_message_tokens - tool_schema_tokens).provider_anchor_remainder: Derived residual (prompt_tokens - non_message_tokens).# Compare first turn vs last turn in the same session
python3 scripts/audit_context.py compare /path/to/session.jsonl /path/to/session.jsonl --before first --after last
# Compare baseline session vs optimized session
python3 scripts/audit_context.py compare baseline.jsonl optimized.jsonl
The comparison calculates delta, reduction percentage, direction of change, and issues explicit warnings if models or compaction epochs differ.
/dump SidecarFor pre-request inspection without session files:
python3 scripts/audit_context.py inspect /tmp/omp-llm-request-sample.json
Measures Unicode characters, UTF-8 bytes, and heuristic character estimates (chars / 4) for systemPrompt, tools, and messages without emitting sensitive payload contents. Native metrics and dump heuristics cannot be mixed in comparisons.
audit_context.py inspect on an existing session trace or capture /dump during a representative run.tool_schema_tokens dominates static tokens: prune unused tools or adopt progressive skill loading.non_tool_static_tokens dominates: streamline system prompt rules or extract reference docs into on-demand files.provider_anchor_remainder dominates: apply observation masking or trigger compaction on resolved turns.audit_context.py compare against the baseline. If no baseline was captured, explicitly state that savings are unmeasured.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/context-audit:context-auditfrom Context Window & Token Audit
npx claudepluginhub nordz0r/skills --plugin context-audit2 plugins in one repository ship this exact skill · first indexed Nov 15, 2026