context-doctor

Diagnose token waste in Claude Code sessions and prescribe context optimizations.

7|Updated May 26, 2026
One-click install
npx skills add https://github.com/chrono-meta/forge-harness --skill context-doctor-chrono-meta
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: context-doctor
Source: https://github.com/chrono-meta/forge-harness/tree/main/plugins/fh-meta/skills/context-doctor
Command: npx skills add https://github.com/chrono-meta/forge-harness --skill context-doctor-chrono-meta

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Claude Code sessions often waste tokens on irrelevant files loaded into context, repeated full reads of large files, accumulated session noise from not clearing context after direction changes, and verbose command output that floods the context window, slowing down work and increasing costs for long-running development projects.

Core Features & Use Cases

  • Auto-configure .claudeignore: Automatically generates or updates .claudeignore to block irrelevant files (like node_modules, build artifacts) from loading into context, cutting unnecessary context footprint.
  • Large file read guidance: Detects files over 500 lines and prescribes split-read strategies to avoid repeated full-file token costs, and flags burst read patterns for further optimization.
  • Context state management: Guides optimal /clear timing after direction changes and model switching (Haiku for simple tasks, Sonnet for coding, Opus for architecture decisions) to prevent context rot.
  • Hub context auditing: For meta-harness users, audits bloated CLAUDE.md, MEMORY.md and other context files, recommending compression to keep context lean. Use case: A developer working on a long-term project with a large codebase can use this skill to automatically set up .claudeignore, avoid re-reading 1000-line config files repeatedly, and clear context when switching from bug fixing to feature implementation, reducing session token use by up to 60%.

Quick Start

Invoke the context-doctor skill to audit your current Claude Code session for token waste and receive automatic, actionable prescriptions to reduce context bloat and command output.

Frequently Asked Questions about context-doctor

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

FAQPage Schema
How do I reduce Claude Code token waste from large files loading into context?

Reduce Claude Code token waste by auto-generating a .claudeignore file to block irrelevant files, applying split-read strategies for files over 500 lines, and filtering verbose command output to prevent context window flooding.

Why does my Claude Code session slow down and use excessive tokens over time?

Claude Code sessions slow down due to context rot from accumulated session noise, repeated full reads of large files, and bloated project context files like CLAUDE.md, which continuously consume context window capacity without clearing.

When should I use /clear or switch models during a Claude Code coding session?

Use /clear after major direction changes to reset context rot, and switch models based on task complexity: Haiku for simple tasks, Sonnet for coding, and Opus for architecture decisions to optimize session token efficiency.

Can I automatically generate a .claudeignore file for my project?

Yes, you can automatically generate or update a .claudeignore file to block build artifacts and dependency directories like node_modules from loading into context, immediately cutting unnecessary context footprint.

What is the best way to manage context bloat in long-running Claude Code development projects?

Manage context bloat by auditing and compressing context files like MEMORY.md, implementing large file split-read guidance, and timing context clears to eliminate accumulated session noise for long-running projects.

Does context optimization work with meta-harness hub environments?

Yes, context optimization applies to meta-harness hub environments by auditing bloated CLAUDE.md and MEMORY.md files, recommending compression, and optionally integrating with command-output proxy tools for token-scarce environments.