dev10x:context-audit
/dev10x:context-audit
Audit context window utilization — CLAUDE.md files, rules, agent specs, references, and memories. Reports budget compliance, flags oversized files, and suggests pruning actions. TRIGGER when: user wants to optimize context usage, after adding many rules or memories, or when sessions feel sluggish from context bloat. DO NOT TRIGGER when: auditing memory content quality (use dev10x:memory-maintenance instead).
- Author
- dev10x-guru ↗
- Repository
- dev10x-claude ↗
- Licence
- MIT
- Last repository change
- 12.10.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 12.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Audit context window utilization — CLAUDE.md files, rules, agent specs, references, and memories. Reports budget compliance, flags oversized files, and suggests pruning actions. TRIGGER when: user wants to optimize context usage, after adding many rules or memories, or when sessions feel sluggish from context bloat. DO NOT TRIGGER when: auditing memory content quality (use dev10x:memory-maintenance instead).
Original author description
Audit context window utilization — CLAUDE.md files, rules, agent specs, references, and memories. Reports budget compliance, flags oversized files, and suggests pruning actions. TRIGGER when: user wants to optimize context usage, after adding many rules or memories, or when sessions feel sluggish from context bloat. DO NOT TRIGGER when: auditing memory content quality (use dev10x:memory-maintenance instead).
How it works
- Overview
- Orchestration
- Phase 1: Scan Context Sources
- Phase 2: Check Budget Compliance
- Phase 3: Detect Redundancy
- Phase 4: Present Findings and Suggestions
SKILL.md preview
--- name: dev10x:context-audit description: > Audit context window utilization — CLAUDE.md files, rules, agent specs, references, and memories. Reports budget compliance, flags oversized files, and suggests pruning actions. TRIGGER when: user wants to optimize context usage, after adding many rules or memories, or when sessions feel sluggish from context bloat. DO NOT TRIGGER when: auditing memory content quality (use dev10x:memory-maintenance instead). user-invocable: true invocation-name: dev10x:context-audit allowed-tools: - Read - Glob - Grep - AskUserQuestion - TaskCreate - TaskUpdate - Edit - Bash(pytest:*) --- # dev10x:context-audit — Context Window Optimizer ## Overview 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:memory-maintenance` (which audits memory content quality) by covering the structural layer: file sizes, budget compliance, and cross-file redundancy. ## Orchestration **REQUIRED: Create tasks before ANY work.** Execute at startup: 1. `TaskCreate(subject="Scan context sources", activeForm="Scanning")` 2. `TaskCreate(subject="Check budget compliance", activeForm="Checking budgets")` 3. `TaskCreate(subject="Detect redundancy", activeForm="Detecting redundancy")` 4. `TaskCreate(subject="Present findings and suggestions", activeForm="Presenting")` Set sequential dependencies. ## Phase 1: Scan Context Sources Discover all files that contribute to the context window. Scan both the plugin directory and user-space locations. ### 1.1 Plugin Context (always loaded) | 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 | ### 1.2 User-Space Context | 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 | ### 1.3 Collect Metrics For each discovered file, record: - **Path** (relative to repo or home) - **Line count** (`wc -l`) - **Category** (from tables above) - **Budget** (from INDEX.md or table above) - **Usage %** (line count / budget * 100) ## Phase 2: Check Budget Compliance 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 | ### 2.1 Aggregate Metrics Calculate totals per category: - Total files scanned - Total lines across all files - Files at WARNING or OVER status - Category with highest utilization ### 2.2 Budget Override Detection 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. ## Phase 3: Detect Redundancy Scan for common redundancy patterns across context files: ### 3.1 Duplicate Content Check for content that appears in multiple files: - Same rule stated in both CLAUDE.md and a rules file - Same convention in both a rule and a reference doc - Memory entries that duplicate CLAUDE.md instructions Use targeted grep for common patterns: - Git conventions (branch naming, commit format) - Testing patterns (pytest, coverage) - Tool preferences (ruff, black, mypy) ### 3.2 Stale References Check for references to files or paths that no longer exist: - Rules referencing deleted agent specs - INDEX.md entries pointing to missing references - Memory files referencing renamed skills ### 3.3 Always-Loaded vs On-Demand Identify files in `.claude/rules/` that could be moved to `references/` (loaded on-demand by skills instead of every session). Criteria: - File is only relevant to one specific skill - File exceeds 100 lines (high context cost) - File has a clear skill owner (from INDEX.md routing) ## Phase 4: Present Findings and Suggestions ### 4.1 Budget Report 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 ``` ### 4.2 Redundancy Findings List each redundancy found with: - What is duplicated - Where it appears (file:line for each occurrence) - Suggested action (remove from X, keep in Y) ### 4.3 Pruning Suggestions 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)" | ### 4.4 Decision Gate **REQUIRED: Call `AskUserQuestion`** (do NOT use plain text). Options: - Apply safe fixes (Recommended) — Remove stale refs, fix broken links - Review each fix — Walk through suggestions one by one - Report only — No changes, just the audit report - Delegate to memory-maintenance — Hand off memory-specific findings ### 4.5 Apply Fixes (if approved) For each approved fix: 1. Read the target file 2. Apply the edit (remove duplicate, update reference, etc.) 3. Verify the file is still valid after edit 4. Report what was changed Never modify files without explicit user approval from the decision gate above.
Files in this package (2)
- SKILL.md 6 KB
- evals/evals.json 2 KB
Versions
The database has no other skills named dev10x:context-audit.
Database snapshot: 13.11.2026 · package version 16fec5f3ca31 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95solo-memory-audit
Use when "audit memory", "check CLAUDE.md", "memory map", "rules audit", "context budget", "what loads in my session", or need to optimize agent context loading. - 100usage-audit
Audit a Claude Code setup for token waste and context bloat. Checks MCP servers, CLAUDE.md, skills, and settings against bloat filters. Triggers on: "audit my context", "usage audit", "token audit", "context bloat". NOT for codebase audits. - 100context-budget
Audits Nemo Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations. Use when the context window is filling up too fast and the agents, skills, MCP servers, or… - 100rootnode-context-budget
Analyzes Claude Project context budget under the automatic-RAG-by-window model: knowledge files vs. threshold-exempt overhead (Skills, MCPs, CI, Memory). Two modes: Quick Diagnostic and Full Budget Audit. Use when user says "check my context budget," "how much context am I… - 100context-budget
Audits Claude Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations. Use when the context window is filling up too fast and the agents, skills, MCP servers, or… - 100ctxrent
Context rent of the user's coding-agent sessions, turned into approved rules for CLAUDE.md or AGENTS.md. Use when the user runs /ctxrent, asks where their tokens or context go, why sessions are slow or expensive, or wants hygiene rules from their own session history.