claude-context-doctor
v0.1.4
Published
Analyze and optimize your Claude Code settings. Reduce context token usage by splitting large CLAUDE.md imports into Skills/Hooks.
Maintainers
Readme
Claude Context Doctor
Claude Code 설정을 분석하고 컨텍스트 토큰 사용량을 최적화하는 CLI 도구입니다.
Analyze and optimize your Claude Code settings. Reduce context token usage by splitting large CLAUDE.md imports into Skills/Hooks.
Features
- Context Analysis: Scan CLAUDE.md, MCP servers, plugins, and hooks. Calculate token usage per file.
- Optimization Recommendations: Suggest splitting large imports into on-demand Skills or event-driven Hooks.
- Project Setup: Auto-detect tech stack and generate custom CLAUDE.md, Skills, and Hooks using your existing Claude Code subscription.
- Safe by Design: All changes require user approval. Automatic backup with one-command rollback.
- Zero Dependencies: No external packages. Works with Node.js 18+.
Install
npm install -g claude-context-doctorOr run without installing:
npx claude-context-doctorUsage
Analyze & Optimize
ccdScans your Claude Code configuration and suggests optimizations:
━━━ 분석 결과 ━━━
글로벌 설정 (~/.claude/)
CLAUDE.md: 309 tokens
Import 파일: 20개
전체 로드 크기: 22,269 tokens
HIGH RULES.md: 3,475 tokens [███░░░░░░░░░░░░░░░░░]
HIGH MODE_Business_Panel.md: 2,937 tokens [███░░░░░░░░░░░░░░░░░]
...
━━━ 최적화 제안 ━━━
총 10개 제안 | 예상 절감: 16,633 tokensProject Setup
ccd setupAuto-detects your project's tech stack and generates:
- Custom
CLAUDE.mdwith project conventions - Tailored Skills for repetitive workflows
- Hooks for automated quality checks
Supports: JavaScript/TypeScript, Python, Go, Java/Kotlin, React, Next.js, Vue, Angular, Django, FastAPI, Spring Boot, and more.
Rollback
ccd rollback # List available backups
ccd rollback <id> # Restore a specific backupOptions
ccd --project-dir <path> # Specify project directory
ccd help # Show help
ccd version # Show versionHow It Works
- Scan: Reads
~/.claude/and.claude/directories - Analyze: Estimates token count for each loaded file
- Recommend: Identifies files that can be moved to Skills (on-demand) or Hooks (event-driven)
- Apply: With your approval, helps reorganize settings for lower context usage
- Backup: Every change is backed up automatically for easy rollback
Requirements
- Node.js 18+
- Claude Code CLI installed (
claudecommand available) - Active Claude Code subscription (for
setupfeatures)
Safety
- All changes require explicit user approval
- Automatic backup before any modification
- One-command rollback:
ccd rollback - Read-only analysis by default
- No external API calls (uses your local Claude CLI)
- Zero dependencies = zero supply chain risk
License
MIT
