Runs as part of an automated hook or local workflow; test on a disposable branch before enabling it on write or blocking paths., Review generated reports, file edits, benchmark output, or shell commands before treating hook output as a merge or release gate.
Privacy notes
Hook inputs and reports can include repository paths, markdown content, benchmark results, lint findings, environment details, or CI logs., Redact private URLs, tokens, customer data, and proprietary file contents before publishing hook output.
Author
JSONbored
Claim status
unclaimed
Last verified
2025-09-16
Decision playbook
Review trust signals before you adopt
Signals are present but mixed. Use the checklist below to confirm the source and operational safety for your environment.
Compare context
Selected
0
Current score
78
Baseline
—
Delta
No baseline selected
No major trust-signal divergence detected in the current selection.
Source and provenance checks
Complete
Confirm ownership and provenance before trusting install instructions.
Source link availableRequired
Open the canonical repository and verify ownership.
Done
Source provenance statusRequired
Marked as source-backed.
Done
Metadata reviewed
Registry metadata indicates a reviewed listing.
Done
Safety and privacy checks
Complete
Validate risk disclosures before installation or API wiring.
Safety notes presentRequired
Review the listed safety guidance before running commands.
Done
Privacy notes presentRequired
Review data handling notes before connecting accounts or secrets.
Done
Trust level risk gateRequired
Trust level does not block evaluation.
Done
Package and install checks
Needs review
Check package metadata and artifact integrity signals.
Install payload available
Install or copy payload is available for review.
Done
Package verification flag
No package verification flag provided.
Pending
Checksum metadata
No checksum provided for downloaded artifact.
Pending
Compare-driven decision checks
Needs review
Use compare context to validate trade-offs before adoption.
Compare tray has multiple entries
Add at least one more entry to compare trust differences.
Current risk score 16/100. Use staged verification before broader rollout.
Risk 16
Pre-adoption checks
Validate source and review signals before any execution.
Confirm source provenanceRequired
Source URL/provenance metadata is present.
Done
Confirm metadata review state
Listing has review metadata.
Done
Verify install payload
Install/config payload exists and can be inspected.
Done
Security checks
Confirm safety, privacy, and package integrity signals.
Review safety notesRequired
Safety notes are present.
Done
Review privacy notesRequired
Privacy notes are present.
Done
Verify package integrity metadata
No package verification/checksum metadata.
Pending
Rollout
Adopt in controlled steps based on the selected plan.
Run in isolated sandbox firstRequired
Use a constrained sandbox and observe behavior across multiple tasks.
Pending
Roll out graduallyRequired
Roll out to a small cohort before wider usage.
Pending
Set monitoring and fallback
Define rollback path and monitor errors after adoption.
Pending
Evidence readiness
Evidence readiness matrix · balanced
Required evidence gates are covered (5/6 signals complete).
Risk 15
Source provenance
Present
Source repository/provenance is listed.
Required in this preset
Metadata review
Present
Review metadata is present.
Required in this preset
Safety notes
Present
Safety notes are present.
Required in this preset
Privacy notes
Present
Privacy notes are present.
Optional in this preset
Package integrity
Missing
Package integrity metadata is missing.
Optional in this preset
Install payload
Present
Install payload is available.
Required in this preset
Required evidence gates are covered for this preset.
Decision timeline
Decision timeline · balanced
5/6 steps complete with no blocking gaps for this preset.
Risk 14
triage
Confirm source provenanceRequired
Source/provenance metadata is available.
Done
triage
Check metadata review statusRequired
Review metadata is available.
Done
verify
Review safety notesRequired
Safety notes are available.
Done
verify
Review privacy notes
Privacy notes are available.
Done
verify
Validate package integrity metadata
Package integrity metadata is missing.
Pending
rollout
Verify install payload and commandsRequired
Install payload is available.
Done
No required blockers for this timeline preset.
Safety & privacy surface
Safety & privacy surface
2 safety and 2 privacy notes across 2 risk areas. Review closely: credentials & tokens.
2 areas
SafetyLocal filesRuns as part of an automated hook or local workflow; test on a disposable branch before enabling it on write or blocking paths.
SafetyLocal filesReview generated reports, file edits, benchmark output, or shell commands before treating hook output as a merge or release gate.
PrivacyLocal filesHook inputs and reports can include repository paths, markdown content, benchmark results, lint findings, environment details, or CI logs.
PrivacyCredentials & tokensRedact private URLs, tokens, customer data, and proprietary file contents before publishing hook output.
Safety notes
Runs as part of an automated hook or local workflow; test on a disposable branch before enabling it on write or blocking paths.
Review generated reports, file edits, benchmark output, or shell commands before treating hook output as a merge or release gate.
Privacy notes
Hook inputs and reports can include repository paths, markdown content, benchmark results, lint findings, environment details, or CI logs.
Redact private URLs, tokens, customer data, and proprietary file contents before publishing hook output.
Schema details
Install type
cli
Reading time
4 min
Difficulty score
0
Troubleshooting
Yes
Breaking changes
No
Runtime and command metadata
Trigger
Stop
Script language
bash
Script body
#!/bin/bash
echo "🔍 Performance Monitor - Analyzing system performance..."
echo "📊 Monitoring Areas:"
echo " • Application Performance Metrics"
echo " • Database Performance"
echo " • Frontend Performance (Web Vitals)"
echo " • Infrastructure Monitoring"
if command -v node >/dev/null 2>&1; then
echo "✓ Node.js available for performance profiling"
fi
if command -v lighthouse >/dev/null 2>&1; then
echo "✓ Lighthouse available for web performance"
fi
if command -v artillery >/dev/null 2>&1; then
echo "✓ Artillery available for load testing"
fi
echo "💻 System Performance:"
if command -v free >/dev/null 2>&1; then
mem_usage=$(free | grep Mem | awk '{printf "%.2f", $3/$2 * 100.0}')
echo " Memory Usage: ${mem_usage}%"
fi
disk_usage=$(df / | tail -1 | awk '{print $5}' | sed 's/%//')
echo " Disk Usage: ${disk_usage}%"
echo "💡 Performance Recommendations:"
echo " • Implement response time tracking for API endpoints"
echo " • Set up Web Vitals monitoring for frontend performance"
echo " • Monitor database query performance"
echo " • Set up automated performance testing"
echo "🎯 Performance monitor analysis complete!"
exit 0
Full copyable content
{
"hooks": {
"Stop": [
{
"matchers": [
"*"
],
"description": "Monitor performance metrics and provide optimization insights"
}
]
},
"scriptContent": "#!/bin/bash\n\necho \"🔍 Performance Monitor - Analyzing system performance...\"\n\n# Performance monitoring areas\necho \"📊 Monitoring Areas:\"\necho \" • Application Performance Metrics\"\necho \" • Database Performance\"\necho \" • Frontend Performance (Web Vitals)\"\necho \" • Infrastructure Monitoring\"\necho \" • Automated Performance Testing\"\n\n# Check if performance tools are available\ncommand -v node >/dev/null 2>&1 && echo \"✓ Node.js available for performance profiling\"\ncommand -v lighthouse >/dev/null 2>&1 && echo \"✓ Lighthouse available for web performance\"\ncommand -v artillery >/dev/null 2>&1 && echo \"✓ Artillery available for load testing\"\n\n# System performance check\necho \"\"\necho \"💻 System Performance:\"\n\n# Memory usage\nif command -v free >/dev/null 2>&1; then\n mem_usage=$(free | grep Mem | awk '{printf \"%.2f\", $3/$2 * 100.0}')\n echo \" Memory Usage: ${mem_usage}%\"\n if (( $(echo \"$mem_usage > 85\" | bc -l) 2>/dev/null )); then\n echo \" 🚨 High memory usage detected!\"\n fi\nfi\n\n# Disk usage\ndisk_usage=$(df / | tail -1 | awk '{print $5}' | sed 's/%//')\necho \" Disk Usage: ${disk_usage}%\"\nif (( disk_usage > 90 )); then\n echo \" 🚨 High disk usage detected!\"\nfi\n\n# Load average\nif command -v uptime >/dev/null 2>&1; then\n load_avg=$(uptime | awk -F'load average:' '{print $2}' | awk '{print $1}' | sed 's/,//')\n echo \" Load Average: $load_avg\"\nfi\n\n# Performance monitoring recommendations\necho \"\"\necho \"💡 Performance Recommendations:\"\necho \" • Implement response time tracking for API endpoints\"\necho \" • Set up Web Vitals monitoring for frontend performance\"\necho \" • Monitor database query performance\"\necho \" • Set up automated performance testing\"\necho \" • Configure performance alerts and thresholds\"\necho \" • Use profiling tools for bottleneck identification\"\necho \" • Implement performance budgets for builds\"\n\necho \"\"\necho \"📋 Next Steps:\"\necho \" 1. Set up performance monitoring dashboards\"\necho \" 2. Configure performance alerts\"\necho \" 3. Implement automated performance testing\"\necho \" 4. Review and optimize identified bottlenecks\"\n\necho \"\"\necho \"🎯 Performance monitor analysis complete!\"\necho \"📊 Use monitoring data to drive optimization decisions\"\n\nexit 0"
}
About this resource
Features
Application performance tracking including API response time tracking (endpoint response time measurement with millisecond precision, slow endpoint identification with threshold-based filtering, response time statistics with percentile analysis P50/P95/P99, average response time calculation), memory usage monitoring (memory consumption tracking with real-time monitoring, memory leak detection with growth pattern analysis, memory growth analysis with trend tracking), CPU usage monitoring (CPU utilization tracking with core-specific analysis, CPU bottleneck identification with process-specific tracking, process-specific CPU analysis with resource attribution), and application performance metrics (request throughput measurement, error rates tracking, latency percentiles with statistical analysis)
Database query optimization including query performance analysis (slow query detection with threshold-based filtering and configurable thresholds, query execution time measurement with millisecond precision, query plan analysis with EXPLAIN integration), index recommendations (missing index detection with WHERE clause analysis, index usage analysis with index utilization tracking, index optimization suggestions with index creation recommendations), query optimization suggestions (query rewriting recommendations for better performance, batch query suggestions for N+1 query prevention, N+1 query detection with loop and query pattern matching), and database performance metrics (connection pool metrics monitoring, transaction metrics tracking, query cache metrics analysis)
Frontend performance monitoring including Web Vitals tracking (Largest Contentful Paint LCP measurement with real-time tracking, First Input Delay FID measurement with interaction latency analysis, Cumulative Layout Shift CLS measurement with layout stability tracking, First Contentful Paint FCP measurement with initial render tracking, Time to Interactive TTI measurement with interactivity analysis), render blocking resource detection (CSS blocking resources with @import and detection, JavaScript blocking resources with
Show that Performance Monitor - Hooks is listed on HeyClaude. Paste this Markdown into your README — it renders the badge and links back to this page.
[](https://heyclau.de/entry/hooks/performance-monitor)
How it compares
Performance Monitor - Hooks side by side with 3 alternatives on trust, install, platform support, and disclosed safety notes — all from reviewed registry metadata.
Next steps differ across entries — use the actions in the table below to copy install commands and source links per resource.
Alerts when files exceed size thresholds that could impact performance. This PostToolUse hook provides comprehensive file size monitoring when files are created or modified, automatically detecting files that exceed recommended size thresholds for different file types and providing optimization suggestions.
A PostToolUse hook that reminds you to enable native query logging for PostgreSQL, Prisma, Sequelize, and TypeORM, and flags possible N+1 patterns when you edit SQL or data-access files.
✓Runs as part of an automated hook or local workflow; test on a disposable branch before enabling it on write or blocking paths.
Review generated reports, file edits, benchmark output, or shell commands before treating hook output as a merge or release gate.
✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling.
✓Runs automatically after bash, write, or edit activity and inspects files that look like query, model, repository, DAO, or SQL files.
Creates .claude/logs/query-performance.log and appends database command or file-analysis events.
Uses grep-based heuristics for query warnings and should not be treated as proof of a performance defect.
✓Runs automatically on its configured Claude Code hook event and executes shell logic that can read, modify, or delete files in your project (and may run builds, installs, or network calls); review the script and scope it to expected paths before enabling.
Privacy notes
✓Hook inputs and reports can include repository paths, markdown content, benchmark results, lint findings, environment details, or CI logs.
Redact private URLs, tokens, customer data, and proprietary file contents before publishing hook output.
✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output.
✓Reads query-related source files and may print file paths, query patterns, and database command strings to local hook output.
Stores analyzed file paths and database command text in .claude/logs/query-performance.log.
Database command text may include connection names, database names, or other operational details if typed directly into the command.
✓Receives Claude Code hook input (session metadata, file paths, and tool output) and reads local project files; review what the script logs or forwards to external services and keep credentials out of its output.