Measurement approaches, profiling tools, optimization patterns, and capacity planning. Use when diagnosing performance issues, establishing baselines, identifying bottlenecks, or planning for scale. Always measure before optimizing.
/plugin marketplace add rsmdt/the-startup/plugin install team@the-startupThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/profiling-tools.mdNever optimize based on assumptions. Follow this order:
Profile at the right level to find the actual bottleneck:
Application Level
|-- Request/Response timing
|-- Function/Method profiling
|-- Memory allocation tracking
|
System Level
|-- CPU utilization per process
|-- Memory usage patterns
|-- I/O wait times
|-- Network latency
|
Infrastructure Level
|-- Database query performance
|-- Cache hit rates
|-- External service latency
|-- Resource saturation
Identify what code consumes CPU time:
Key metrics:
Track allocation patterns and detect leaks:
Key metrics:
Measure disk and network operations:
Key metrics:
For each resource, check:
For services, measure:
| Pattern | Symptoms | Typical Causes |
|---|---|---|
| CPU-bound | High CPU, low I/O wait | Inefficient algorithms, tight loops |
| Memory-bound | High memory, GC pressure | Memory leaks, large allocations |
| I/O-bound | Low CPU, high I/O wait | Slow queries, network latency |
| Lock contention | Low CPU, high wait time | Synchronization, connection pools |
| N+1 queries | Many small DB queries | Missing joins, lazy loading |
Optimization impact is limited by the fraction of time affected:
If 90% of time is in function A and 10% in function B:
- Optimizing A by 50% = 45% total improvement
- Optimizing B by 50% = 5% total improvement
Focus on the biggest contributors first.
Measure current capacity under production load:
| Metric | What It Tells You |
|---|---|
| Throughput at saturation | Maximum system capacity |
| Latency at 80% load | Performance before degradation |
| Error rate under stress | Failure patterns |
| Recovery time | How quickly system returns to normal |
Required Capacity = (Current Load x Growth Factor) + Safety Margin
Example:
- Current: 1000 req/sec
- Expected growth: 50% per year
- Safety margin: 30%
Year 1 need = (1000 x 1.5) x 1.3 = 1950 req/sec
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.