Skip to content
Productivity
Command

/context-optimizer

Diagnose context usage and reduce unnecessary token consumption.

From plugin
pro-workflow
2.9k23 skills8 agents23 commands22 hooks
> /plugin marketplace add rohitg00/pro-workflow
> /plugin install pro-workflow@pro-workflow

Command definition

context-optimizer.md
description: Diagnose context usage and reduce unnecessary token consumption.

/context-optimizer - Optimize Token Usage

Diagnose and fix context window problems.

Process

1. **Check current usage:**

  • If > 70% → compact now before quality degrades
  • If > 90% → compact immediately, you're in the "dumb zone"

2. **Run optimization checks:**

**MCP audit:**

   /mcp
  • Keep <10 MCPs enabled, <80 tools total
  • Disable what you're not actively using

**CLAUDE.md size:**

  • Root CLAUDE.md should be < 60 lines, < 150 max
  • Move package-specific info to package-level files
  • Move personal preferences to CLAUDE.local.md

3. **Apply fixes based on findings:**

| Problem | Fix | |---------|-----| | High context usage | `/compact` with focus on current task | | Too many MCPs | Disable unused servers | | Bloated CLAUDE.md | Split into modular files | | Heavy exploration in main session | Delegate to subagents | | Vague prompts causing broad searches | Scope prompts with paths and constraints |

4. **Set proactive auto-compaction** if not already configured:

   {
     "env": {
       "CLAUDE_AUTOCOMPACT_PCT_OVERRIDE": "50"
     }
   }

5. **Report** current state and what was optimized.

Signs of Degraded Context

  • Claude repeats itself or forgets earlier decisions
  • Responses become generic, lose project-specific knowledge
  • Tool calls fail for reasons that worked earlier

Quick Fixes

| Action | Saves | When | |--------|-------|------| | `/compact` | 30-50% context | Task boundaries | | Disable unused MCPs | ~5% per MCP | Switching domains | | Subagent delegation | Keeps main clean | Heavy search/read tasks | | Fresh session via `/resume` | 100% reset | Unrelated work |

---

**Trigger:** Use when sessions feel slow, context is degraded, running out of budget, or before starting a long task.

Read more
@rohitg00
Ships withpro-workflow

Claude Code learns from your corrections: self-correcting memory that compounds over 50+ sessions. Context engineering, parallel worktrees, agent teams, and 17 battle-tested skills.

2.9k41 skills8 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
2.9k
Star history of rohitg00/pro-workflow on GitHub, a chart by star-history.com

Other commands on pro-workflow.

auto-setup

auto-setup

Command

Auto-detect project type and configure quality gates, permissions, and hooks for a new codebase

@rohitg00@rohitg00Install Command
compact-guard

compact-guard

Command

Smart context compaction with state preservation — saves critical state before compact and restores after

@rohitg00@rohitg00Install Command

More commands from other plugins.

analyze-cohorts

analyze-cohorts

Command

Perform cohort analysis on user data — retention curves, feature adoption, and engagement trends

@phuryn@phurynInstall Command
again

again

Command

PUA Again — 用于再试试、换个方法、别放弃、为什么还不行、同一路径失败多次;要求停止微调同一思路,改用本质不同方案。

pua2mo20k
@tanweai@tanweaiInstall Command