context-engineeringlisted
Install: claude install-skill manastalukdar/ai-devstudio
# Context Engineering
I'll audit your current context load, identify what is inflating it unnecessarily, and restructure the 5-layer hierarchy so the agent stays sharp for the rest of the session.
Arguments: `$ARGUMENTS` — optional focus (e.g., "optimize for implementation", "optimize for debugging")
## Token Optimization
**Expected range**: 200–600 tokens (audit report + recommendations)
**Early exit**: If context appears healthy (no redundant files loaded, no stale error traces), report "Context healthy — no changes needed"
**Patterns used**: Bash for file size checks, progressive disclosure (summary first, details on request)
## The 5-Layer Context Hierarchy
```
Layer 1 — Rules files CLAUDE.md, .claude/rules/*.md
Layer 2 — Specs / designs docs/specs/, PRD, ADRs
Layer 3 — Source files only the files currently being changed
Layer 4 — Error output compiler errors, test failures, logs
Layer 5 — Conversation current session history
```
Each layer has an appropriate size budget. Layers 3–5 are the most common source of bloat.
## Step 1 — Audit Current Context
```bash
# Estimate context pressure indicators
wc -l .claude/rules/*.md 2>/dev/null | tail -1
find . -name "CLAUDE.md" | xargs wc -l 2>/dev/null | tail -1
ls -la docs/specs/ 2>/dev/null | head -10
```
Check for common inflation sources:
- Entire files loaded when only a function is needed
- Stale error traces from previous attempts (no longer relevant)
- Spec documents for features not cur