rfxn/rdf/r-context-audit
Claude Code and agent skill by rfxn/rdf
- community
Checking that the SKILL.md file is still in the repository.
Measure, score, and report on Claude Code context overhead for this
Install
npx vskill@latest install rfxn/rdf/r-context-auditSKILL.md
The same SKILL.md was published earlier as rfxn/rdf/r-context-audit.
/rdf:r-context-audit — Context Weight Audit
Measure, score, and report on Claude Code context overhead for this workspace. Identifies bloat, tracks drift from baseline, and produces actionable optimization recommendations.
Run periodically (weekly, or after adding skills/memory/governance) to catch context creep before it impacts session quality.
Arguments
$ARGUMENTS— optional:--fixto apply Tier 1 quick wins automatically
Protocol
1. Run Measurement Script
Execute the automated measurement script:
If a baseline file exists at ~/.rdf/context-audit-baseline.json, run with comparison mode:
Parse the JSON output. Do NOT make additional file reads or greps — the script measures everything.
Then measure RDF's own always-loaded boot cost:
Surface the three deploy figures from its JSON — default_boot_tokens (~0.1K, lessons index only), rules_boot_tokens (~2.1K, adds the unscoped core governance rule), and lite_boot_tokens (~0.7K, rdf-lite condensed governance). hooks.json appears only under excluded — it is runtime config that never enters model context, so it is not part of any boot figure.
2. Render Report
Use this exact format. Keep it under 40 lines.
Score labels:
- 90-100: CLEAN
- 70-89: NEEDS_WORK
- 50-69: BLOATED
- 0-49: CRITICAL
3. Recommendations
After the report, emit a prioritized fix list in three tiers:
Tier 1 — Quick wins (no behavioral change):
- Remove dead fields from rdf-state.sh
- Compact memory archives
- Prune stale memory satellites
Tier 2 — Structural (requires planning):
- Split CLAUDE.md into base + reference
- Add --lite mode to /rdf:r-start
- Consolidate settings allow rules
Tier 3 — Architectural (multi-session):
- Minimal-context subagent dispatch
- Project-affinity memory loading
- Subagent token budget caps
Only recommend tiers where the audit found actual issues.
4. Save Baseline (if requested)
If the user confirms, or if --save-baseline was passed:
The baseline file is used by future runs to detect drift.
5. Auto-Fix (if --fix)
If --fix was passed, apply these automatically:
- Memory compact — invoke
/rdf:r-util-mem-compact --apply - State output — if
work_output_filesfield exists and has
zero consumers, note the fix location in rdf-state.sh
- Settings — add
autocompact_percentage_override: 75if missing
Do NOT auto-modify CLAUDE.md or skill definitions. Show diffs and ask for confirmation on instruction files.
Scoring Criteria
| Condition | Points | |
|---|---|---|
| Memory satellites > 15 | -10 | |
| Memory archives > 10KB | -10 | |
| MEMORY.md >= 180 lines | -5 | |
| MEMORY.md >= 200 lines | -10 | |
| Workspace CLAUDE.md > 200 lines | -10 | |
| Workspace CLAUDE.md > 400 lines | -10 | |
| rdf-state.sh work_output waste > 5KB | -10 | |
| rdf-state.sh insights duplication > 5KB | -5 | |
| Boot tokens > 40K | -10 | |
| Boot tokens > 60K | -10 |
Score floor: 0. Base: 100.
Repeatable Pattern
This audit is designed to run as a recurring health check:
- Weekly: Run
/rdf:r-context-auditto catch drift - After adding skills/memory: Run to verify impact
- Before major builds: Run to ensure headroom
- After /rdf:r-init or /rdf:r-refresh: Run to verify governance didn't bloat
- Quarterly: Compare against baseline, update baseline if score improved
The measurement script (~/.rdf/state/context-audit.sh) can also be called from CI, cron, or other automation — it outputs pure JSON with no side effects.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingadapters/claude-plugin/output/skills/r-context-audit/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/rfxn/rdf/r-context-audit)