claude-context-cleanup

Diagnose and fix Claude context window exhaustion from enabled tools and MCP connectors.

2|Updated Feb 12, 2026
One-click install
npx skills add https://github.com/MahoneyContextProtocol/claude-cleanup --skill claude-context-cleanup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-context-cleanup
Source: https://github.com/MahoneyContextProtocol/claude-cleanup/tree/main
Command: npx skills add https://github.com/MahoneyContextProtocol/claude-cleanup --skill claude-context-cleanup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Claude users experience context window exhaustion when too many tools and MCP connectors are enabled, causing file creation failures, broken conversations, and degraded performance. This skill provides a guided, end-to-end workflow to diagnose and fix such issues across Claude Desktop, Claude Code, and claude.ai, including both automated and manual steps.

Core Features & Use Cases

  • Diagnose MCP server load and token hogs to determine impact on the 200k token window.
  • Automated cleanup: backup MCP configs, disable local MCP servers, clear Claude caches, restart the desktop app, and auto-open the settings page for quick verification.
  • Manual steps: web UI toggles for MCP connectors, Web Search, Extended Thinking, Analysis Tool, and Code Execution, plus chat-level toggles and browser cache cleanup.
  • Restore and re-enable: restore from backups and re-enable tools one-by-one after testing to isolate culprits.
  • Safe fallbacks: provides a UI checklist and fallback guidance if automation fails.

Quick Start

Install the cleanup script if needed and run claude-fix nuke -y to perform a full cleanup.

Frequently Asked Questions about claude-context-cleanup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does Claude context window exhaustion happen and how does it affect conversations?

Claude context window exhaustion happens when too many MCP connectors and enabled tools consume tokens before user input, causing file creation failures, stalled conversations, and degraded performance across Claude Desktop, Claude Code, and claude.ai.

How do I fix Claude context exhaustion caused by too many MCP servers?

To fix Claude context exhaustion, run an automated cleanup workflow that backs up MCP configs, disables local MCP servers, clears caches, restarts the desktop app, and provides manual toggles for cloud-side connectors as a fallback.

How can I safely disable MCP servers and restore them later in Claude Desktop?

You can safely disable MCP servers by automating MCP config backups before disabling them, then restoring from those backups and re-enabling tools one-by-one after testing to isolate which connector was causing the token overload.

What manual steps can I take to clear Claude caches and reduce token consumption?

Manual steps to clear Claude caches include using web UI toggles to disable MCP connectors, Web Search, Extended Thinking, Analysis Tool, and Code Execution, plus adjusting chat-level toggles and clearing browser cache.

Does the Claude context cleanup workflow work across claude.ai and Claude Code?

The context cleanup workflow applies across Claude Desktop, Claude Code, and claude.ai, targeting both local MCP servers and cloud-side connectors that consume tokens before user input.

What should I do if the automated Claude context cleanup fails to run?

If automated cleanup fails, use the provided manual UI checklist fallback to disable MCP connectors and features, clear caches, and restart the desktop app manually to resolve the context window exhaustion.