Skip to content

Instantly share code, notes, and snippets.

@theinventor
Created August 14, 2025 18:55
Show Gist options
  • Save theinventor/331c1bd7abf1f01fdbc5b01c50f388a6 to your computer and use it in GitHub Desktop.
Save theinventor/331c1bd7abf1f01fdbc5b01c50f388a6 to your computer and use it in GitHub Desktop.
Claude computer cleaner
> you have full access to this computer, as root. i want you to analyze how this machine is performing, explain everything that runs at boot, and what i can do to improve the
performance of this computer. if you need any additional folders, just ask. you can write any read-only script you want and go ahead and execute it.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>macOS System Performance Analysis Report</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
line-height: 1.6;
color: #333;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1400px;
margin: 0 auto;
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0,0,0,0.15);
overflow: hidden;
}
header {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 40px;
text-align: center;
}
header h1 {
font-size: 2.5em;
margin-bottom: 10px;
font-weight: 300;
}
header .subtitle {
font-size: 1.1em;
opacity: 0.9;
}
.summary-cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
padding: 30px;
background: #f8f9fa;
}
.card {
background: white;
padding: 25px;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.card h3 {
color: #667eea;
margin-bottom: 15px;
font-size: 1.1em;
font-weight: 600;
}
.card .value {
font-size: 2em;
font-weight: bold;
color: #333;
margin-bottom: 5px;
}
.card .label {
color: #666;
font-size: 0.9em;
}
.card.critical {
border-left: 4px solid #e74c3c;
}
.card.warning {
border-left: 4px solid #f39c12;
}
.card.good {
border-left: 4px solid #27ae60;
}
.content {
padding: 40px;
}
.section {
margin-bottom: 50px;
}
.section h2 {
color: #667eea;
margin-bottom: 25px;
padding-bottom: 10px;
border-bottom: 2px solid #f0f0f0;
font-size: 1.8em;
font-weight: 400;
}
.subsection {
margin-bottom: 30px;
}
.subsection h3 {
color: #444;
margin-bottom: 15px;
font-size: 1.3em;
font-weight: 500;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
table th {
background: #f8f9fa;
color: #333;
padding: 12px;
text-align: left;
font-weight: 600;
border-bottom: 2px solid #dee2e6;
}
table td {
padding: 10px 12px;
border-bottom: 1px solid #eee;
}
table tr:hover {
background: #f8f9fa;
}
.progress-bar {
width: 100%;
height: 24px;
background: #e9ecef;
border-radius: 12px;
overflow: hidden;
margin: 10px 0;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, #667eea, #764ba2);
display: flex;
align-items: center;
padding-left: 10px;
color: white;
font-size: 0.85em;
font-weight: 600;
transition: width 0.5s ease;
}
.progress-fill.critical {
background: linear-gradient(90deg, #e74c3c, #c0392b);
}
.progress-fill.warning {
background: linear-gradient(90deg, #f39c12, #e67e22);
}
.alert {
padding: 15px 20px;
border-radius: 8px;
margin: 20px 0;
border-left: 4px solid;
}
.alert.critical {
background: #fee;
border-color: #e74c3c;
color: #721c24;
}
.alert.warning {
background: #fff3cd;
border-color: #f39c12;
color: #856404;
}
.alert.info {
background: #e8f4f9;
border-color: #3498db;
color: #004085;
}
.alert.success {
background: #d4edda;
border-color: #27ae60;
color: #155724;
}
.recommendation-list {
list-style: none;
padding: 0;
}
.recommendation-list li {
padding: 15px;
margin: 10px 0;
background: #f8f9fa;
border-radius: 8px;
border-left: 3px solid #667eea;
transition: all 0.3s;
}
.recommendation-list li:hover {
background: #e8f4f9;
transform: translateX(5px);
}
.recommendation-list li strong {
color: #667eea;
display: block;
margin-bottom: 5px;
}
.priority-high {
border-left-color: #e74c3c !important;
}
.priority-high strong {
color: #e74c3c !important;
}
.priority-medium {
border-left-color: #f39c12 !important;
}
.priority-medium strong {
color: #f39c12 !important;
}
.grid-2 {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
gap: 30px;
}
.metric-row {
display: flex;
justify-content: space-between;
padding: 8px 0;
border-bottom: 1px solid #f0f0f0;
}
.metric-row:last-child {
border-bottom: none;
}
.metric-label {
color: #666;
}
.metric-value {
font-weight: 600;
color: #333;
}
.timestamp {
text-align: center;
color: #666;
padding: 20px;
font-size: 0.9em;
}
@media (max-width: 768px) {
.grid-2 {
grid-template-columns: 1fr;
}
header h1 {
font-size: 1.8em;
}
.content {
padding: 20px;
}
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>macOS System Performance Analysis</h1>
<div class="subtitle">MacBook Pro (M3 Max) - Comprehensive System Report</div>
</header>
<div class="summary-cards">
<div class="card critical">
<h3>Disk Usage</h3>
<div class="value">98%</div>
<div class="label">Critical - Only 43GB free</div>
</div>
<div class="card warning">
<h3>Swap Usage</h3>
<div class="value">89%</div>
<div class="label">11.9GB of 13.3GB used</div>
</div>
<div class="card warning">
<h3>System Uptime</h3>
<div class="value">298 days</div>
<div class="label">Consider restarting</div>
</div>
<div class="card good">
<h3>CPU Cores</h3>
<div class="value">16</div>
<div class="label">12 performance + 4 efficiency</div>
</div>
<div class="card good">
<h3>Memory</h3>
<div class="value">64 GB</div>
<div class="label">Unified memory</div>
</div>
<div class="card warning">
<h3>Load Average</h3>
<div class="value">2.34</div>
<div class="label">Moderate system load</div>
</div>
</div>
<div class="content">
<section class="section">
<h2>⚠️ Critical Issues Identified</h2>
<div class="alert critical">
<strong>Critical: Disk Space Almost Full</strong>
<p>Your main disk is 98% full with only 43GB free. This severely impacts system performance and can cause system instability.</p>
</div>
<div class="alert warning">
<strong>Warning: High Swap Usage</strong>
<p>Swap usage is at 89% (11.9GB of 13.3GB), indicating memory pressure despite having 64GB RAM.</p>
</div>
<div class="alert warning">
<strong>Warning: Extended Uptime</strong>
<p>System has been running for 298 days without restart. This can lead to memory leaks and degraded performance.</p>
</div>
</section>
<section class="section">
<h2>πŸ–₯️ System Information</h2>
<div class="grid-2">
<div class="subsection">
<h3>Hardware</h3>
<div class="metric-row">
<span class="metric-label">Model</span>
<span class="metric-value">MacBook Pro (Mac15,8)</span>
</div>
<div class="metric-row">
<span class="metric-label">Processor</span>
<span class="metric-value">Apple M3 Max</span>
</div>
<div class="metric-row">
<span class="metric-label">CPU Cores</span>
<span class="metric-value">16 cores</span>
</div>
<div class="metric-row">
<span class="metric-label">Memory</span>
<span class="metric-value">64 GB</span>
</div>
<div class="metric-row">
<span class="metric-label">SIP Status</span>
<span class="metric-value">Enabled</span>
</div>
</div>
<div class="subsection">
<h3>Performance Metrics</h3>
<div class="metric-row">
<span class="metric-label">Load Average</span>
<span class="metric-value">2.34, 3.17, 4.63</span>
</div>
<div class="metric-row">
<span class="metric-label">Active Processes</span>
<span class="metric-value">Multiple high-CPU processes</span>
</div>
<div class="metric-row">
<span class="metric-label">Kernel Extensions</span>
<span class="metric-value">265 loaded</span>
</div>
<div class="metric-row">
<span class="metric-label">Thermal State</span>
<span class="metric-value">Normal</span>
</div>
</div>
</div>
</section>
<section class="section">
<h2>πŸš€ Boot Processes Analysis</h2>
<div class="subsection">
<h3>Launch Items Summary</h3>
<table>
<tr>
<th>Type</th>
<th>Count</th>
<th>Notable Items</th>
</tr>
<tr>
<td>System Launch Daemons</td>
<td>401</td>
<td>Standard macOS services</td>
</tr>
<tr>
<td>Third-party Launch Daemons</td>
<td>7</td>
<td>Adobe CC, Docker, Zoom</td>
</tr>
<tr>
<td>System Launch Agents</td>
<td>414</td>
<td>Standard macOS agents</td>
</tr>
<tr>
<td>User Launch Agents</td>
<td>10</td>
<td>Dropbox, Google Updater, Redis</td>
</tr>
<tr>
<td>Login Items</td>
<td>2</td>
<td>CleanShot X, Dropbox</td>
</tr>
</table>
</div>
<div class="alert info">
<strong>Boot Load Analysis</strong>
<p>You have several third-party services starting at boot. Consider disabling unnecessary items to improve startup time.</p>
</div>
</section>
<section class="section">
<h2>πŸ’Ύ Storage Analysis</h2>
<div class="subsection">
<h3>Main Disk Usage</h3>
<div class="progress-bar">
<div class="progress-fill critical" style="width: 98%;">98% Used</div>
</div>
<p>Total: 1.8TB | Used: 1.7TB | Free: 43GB</p>
</div>
<div class="subsection">
<h3>Volume Breakdown</h3>
<table>
<tr>
<th>Volume</th>
<th>Size</th>
<th>Used</th>
<th>Free</th>
<th>Usage</th>
</tr>
<tr>
<td>/System/Volumes/Data</td>
<td>1.8TB</td>
<td>1.7TB</td>
<td>43GB</td>
<td><span style="color: #e74c3c;">98%</span></td>
</tr>
<tr>
<td>iOS Simulator Volumes (Combined)</td>
<td>68GB</td>
<td>66GB</td>
<td>2GB</td>
<td><span style="color: #e74c3c;">97%</span></td>
</tr>
<tr>
<td>Swap</td>
<td>13.3GB</td>
<td>11.9GB</td>
<td>1.4GB</td>
<td><span style="color: #f39c12;">89%</span></td>
</tr>
</table>
</div>
</section>
<section class="section">
<h2>πŸ”„ Process Analysis</h2>
<div class="grid-2">
<div class="subsection">
<h3>Top CPU Consumers</h3>
<table>
<tr>
<th>Process</th>
<th>CPU %</th>
</tr>
<tr>
<td>UserNotificationCenter</td>
<td>26.3%</td>
</tr>
<tr>
<td>WindowServer</td>
<td>23.3%</td>
</tr>
<tr>
<td>Terminal</td>
<td>15.5%</td>
</tr>
<tr>
<td>tccd</td>
<td>15.2%</td>
</tr>
<tr>
<td>CursorUIViewService</td>
<td>14.1%</td>
</tr>
</table>
</div>
<div class="subsection">
<h3>Top Memory Consumers</h3>
<table>
<tr>
<th>Process</th>
<th>Memory %</th>
</tr>
<tr>
<td>next-server</td>
<td>10.4%</td>
</tr>
<tr>
<td>Chrome (Main)</td>
<td>1.2%</td>
</tr>
<tr>
<td>Chrome Renderers (Multiple)</td>
<td>~6% combined</td>
</tr>
<tr>
<td>tsserver</td>
<td>1.0%</td>
</tr>
<tr>
<td>corespotlightd</td>
<td>0.9%</td>
</tr>
</table>
</div>
</div>
</section>
<section class="section">
<h2>πŸ“‹ Performance Improvement Recommendations</h2>
<ul class="recommendation-list">
<li class="priority-high">
<strong>πŸ”΄ URGENT: Free Up Disk Space</strong>
Your disk is critically full (98%). Immediately:
<ul style="margin-top: 10px; margin-left: 20px;">
<li>Clean up ~/Downloads folder</li>
<li>Remove old iOS Simulator volumes (68GB used)</li>
<li>Clear Xcode derived data: <code>rm -rf ~/Library/Developer/Xcode/DerivedData/*</code></li>
<li>Empty Trash completely</li>
<li>Use Storage Management in System Settings to identify large files</li>
<li>Consider using tools like DaisyDisk or GrandPerspective to visualize disk usage</li>
</ul>
</li>
<li class="priority-high">
<strong>πŸ”΄ HIGH: Restart Your Mac</strong>
298 days of uptime is excessive. Restart to:
<ul style="margin-top: 10px; margin-left: 20px;">
<li>Clear memory leaks</li>
<li>Reset swap usage</li>
<li>Reload kernel extensions cleanly</li>
<li>Apply pending system updates</li>
</ul>
</li>
<li class="priority-high">
<strong>πŸ”΄ HIGH: Address Memory Pressure</strong>
Despite 64GB RAM, you have high swap usage. Actions:
<ul style="margin-top: 10px; margin-left: 20px;">
<li>Kill the next-server process using 10.4% memory (6.9GB)</li>
<li>Reduce Chrome tabs (multiple renderer processes consuming ~6% combined)</li>
<li>Check for memory leaks in long-running Node.js processes</li>
<li>Consider increasing swap if disk space allows after cleanup</li>
</ul>
</li>
<li class="priority-medium">
<strong>🟑 MEDIUM: Optimize Boot Items</strong>
Reduce startup load:
<ul style="margin-top: 10px; margin-left: 20px;">
<li>Disable Adobe Creative Cloud if not actively used</li>
<li>Remove Docker from startup if not needed daily</li>
<li>Disable automatic updates for Google and Dropbox</li>
<li>Review and remove unnecessary Login Items</li>
</ul>
</li>
<li class="priority-medium">
<strong>🟑 MEDIUM: Clean Development Environment</strong>
<ul style="margin-top: 10px; margin-left: 20px;">
<li>Remove unused iOS Simulator runtimes: <code>xcrun simctl delete unavailable</code></li>
<li>Clean homebrew: <code>brew cleanup --prune=all</code></li>
<li>Clear npm/yarn cache: <code>npm cache clean --force</code></li>
<li>Remove old node_modules folders</li>
</ul>
</li>
<li class="priority-medium">
<strong>🟑 MEDIUM: Optimize Background Processes</strong>
<ul style="margin-top: 10px; margin-left: 20px;">
<li>UserNotificationCenter using 26% CPU - check for notification spam</li>
<li>WindowServer at 23% - reduce transparency effects in Accessibility settings</li>
<li>Disable visual effects: System Settings > Accessibility > Display</li>
<li>Review Activity Monitor for unnecessary background apps</li>
</ul>
</li>
<li>
<strong>🟒 Maintenance Best Practices</strong>
<ul style="margin-top: 10px; margin-left: 20px;">
<li>Restart weekly to prevent memory accumulation</li>
<li>Keep at least 10% disk space free (180GB for your system)</li>
<li>Run First Aid on disk monthly</li>
<li>Update macOS and apps regularly</li>
<li>Monitor swap usage - it should be minimal with 64GB RAM</li>
</ul>
</li>
</ul>
</section>
<section class="section">
<h2>πŸ› οΈ Quick Fix Commands</h2>
<div class="subsection">
<h3>Copy and run these commands to improve performance:</h3>
<pre style="background: #f8f9fa; padding: 20px; border-radius: 8px; overflow-x: auto;">
# 1. Clean Xcode derived data
rm -rf ~/Library/Developer/Xcode/DerivedData/*
# 2. Clean iOS Simulator data
xcrun simctl delete unavailable
# 3. Clean Homebrew
brew cleanup --prune=all
# 4. Clear DNS cache
sudo dscacheutil -flushcache
# 5. Purge memory (forces clearing of inactive memory)
sudo purge
# 6. Reset SMC (for Intel Macs) or equivalent for Apple Silicon
# Shut down, wait 30 seconds, restart
# 7. Clear Downloads folder (review first!)
# ls -lah ~/Downloads
# 8. Find large files
sudo du -h / 2>/dev/null | grep -E "^[0-9\.]+G" | sort -rh | head -20
# 9. Check what's using swap
sudo lsof | grep -i swap | head -20
# 10. Disable Spotlight for Developer folders (improves performance)
sudo mdutil -i off /Users/$(whoami)/Developer
</pre>
</div>
</section>
<section class="section">
<h2>πŸ“Š Summary</h2>
<div class="alert critical">
<strong>System Health: Critical</strong>
<p>Your system requires immediate attention. The combination of 98% disk usage, high swap usage, and 298-day uptime is severely impacting performance. Follow the high-priority recommendations immediately to restore optimal performance.</p>
</div>
<div class="subsection">
<h3>Action Priority</h3>
<ol style="line-height: 2;">
<li><strong>Immediately:</strong> Free up at least 100GB of disk space</li>
<li><strong>Today:</strong> Restart your Mac after backing up work</li>
<li><strong>This week:</strong> Clean development environments and caches</li>
<li><strong>Ongoing:</strong> Implement regular maintenance schedule</li>
</ol>
</div>
</section>
</div>
<div class="timestamp">
Report generated on August 14, 2025 at 11:41 AM
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment