From context-density
Use when designing, auditing, refactoring, measuring, or validating token-efficient context and prompt/output contracts. Trigger for AGENTS.md, prompts, skill packages, marketplace plugins, MCP/tool schemas, long-context placement, prompt/context compression, retrieval provenance, runtime context diagnostics, duplicated hot-path prose, brittle trigger descriptions, strict JSON/schema/tool-call output, validators, retry/repair loops, or behavior-preserving token reduction.
How this skill is triggered — by the user, by Claude, or both
Slash command
/context-density:context-densityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Optimize capability density through measured context, explicit contracts, and token-aware design.
Optimize capability density through measured context, explicit contracts, and token-aware design.
Every audit or refactor follows the same spine:
Load paths:
| Path | Meaning | Default treatment |
|---|---|---|
| Hot | Startup files, skill frontmatter/body, prompt templates, root agent rules | Directive, compact, measured |
| Router | Indexes, maps, READMEs, source-of-truth lists | Short pointers and ownership |
| Reference | Variant details, examples, recovery notes | Open only when needed |
| Evidence | Logs, raw API payloads, source packs, changelogs | Link or archive, do not hot-load |
| Need | Read |
|---|---|
| Shared terminology, workflow, source-of-truth layout | references/operating-model.md |
| Startup/context/token diagnostics and host-runtime measurement choices | references/token-diagnostics.md |
| SKILL.md or plugin skill package footprint reduction | references/skill-refactor.md |
| Skill/plugin portfolio split, merge, delete, move, router, cross-plugin overlap, or script-extract decisions | Capability Workbench capability-portfolio-architect when available |
| Prompt, model-output, tool-call, schema, retry, or prose-parsing review | references/prompt-contracts.md |
| Long-context placement, prompt compression, schema/task validity, retrieval citation, or cache-prefix acceptance gates | references/research-backed-gates.md |
| Final audit sections and JSON/Markdown report contracts | references/report-contracts.md |
Keep SKILL.md lean. Move rare detail to references only when it prevents repeated hot-path loading.
Run from this skill directory or pass absolute paths:
python3 scripts/token_count.py <files-or-dirs> --json --top 20
python3 scripts/context_density_audit.py <files-or-dirs> --json --top 20
Use the bundled runtime reporter when the question is about local Codex or Claude Code startup context, installed skills, MCP config, plugin manifests, ranked raw context sources, exportable reports, or latest session token usage:
python3 scripts/codex_context_report.py agents --json
python3 scripts/codex_context_report.py brief --agent codex --project . --usage --json
python3 scripts/codex_context_report.py skills --agent codex --limit 10 --ndjson
python3 scripts/codex_context_report.py skill context-density --agent codex --json
python3 scripts/codex_context_report.py mcp --agent codex --no-introspect-mcp --json
python3 scripts/codex_context_report.py mcp --agent codex --tools SERVER --json
python3 scripts/codex_context_report.py sources --agent codex --ndjson --limit 20
python3 scripts/codex_context_report.py export markdown --agent codex --project .
The reporter is read-only and exposes a CLI-compatible reporting surface for local file diagnostics. It estimates context from files on disk and does not introspect live MCP tool schemas or mutate host-agent config.
For material work, include:
Context density audit:
- Consumer/load path:
- Token measurement:
- Commitment preservation: critical atoms, verbatim strings, evidence refs, recovery pointers.
- Relevance/placement: what stayed hot, what moved to references, and any middle-buried commitments handled.
- Compression economics: input/output token effect, total cost, task validation, or why unavailable.
- Evidence boundary: artifact recall versus committed state.
- Existing context refactor:
- Preserved invariants:
- Contract discipline:
- Validation:
- Adopted/rejected changes:
- Remaining tradeoffs:
If the task touches LLM/model-output handling, also include the prompt-contract audit from references/report-contracts.md.
npx claudepluginhub xopoko/plug-n-skills --plugin context-densityGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.