/run-profiler
Profiles Python code for performance bottlenecks using cProfile, memory_profiler, or py-spy.
$ npx -y skills add athola/claude-night-market --agent claude-codeHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/run-profiler
Context preview
What this command does when you run it.
Profiles Python code for performance bottlenecks using cProfile, memory_profiler, or py-spy.
Command definition
run-profiler.mdRun Profiler Command
Usage
Profiles Python code for performance bottlenecks using cProfile, memory_profiler, or py-spy.
Basic Usage
/run-profiler script.py
Runs CPU profiling on the specified script.
With Options
/run-profiler --memory script.py
/run-profiler --line function_name script.py
What It Does
1. **CPU Profiling**: Identifies time-consuming functions 2. **Memory Profiling**: Tracks memory allocations and leaks 3. **Line Profiling**: Profile specific functions line-by-line 4. **Flamegraph Generation**: Visual representation of call stacks 5. **Recommendations**: Suggests optimization patterns
Profiling Modes
CPU Mode (default)
/run-profiler script.py
Uses cProfile to identify slow functions.
Memory Mode
/run-profiler --memory script.py
Uses memory_profiler to track allocations.
Line Mode
/run-profiler --line expensive_function script.py
Uses line_profiler for detailed analysis.
Production Mode
/run-profiler --pid 12345
Uses py-spy for profiling running processes.
Output Format
- **Top Functions**: Ranked by cumulative time
- **Memory Usage**: Peak and average consumption
- **Hotspots**: Specific lines causing issues
- **Recommendations**: Optimization suggestions
Examples
# Profile with top 20 functions
/run-profiler --top 20 main.py
# Generate flamegraph
/run-profiler --flamegraph output.svg main.py
# Memory profile with threshold
/run-profiler --memory --threshold 100MB main.py
Integration
Uses the `python-performance` skill's profiling tools:
- `profiler-runner`: cProfile and py-spy execution
- `memory-analyzer`: Memory usage analysis
- `benchmark-suite`: Comparative benchmarking
This command helps identify and resolve performance bottlenecks efficiently.
Read more
Run Profiler Command
Usage
Profiles Python code for performance bottlenecks using cProfile, memory_profiler, or py-spy.
Basic Usage
/run-profiler script.py
Runs CPU profiling on the specified script.
With Options
/run-profiler --memory script.py /run-profiler --line function_name script.py
What It Does
1. **CPU Profiling**: Identifies time-consuming functions 2. **Memory Profiling**: Tracks memory allocations and leaks 3. **Line Profiling**: Profile specific functions line-by-line 4. **Flamegraph Generation**: Visual representation of call stacks 5. **Recommendations**: Suggests optimization patterns
Profiling Modes
CPU Mode (default)
/run-profiler script.py
Uses cProfile to identify slow functions.
Memory Mode
/run-profiler --memory script.py
Uses memory_profiler to track allocations.
Line Mode
/run-profiler --line expensive_function script.py
Uses line_profiler for detailed analysis.
Production Mode
/run-profiler --pid 12345
Uses py-spy for profiling running processes.
Output Format
- **Top Functions**: Ranked by cumulative time
- **Memory Usage**: Peak and average consumption
- **Hotspots**: Specific lines causing issues
- **Recommendations**: Optimization suggestions
Examples
# Profile with top 20 functions /run-profiler --top 20 main.py # Generate flamegraph /run-profiler --flamegraph output.svg main.py # Memory profile with threshold /run-profiler --memory --threshold 100MB main.py
Integration
Uses the `python-performance` skill's profiling tools:
- `profiler-runner`: cProfile and py-spy execution
- `memory-analyzer`: Memory usage analysis
- `benchmark-suite`: Comparative benchmarking
This command helps identify and resolve performance bottlenecks efficiently.
A plugin marketplace for Claude Code. Install only the plugins you need to run git workflows, code review, spec-driven development, and autonomous agents from inside your Claude Code session.
Other commands on claude-night-market.
- /aggregate-logs
Generate LEARNINGS.md from skill execution logs.
Open command - /analyze-skill
Analyze skill file complexity metrics and generate modularization recommendations for splitting or progressive loading.
Open command - /bulletproof-skill
Harden skills against rationalization and bypass behaviors
Open command - /context-report
Generate context optimization report for skill directories
Open command - /create-command
Create slash commands with brainstorming and best practices
Open command - /create-hook
Create hooks with brainstorming and security-first design
Open command

