スキル一覧に戻る
melodic-software

performance-optimization

by melodic-software

12🍴 2📅 2026年1月20日
GitHubで見るManusで実行

SKILL.md


name: performance-optimization description: Best practices for Claude Code performance optimization, context management, storage cleanup, and troubleshooting slowdowns allowed-tools: Read, Bash, Glob, Grep

Performance Optimization Skill

Comprehensive guidance for optimizing Claude Code performance. This skill covers storage management, context window optimization, and troubleshooting common performance issues.

When to Use This Skill

Keywords: slow, performance, lag, storage, cleanup, cache, context, compact, clear, sessions, agents, bloat, optimization, speed

Use this skill when:

  • Claude Code is running slowly
  • Storage is accumulating
  • Context window is getting full
  • Planning performance maintenance
  • Learning best practices for efficient usage

Quick Reference

Immediate Actions for Slowdowns

SymptomQuick FixCommand
General slownessClean storage/cleanup-sessions 7
Input lagReset context/clear
API errorsCheck status/check-api-status
Unknown causeFull diagnostic/diagnose-performance

Performance Commands

CommandPurpose
/check-claude-storageAnalyze storage usage
/cleanup-sessions [days]Remove old session files
/cleanup-agents [days]Remove old agent files
/prune-cache [days]Comprehensive cleanup
/diagnose-performanceFull diagnostic
/list-sessionsView recent sessions
/session-statsSession statistics
/check-api-statusAPI status check
/check-contextContext window analysis

Core Concepts

1. Storage Management

Claude Code stores conversation history in ~/.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 history

Key insight: The projects/ folder grows indefinitely with usage. Heavy users can accumulate 1GB+ of session data.

See: references/storage-management.md for detailed guidance.

2. Context Window Management

Claude Code uses a 200K token context window. Performance degrades as it fills:

UsageStatusAction
< 50%HealthyNo action
50-75%MonitorConsider compacting
75-85%WarningRun /compact or /clear
> 85%CriticalImmediate action

Key commands:

  • /clear - Complete context reset
  • /compact - Intelligent summarization
  • /cost - View token usage

See: references/context-management.md for detailed guidance.

3. Known Issues

Several GitHub issues document known performance problems:

Note: Issue numbers below are point-in-time references and may have been closed, merged, or superseded. For current issues, spawn the claude-code-issue-researcher agent or query docs-management: "performance issues" for updated tracking.

IssueDescriptionWorkaround
#10881Performance degrades in long sessionsRestart periodically
#14552Input lag at high contextUse /clear at 75%
#14476Regression even at 30k tokensUpdate to latest version
#1497Keyboard responsiveness issuesRestart Claude Code

See: references/known-issues.md for detailed tracking.

Best Practices

Daily Maintenance

  1. Start fresh when possible - New session = fresh context
  2. Use /clear between major tasks - Don't let context rot
  3. Monitor storage periodically - Run /check-claude-storage weekly

Heavy Usage Patterns

  1. Use subagents for large operations - Isolates context bloat
  2. Break large tasks into sessions - Smaller = faster
  3. Clean storage weekly - /cleanup-sessions 7

Performance Optimization

  1. Keep CLAUDE.md lean - Large memory files slow startup
  2. Use progressive disclosure - Load context on-demand
  3. Prefer focused queries - Specific > broad

Troubleshooting Flowchart

Claude 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
SkillRelationship
docs-managementFor official Claude Code documentation
memory-managementFor CLAUDE.md optimization

References

Load these for detailed guidance:

  • references/context-management.md - Context window optimization
  • references/storage-management.md - Storage cleanup strategies
  • references/known-issues.md - GitHub issues and workarounds

Version History

  • v1.0.0 (2025-12-26): Initial release
    • Core performance guidance
    • Command reference
    • Best practices
    • Reference documents

Last Updated

Date: 2025-12-26 Model: claude-opus-4-5-20251101

スコア

総合スコア

60/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です