Incident P0 Disk Full
Emergency response for SOP-203 P0 - Disk Space Emergency
- Type
- Slash Command
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
- Model
- sonnet
What Incident P0 Disk Full is
Incident P0 Disk Full is a slash command published in the jeremylongshore/tons-of-skills-marketplace repository on GitHub, which has about 2.8k stars. The repository describes itself as: “Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com.”
A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.
Incident P0 Disk Full gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install Incident P0 Disk Full
Claude Code
- Download incident-p0-disk-full.md from the repository.
- Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
- Run it by typing / followed by its name.
Claude Cowork
- Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
- In Customize → Skills, click +, then upload the ZIP.
- Run it from any task with / and the skill name.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/community/fairdb-ops-manager/commands/incident-p0-disk-full.md, shared under the repository's MIT license. Read the full file on GitHub.
🚨 CRITICAL: Disk Space at 100% or >95%
You are responding to a disk space emergency that threatens database operations.
Severity: P0 - CRITICAL
- Impact: Database writes failing, potential data loss
- Response Time: IMMEDIATE
- Resolution Target: <30 minutes
IMMEDIATE DANGER SIGNS
If disk is at 100%:
- ❌ PostgreSQL cannot write data
- ❌ WAL files cannot be created
- ❌ Transactions will fail
- ❌ Database may crash
- ❌ Backups will fail
Act NOW to free space!
RAPID ASSESSMENT
1. Check Current Usage
# Overall disk usage
df -h
# PostgreSQL data directory
du -sh /var/lib/postgresql/16/main
# Find largest directories
du -sh /var/lib/postgresql/16/main/* | sort -rh | head -10
# Find largest files
find /var/lib/postgresql/16/main -type f -size +100M -exec ls -lh {} \; | sort -k5 -rh | head -202. Identify Culprits
# Check log sizes
du -sh /var/log/postgresql/
# Check WAL directory
du -sh /var/lib/postgresql/16/main/pg_wal/
ls -lh /var/lib/postgresql/16/main/pg_wal/ | wc -l
# Check for temp files
du -sh /tmp/
find /tmp -type f -size +10M -ls
# Database sizes
sudo -u postgres psql -c "
SELECT
datname,
pg_size_pretty(pg_database_size(datname)) AS size,
pg_database_size(datname) AS size_bytes
FROM pg_database
…EMERGENCY SPACE RECOVERY
Priority 1: Clear Old Logs (SAFEST)
# PostgreSQL logs older than 7 days
sudo find /var/log/postgresql/ -name "*.log" -mtime +7 -delete
# Compress recent logs
sudo gzip /var/log/postgresql/*.log
# Clear syslog/journal
sudo journalctl --vacuum-time=7d
# Check space recovered
df -hExpected recovery: 1-5 GB
Priority 2: Archive Old WAL Files
⚠️ ONLY if you have confirmed backups!
# Check WAL retention settings
sudo -u postgres psql -c "SHOW wal_keep_size;"
# List old WAL files
ls -lh /var/lib/postgresql/16/main/pg_wal/ | tail -50
# Archive WAL files (pgBackRest will help)
sudo -u postgres pgbackrest --stanza=main --type=full backup
# Clean archived WALs (CAREFUL!)
sudo -u postgres pg_archivecleanup /var/lib/postgresql/16/main/pg_wal \
$(ls /var/lib/postgresql/16/main/pg_wal/ | grep -v '\.history' | head -1)
# Check space
df -hExpected recovery: 5-20 GB
Priority 3: Vacuum Databases
# Quick vacuum (recovers space within tables)
sudo -u postgres vacuumdb --all --analyze
# Check largest tables
sudo -u postgres psql -c "
SELECT
schemaname,
tablename,
pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) AS size
FROM pg_tables
WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC
LIMIT 10;"
# Full vacuum on bloated tables (SLOW, locks table)
sudo -u postgres psql -d [database] -c "VACUUM FULL [table_name];"
# Check space
…Expected recovery: Variable, depends on bloat
Priority 4: Remove Temp Files
# Clear PostgreSQL temp files
sudo rm -rf /var/lib/postgresql/16/main/pgsql_tmp/*
# Clear system temp
sudo rm -rf /tmp/*
# Clear old backups (if local copies exist)
ls -lh /opt/fairdb/backups/
# Delete old local backups if remote backups are confirmed
df -hPriority 5: Drop Old/Unused Databases (DANGER!)
⚠️ ONLY with customer approval!
# List databases and last access
sudo -u postgres psql -c "
SELECT
datname,
pg_size_pretty(pg_database_size(datname)) AS size,
(SELECT max(query_start) FROM pg_stat_activity WHERE datname = d.datname) AS last_activity
FROM pg_database d
WHERE datname NOT IN ('template0', 'template1', 'postgres')
ORDER BY pg_database_size(datname) DESC;"
# Identify inactive databases (last_activity is NULL or very old)
# BEFORE DROPPING: Backup!
sudo -u postgres pg_dump [database_name] | gzip > /opt/fairdb/backups/emergency-backup-[database_name].sql.gz
# Drop database (IRREVERSIBLE!)
sudo -u postgres psql -c "DROP DATABASE [database_name];"LONG-TERM SOLUTIONS
Option 1: Increase Disk Size
Contabo/VPS Provider:
- Log into provider control panel
- Upgrade storage plan
- Resize disk partition
- Expand filesystem
# After resize, expand filesystem
sudo resize2fs /dev/sda1 # Adjust device as needed
# Verify
df -h Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Incident P0 Disk Full?
Incident P0 Disk Full is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Emergency response for SOP-203 P0 - Disk Space Emergency
How do I install Incident P0 Disk Full in Claude Code?
Download incident-p0-disk-full.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.
Can I use Incident P0 Disk Full in Claude Cowork?
Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.
Is Incident P0 Disk Full safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Reviewer Scores codebase health by combining cyclomatic complexity, git churn, and test coverage metrics, then ranks refactoring candidates by business impact. Use when prioritizing technical debt or planning a refactor sprint. Trigger with "analyze code health", "what should I refactor". Subagent · jeremylongshore/tons-of-skills-marketplace
- Run Integration Run integration test suites with proper setup and teardown Slash Command · jeremylongshore/tons-of-skills-marketplace
- Salesloft Pack Production Salesloft operator workflows for authentication, cadences, synchronization, rate control, webhooks, security, deployment, and incident evidence Plugin · jeremylongshore/tons-of-skills-marketplace
- Sample Writes runnable code samples and tutorials that get developers to first success fast — real values, error handling, expected output, language parity. Use when creating or reviewing API examples and quickstarts. Trigger with \"write a code sample\", \"create a quickstart guide\". Subagent · jeremylongshore/tons-of-skills-marketplace
- Index Advisor Analyze query patterns and recommend optimal database indexes Slash Command · jeremylongshore/tons-of-skills-marketplace
- Incident P0 Database Down Emergency response procedure for SOP-201 P0 - Database Down (Critical) Slash Command · jeremylongshore/tons-of-skills-marketplace
- Init Genkit Project Initialize a new Firebase Genkit project with best practices, proper Slash Command · jeremylongshore/tons-of-skills-marketplace
- Implement Error Handling Implement standardized API error handling Slash Command · jeremylongshore/tons-of-skills-marketplace