skills/golem-powers/context-check/SKILL.md
Audit and fix per-project AI context hygiene. Compares loaded skills, MCPs, hooks, and agents against the project's context profile in ~/.golems/config.yaml. Reports wasted tokens and generates .claude/settings.local.json + CLAUDE.md containerization. Use when setting up a new project, debugging context bloat, or running maintenance sweeps.
npx skillsauth add etanhey/golems context-checkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Audit what's loaded vs what SHOULD be loaded for this project.
/context-check # Audit mode — report waste
/context-check --fix # Fix mode — generate configs
~/.golems/config.yaml → contextProfiles section.claude/settings.local.json + CLAUDE.md sectioncat ~/.golems/config.yaml
Find the contextProfiles section. Look up the current project by matching pwd against registered project paths (either from contextProfiles keys or from ~/.config/ralphtools/registry.json → projects → path).
If project NOT found: Say so. Offer to run repo discovery (scan package.json, detect stack, suggest a profile). Do NOT guess.
Skills loaded: List all files in ~/.claude/commands/ — each directory is a loaded skill.
ls ~/.claude/commands/
MCPs loaded: Check which MCP servers are configured:
# Project MCPs
cat .mcp.json 2>/dev/null
# Parent dir MCPs (Claude Code walks up)
cat ../../../.mcp.json 2>/dev/null # adjust depth for ~/Gits/.mcp.json
# Global MCPs
python3 -c "import json; d=json.load(open('$HOME/.claude/settings.json')); print(json.dumps(d.get('mcpServers',{}), indent=2))" 2>/dev/null
Hooks loaded: Check global settings for hooks:
python3 -c "import json; d=json.load(open('$HOME/.claude/settings.json')); print(json.dumps(d.get('hooks',{}), indent=2))" 2>/dev/null
Per-project overrides: Check if .claude/settings.local.json exists:
cat .claude/settings.local.json 2>/dev/null || echo "NO OVERRIDE — using global defaults"
For the matched profile, compare:
| Category | Profile Field | Loaded From | Comparison |
|----------|--------------|-------------|------------|
| Skills | skills.allow | ~/.claude/commands/ dirs | List extras not in allow list |
| MCPs | mcps.block | .mcp.json + parent + global | List blocked MCPs still active |
| Hooks | hooks: false | Global settings.json | Check if hooks are disabled |
| Agents | agents.allow | System prompt (can't audit directly) | List for CLAUDE.md |
=== CONTEXT CHECK: mehayom ===
Identity: mehayomClaude
SKILLS (10 allowed, 42 loaded):
✅ Allowed: context7, commit, github, pr-loop, coderabbit, never-fabricate
❌ Extra (32): coach, cmux-agents, figma-swarm, orchestrator-status, ...
⚠️ Wasted: ~5.2k tokens (~2.6% of 200k context)
MCPs (2 allowed, 7 loaded):
✅ Active: linear, context7
❌ Should block: brainlayer, voicelayer, supabase
ℹ️ Can't block (global): exa, notebooklm
HOOKS:
❌ BrainLayer hooks ACTIVE (profile says: disabled)
⚠️ Estimated overhead: ~500 tokens per prompt
AGENTS:
✅ Allowed: general-purpose, Explore
❌ In system prompt but irrelevant: coach, orchestrator, jobs, services, ...
OVERRIDE FILE: .claude/settings.local.json
[EXISTS / MISSING / STALE]
TOTAL WASTE ESTIMATE: ~6.1k tokens (3% of context) + hook overhead
If the user passed --fix or you're in fix mode:
1. Generate .claude/settings.local.json:
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"disabledMcpjsonServers": ["brainlayer", "voicelayer", "supabase"],
"hooks": {
"SessionStart": [{ "hooks": [] }],
"UserPromptSubmit": [{ "hooks": [] }]
}
}
Populate disabledMcpjsonServers from mcps.block in the profile.
If hooks: false, override SessionStart and UserPromptSubmit with empty hooks arrays.
2. Generate CLAUDE.md containerization section:
Add to the project's CLAUDE.md (create if needed, append if exists):
## CONTAINERIZATION
**You are [identity]. You work ONLY on this app.**
### Skill Allowlist — ONLY Use These
[Generate table from profile.skills.allow]
### Project Rules
[Generate from profile.rules]
3. Create .claude/ dir if needed:
mkdir -p .claude
4. Verify: After generating, re-run the audit to confirm waste is reduced.
Rough token counts for waste estimation:
~/.claude/commands/: ~150 tokens averageFormula: waste = (extra_skills * 150) + (blocked_mcps_tools * 100) + (hooks_if_disabled * 500)
Claude Code has full audit + fix. Other CLIs have partial support. Full adapter docs: adapters/
| Feature | Claude Code | Universal Fallback |
|---------|-------------|-------------------|
| MCP audit | /mcp command + parse settings.json | N/A — other CLIs have no MCP |
| Hook audit | Parse settings.json hooks section | N/A — other CLIs have no hooks |
| Skills audit | ls ~/.claude/commands/ | Same command (shared skill dir) |
| Fix: MCP disable | disabledMcpjsonServers in settings.local.json | Comment out in .mcp.json manually |
| Fix: Hook disable | Override hooks to [] in settings.local.json | N/A |
| Fix: Containerization | settings.local.json + CLAUDE.md section | CLAUDE.md section only (+ .cursor/rules/ for Cursor) |
| Registry lookup | Read ~/.golems/config.yaml contextProfiles | Same (shared config file) |
This skill is Component C2 of the Maintenance Golem (Wave 8).
Design doc: ~/Gits/orchestrator/designs/maintenance-golem.md
The nightly maintenance squad (C4) runs this skill across ALL projects weekly to detect config drift.
tools
The human-eval UX contract for Phoenix views: turn-by-turn scrollable replay (not a scorecard), hide-but-copyable IDs, collapsed thinking, identity chips, tool filters, tiny frozen starter datasets, mark-wrong-in-thread, mobile-first. Use when: building or reviewing ANY Phoenix/eval view, annotation UI, session replay, or human-grading surface. Triggers: phoenix view, eval UI, annotation view, session replay, human eval UX, grading interface. NOT for: Phoenix data pipelines/ingest (capture scripts have their own specs).
tools
macOS systems specialist — AppKit NSPanel architecture, launchd services, socket activation, MCP bridge resilience, syspolicyd, and high-frequency SwiftUI dashboards. Use when building menu-bar apps, LaunchAgents, debugging syspolicyd/Gatekeeper/TCC, resilient UDS/MCP bridges, or SwiftUI dashboards at 10Hz+.
development
Bulk LLM-judging protocol for fleet-dispatched verdict runs (KG cluster, eval harness). Use when: dispatching or running judge workers (J1/J2/RT), planning bulk-apply from verdict JSONL, or triaging evidence_degraded outputs. Triggers: judge fleet, bulk judge, R3 verdicts, kg-judge, RT gate, evidence_degraded. NOT for: single-item code review, Phoenix view UX (use phoenix-human-view), or non-judge eval pipelines.
development
Quiet-down protocol for sprint close: when the fleet wraps, delete ALL polling crons and monitors, send ONE final dashboard + ONE message, then go SILENT. Use when: fleet wraps, all workers done, overnight queue exhausted, sprint close, Etan asleep/away with nothing approved left. Triggers: fleet wrap, wrap the fleet, stand down, going quiet, sprint close. NOT for: mid-sprint monitoring (keep your loops), spawning a successor (use /session-handoff first).