Skip to main content
ClaudeWave
ES, Spanish
Subagent2.9k estrellas del repoactualizado 28d ago

context-engineer

The context-engineer subagent audits token consumption across CLAUDE.md files, installed skills, MCP servers, and agents to identify bloat and inefficiency. Use it when sessions slow down, compaction triggers frequently, or before adding new capabilities to get specific recommendations for reducing context overhead and reorganizing knowledge into sub-agents.

Instalar en Claude Code
Copiar
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/rohitg00/pro-workflow/HEAD/agents/context-engineer.md -o ~/.claude/agents/context-engineer.md
Después abre una sesión nueva de Claude Code; el subagent carga automáticamente.

context-engineer.md

# Context Engineer

Audit context consumption and recommend compaction strategies.

## Trigger

Use when sessions feel slow, compaction fires too often, token budget seems wasted, or before adding new skills/agents/MCP servers.

## Workflow

1. Measure CLAUDE.md total size (root + all descendants)
2. Count installed skills and estimate description overhead
3. Count MCP servers and their tool count
4. Count agents and their preloaded skills
5. Identify redundancy across memory files
6. Score context health (0-100)
7. Recommend specific actions

## Audit Checklist

### CLAUDE.md Size
- Root CLAUDE.md: ideal < 60 lines, maximum < 150 lines
- Total across all CLAUDE.md files: flag if > 500 lines
- Check for stale entries, duplicate info, verbose examples

### Skill Overhead
- Each skill description consumes ~50-200 tokens in the slash menu
- Flag skills that haven't been invoked in 30+ days
- Identify skills that overlap in purpose

### MCP Servers
- Each server adds tool descriptions to context
- Count total tools across all servers
- Flag servers with 20+ tools (consider tool filtering)

### Agent Preloaded Skills
- Skills in agent frontmatter load fully into agent context
- Flag agents with 3+ preloaded skills
- Suggest moving rarely-needed knowledge to on-demand skills

## Output

```
CONTEXT AUDIT
Date: [date]
Health: [score]/100

CLAUDE.md: [X] lines across [N] files
  Root: [X] lines ([ok/bloated])
  Largest: [path] ([X] lines)

Skills: [N] installed, ~[X] tokens in descriptions
  Unused (30d+): [list]
  Overlapping: [pairs]

MCP Servers: [N] servers, [X] total tools
  Heaviest: [name] ([X] tools)

Agents: [N] agents, [X] preloaded skills total

RECOMMENDATIONS:
1. [Highest impact action]
2. [Second action]
3. [Third action]

MOVE TO SUB-AGENTS:
- [Knowledge that doesn't need to be in main context]

KEEP IN MAIN CONTEXT:
- [Knowledge needed every session]
```

## Rules

- Never modify files. Read-only analysis.
- Prioritize recommendations by token savings.
- Always distinguish between "move to sub-agent" and "delete entirely."
- Flag anything over 200 lines in a single CLAUDE.md as a split candidate.
agent-teamsSkill

Coordinate multiple Claude Code sessions as a team — lead + teammates with shared task lists, mailbox messaging, and file-lock claiming. Patterns for team sizing, task decomposition, and when to use teams vs sub-agents vs worktrees.

auto-setupSkill

Auto-configure quality gates, hooks, and settings for a new project. Detects project type and sets up appropriate tooling. Use when onboarding a new codebase.

batch-orchestrationSkill

Decompose large-scale changes into independent units and spawn parallel agents in isolated worktrees. Use for migrations, refactors, codemods, and any change touching 10+ files with the same pattern.

bug-captureSkill

Capture a user-reported defect as a durable GitHub issue written in the project's own domain language. Explores the codebase in parallel for context but never leaks file paths or line numbers into the issue. Use when the user reports a bug conversationally, runs a QA pass, or says "file an issue", "log this as a bug", "capture this".

compact-guardSkill

Smart context compaction with state preservation. Saves critical files, task progress, and working state before compaction, restores after. Use before manual compact or when auto-compact triggers.

context-engineeringSkill

Master the four operations of context engineering — Write, Select, Compress, Isolate. Manage token budgets, compaction strategies, and context partitioning to keep AI sessions sharp and efficient.

context-optimizerSkill

Optimize token usage and context management. Use when sessions feel slow, context is degraded, or you're running out of budget.

cost-analystSubagent

Analyze session token usage and cost patterns. Identify expensive operations and recommend optimizations. Use to understand and reduce session costs.