Loading...
Loading...
Best practices for Claude Code performance optimization, context management, storage cleanup, and troubleshooting slowdowns
npx skill4agent add melodic-software/claude-code-plugins performance-optimization| Symptom | Quick Fix | Command |
|---|---|---|
| General slowness | Clean storage | |
| Input lag | Reset context | |
| API errors | Check status | |
| Unknown cause | Full diagnostic | |
| Command | Purpose |
|---|---|
| Analyze storage usage |
| Remove old session files |
| Remove old agent files |
| Comprehensive cleanup |
| Full diagnostic |
| View recent sessions |
| Session statistics |
| API status check |
| Context window analysis |
~/.claude/~/.claude/
├── projects/ # Session history (can grow large!)
│ └── {project-hash}/
│ ├── {session-id}.jsonl # Conversation transcripts
│ └── agent-{id}.jsonl # Subagent transcripts
├── todos/ # Todo state
├── statsig/ # Analytics cache
└── history.jsonl # Command historyprojects/references/storage-management.md| Usage | Status | Action |
|---|---|---|
| < 50% | Healthy | No action |
| 50-75% | Monitor | Consider compacting |
| 75-85% | Warning | Run /compact or /clear |
| > 85% | Critical | Immediate action |
/clear/compact/costreferences/context-management.mdNote: Issue numbers below are point-in-time references and may have been closed, merged, or superseded. For current issues, spawn theagent or queryclaude-code-issue-researcherfor updated tracking.docs-management: "performance issues"
| Issue | Description | Workaround |
|---|---|---|
| #10881 | Performance degrades in long sessions | Restart periodically |
| #14552 | Input lag at high context | Use /clear at 75% |
| #14476 | Regression even at 30k tokens | Update to latest version |
| #1497 | Keyboard responsiveness issues | Restart Claude Code |
references/known-issues.md/check-claude-storage/cleanup-sessions 7Claude Code is slow
│
├─> Check storage: /check-claude-storage
│ └─> If >500MB: /cleanup-sessions 7
│
├─> Check context: /check-context
│ └─> If WARNING+: /clear or /compact
│
├─> Check API: /check-api-status
│ └─> If degraded: Wait or reduce load
│
└─> Full diagnostic: /diagnose-performance
└─> Follow recommendations| Skill | Relationship |
|---|---|
| For official Claude Code documentation |
| For CLAUDE.md optimization |
references/context-management.mdreferences/storage-management.mdreferences/known-issues.md