/dev10x-teach:context-auditfrom dev10x-teach
Audits context window utilization by scanning CLAUDE.md files, rules, agent specs, references, and memories. Reports budget compliance, flags oversized files, and suggests pruning actions to optimize context usage.
Ships in dev10x-teach. 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.
Every file loaded into Claude's context window consumes capacity. This skill audits all context sources against documented budgets, identifies bloat, and suggests specific pruning actions.
Complements dev10x-teach:memory-maintenance (which audits memory
content quality) by covering the structural layer: file sizes,
budget compliance, and cross-file redundancy.
REQUIRED: Create tasks before ANY work. Execute at startup:
TaskCreate(subject="Scan context sources", activeForm="Scanning")TaskCreate(subject="Check budget compliance", activeForm="Checking budgets")TaskCreate(subject="Detect redundancy", activeForm="Detecting redundancy")TaskCreate(subject="Present findings and suggestions", activeForm="Presenting")Set sequential dependencies.
Discover all files that contribute to the context window. Scan both the plugin directory and user-space locations.
| Category | Location | Budget |
|---|---|---|
| CLAUDE.md (project) | <repo>/CLAUDE.md | 100 lines |
| Rules | <repo>/.claude/rules/*.md | 200 lines each |
| Agent specs (internal) | <repo>/.claude/agents/*.md | 50 lines each |
| Agent specs (plugin) | <repo>/agents/*.md | 200 lines each |
| References | <repo>/references/*.md | 200 lines each |
| Category | Location | Budget |
|---|---|---|
| CLAUDE.md (global) | ~/.claude/CLAUDE.md | No strict budget |
| SKILLS.md | ~/.claude/SKILLS.md | 45 lines |
| MEMORY.md (global) | ~/.claude/memory/MEMORY.md | 200 lines |
| Dev10x global config | ~/.config/Dev10x/** | No per-file budget |
For each discovered file, record:
wc -l)Compare each file against its budget. Classify:
| Usage | Status | Action |
|---|---|---|
| ≤ 60% | OK | No action needed |
| 61-79% | WATCH | Monitor — approaching limit |
| 80-99% | WARNING | Plan a split (per INDEX.md) |
| ≥ 100% | OVER | Must split or prune |
Calculate totals per category:
Check for documented budget overrides in INDEX.md:
Grep for "Budget Overrides" section in .claude/rules/INDEX.md
Files with documented overrides get their override budget instead of the default. Flag overridden files as INFO (not WARNING) when they exceed the default but stay within the override.
Scan for common redundancy patterns across context files:
Check for content that appears in multiple files:
Use targeted grep for common patterns:
Check for references to files or paths that no longer exist:
Identify files in .claude/rules/ that could be moved to
references/ (loaded on-demand by skills instead of every
session). Criteria:
Present a table sorted by usage (highest first):
## Context Budget Report
| File | Lines | Budget | Usage | Status |
|------|-------|--------|-------|--------|
| .claude/rules/INDEX.md | 173 | 200 | 87% | WARNING |
| references/task-orchestration.md | 367 | 200 | 184% | OVER* |
| .claude/agents/reviewer-skill.md | 48 | 50 | 96% | WARNING |
| ... | ... | ... | ... | ... |
* Has documented budget override (cohesion justification)
### Summary
- 45 files scanned, 3,200 total lines
- 2 files OVER budget (1 with override)
- 3 files at WARNING level
- Estimated context: ~12% of window at session start
List each redundancy found with:
For each OVER or WARNING file, suggest specific actions:
| Suggestion Type | Example |
|---|---|
| Split | "Split INDEX.md routing table into a separate file" |
| Move to reference | "Move X from rules/ to references/" |
| Remove duplicate | "Remove git convention from CLAUDE.md (already in rules)" |
| Consolidate | "Merge agent specs A and B (80% overlap)" |
| Prune stale | "Remove memory entry X (references deleted file)" |
REQUIRED: Call AskUserQuestion (do NOT use plain text).
Options:
For each approved fix:
Never modify files without explicit user approval from the decision gate above.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
context-audit, context-window, budget-compliance, pruning, claude-config
Other plugins' skills for the same job
npx claudepluginhub dev10x-guru/dev10x-claude --plugin dev10x-teach7 skills in this plugin
/audit-filedev10x-teach:audit-fileFile skill-audit findings as a GitHub issue at the plugin repo that owns the offending skill. Invoked by skill-audit Phase 7 with the target repo confirmed at its destination gate. TRIGGER when: skill-audit Phase 7 completes and user opts to file upstream. DO NOT TRIGGER when: no audit findings exist, or user wants to review findings before filing.
/memory-maintenancedev10x-teach:memory-maintenanceAudit project and global memory files for stale patterns, version-pinned paths, contradictory instructions, and anti-patterns that cause skill bypass or permission friction. Reports findings and offers to clean up. TRIGGER when: user wants to audit memory health, after a plugin upgrade, or when agents keep bypassing skills despite memory instructions. DO NOT TRIGGER when: user wants to save or recall a specific memory (use the auto memory system directly).
/skill-auditdev10x-teach:skill-auditAudit a session's skill usage, compliance, and extract lessons learned. Default (lightweight): analyzes visible context inline and presents a disposition gate — no separate terminal needed for most audits. Forensic (--full or escalation): dispatches parallel subagents for deep transcript analysis — run from a separate terminal. TRIGGER when: session is complete and user wants usage review, or a skill didn't behave as expected. DO NOT TRIGGER when: mid-session during active work, or user is asking about a specific skill's documentation.
/skill-audit-queuedev10x-teach:skill-audit-queueQueue a skill-audit invocation for later by appending a tracker task to the end of the current task list. Use mid-session when you notice friction but do not want to interrupt in-flight work — the audit runs when the supervisor reaches the queued task. Also captures lightweight friction/skill-improvement notes as annotations on the queued task, so the full audit has prior context. TRIGGER when: friction noticed mid-session, but interrupting current work is not desirable; supervisor wants the audit deferred until the active task completes. DO NOT TRIGGER when: supervisor wants the audit to run NOW (use dev10x-teach:skill-audit directly), or no friction has been observed.
/skill-createdev10x-teach:skill-createUse when creating or improving a local skill and hitting friction — bash commands keep prompting for approval, the skill doesn't appear in MOTD, or it's unclear which frontmatter fields wire up invocability — so you get the Dev10x-specific setup right without hunting through existing skills for examples. TRIGGER when: creating a new skill, fixing skill registration, or scaffolding skill directory structure. DO NOT TRIGGER when: editing skill content without structural issues, or writing non-skill code.
/skill-indexdev10x-teach:skill-indexGenerate a family-grouped, adaptive-density skill index. Scans local skills and all installed plugins, groups by families.yaml, hides orchestration deps via hidden.yaml, and writes ~/.claude/SKILLS.md (≤45 lines, ≤300 chars/line). TRIGGER when: regenerating SKILLS.md after adding, removing, or renaming skills. DO NOT TRIGGER when: viewing the existing skill index, or editing individual skills.