context-engineer — Claude Code subagent: what it does, how to install
context-engineer audits context window usage across project files, tools, and MCP servers. Useful when sessions run slow or hit token compaction too often.
MIT ★ 2,966 updated 2026-09-29
/plugin marketplace add rohitg00/pro-workflow
/plugin install pro-workflow@pro-workflowWhat context-engineer does
The subagent inspects files that populate the context window during a session. It scans all CLAUDE.md files, totals tool descriptions across MCP servers, and tallies installed skills along with their description overhead. After parsing the setup, it returns a context health score between 0 and 100.
The audit flags any single CLAUDE.md exceeding 200 lines, MCP servers exposing 20 or more tools, and skills untouched for over 30 days. Because the agent is strictly read-only and relies on Read, Glob, Grep, and Bash, it never alters configuration files on its own.
What it helps with
- audit total token overhead from
CLAUDE.mdfiles - detect inactive skills and bloated MCP tool definitions
- calculate a context health score before installing new plugins
- identify guidelines suitable for moving into dedicated subagents
Example prompts for the agent
- Audit context consumption and recommend compaction strategies
- Check our
CLAUDE.mdfiles and MCP servers for context bloat
How to install context-engineer
1Plugin marketplace
/plugin marketplace add rohitg00/pro-workflow/plugin install pro-workflow@pro-workflow2Manually: put the files in place
.claude/agents/context-engineer.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/context-engineer.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/context-engineer.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about context-engineer
How to install context-engineer in Claude Code?
Run /plugin marketplace add rohitg00/pro-workflow in Claude Code, then run /plugin install pro-workflow@pro-workflow.
What does context-engineer do?
It measures token weight across documentation, skills, and MCP tools, delivering actionable compaction advice and a health score.
Does context-engineer edit project files?
No, its workflow is strictly read-only. It provides recommendations on what to trim or move to subagents without modifying existing files.
Source text
context-engineer.md · MIT
--- name: context-engineer description: Analyzes and optimizes context window usage across sessions. Use when context feels bloated, sessions run slow, or approaching compaction limits. tools: ["Read", "Glob", "Grep", "Bash"] omitClaudeMd: true --- # 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.
© Rohit Ghumare · MIT · rohitg00/pro-workflow