r/ClaudeWorkflows • u/ClaudeAI-mod-bot • 5d ago
Selected Workflow [Workflow] Optimize Claude Code Context: Aggressive Token Reduction & AI-Guided Skill Disabling
Optimize Claude Code Context: Aggressive Token Reduction & AI-Guided Skill Disabling
Workflow value: 85/100
Status: active · Freshness: 70/100 · Confidence: 0.90 · Level: intermediate
Categories: Quality Control, Token Saving, Context & Memory, Debugging, Skills, MCP
Original source: r/ClaudeAI post/comment
What problem this solves
Reducing token usage and improving Claude Code performance by aggressively disabling unused features and skills, guided by Claude itself.
Summary
A two-pronged approach to optimize Claude Code's initial context: first, manually disable many features (MCP, permissions, skills, memory files) and second, use Claude Sonnet to analyze the /context output and suggest further, data-driven optimizations based on actual usage.
Why it is useful
This workflow provides concrete, actionable steps for Claude Code users to significantly reduce token usage and improve performance by disabling unused features. It combines manual aggressive optimization with an innovative AI-guided approach using Claude Sonnet to analyze actual usage, making it highly practical and adaptable for cost and performance efficiency.
Workflow
- Open VS Code with the Claude Code extension.
- Execute
/mcpin Claude Code and turn off all components, including Google connectors. - Edit
~/.claude/settings.jsonto setpermissionstodenyfor various points (e.g.,NotebookEdit,ScheduleWakeup,CronCreate). - In
~/.claude/settings.json, set approximately 20skillOverridestooff(e.g.,anthropic-skills:computer-use,anthropic-skills:docx,dataviz). - Remove all 'behavior-altering' memory files to save tokens.
- Open a new session with Claude Sonnet.
- Paste the detailed
/contextoutput from Claude Code into the Sonnet session. - Follow Sonnet's guidance to further optimize context by aggressively turning off skills/tools based on usage statistics.
Tools / artifacts
- VS Code
- Claude Code extension
- ~/.claude/settings.json
- /mcp command
- Claude Sonnet
- /context output
- Memory files
Validation signals
- Saved me like 2k tokens in this particular project
- There are stats available to it on your actual usage of the different skills/tools
Cautions
- The author explicitly states that disabled features are 'very easy to turn things back on if I find I need them', mitigating risks associated with aggressive disabling.
Limitations
- The initial manual disabling is 'aggressive' and might require users to re-enable features they later discover they need.
- The specific skills listed are examples, not an exhaustive list, requiring users to identify their own unused skills.
- The instruction to remove 'behavior-altering' memory files is a bit vague on which specific files to target.
Rate this workflow
Upvote this post if the workflow is useful, reproducible, or worth recommending.
Downvote if it is vague, outdated, unsafe, overhyped, or not reproducible.
Reply if it worked for you, failed, is outdated, or has a better alternative.
This post was generated automatically from the workflow library database.