Archival
Archive old database records with automated retention policies and cold
- Type
- Slash Command
- Repository
- jeremylongshore/tons-of-skills-marketplace
- GitHub stars
- 2.8k
- License
- MIT
- Repo last updated
- Sep 27, 2026
What Archival is
Archival 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.
Archival gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install Archival
Claude Code
- Download archival.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/database/database-archival-system/commands/archival.md, shared under the repository's MIT license. Read the full file on GitHub.
Implement production-ready data archival strategies for PostgreSQL and MySQL that move historical records to archive tables or cold storage (S3, Azure Blob, GCS) with automated retention policies, compression, compliance tracking, and zero-downtime migration. Reduce primary database size by 50-90% while maintaining query access to archived data.
When to Use This Command
Use /archival when you need to:
- Reduce primary database size by archiving historical records (2+ years old)
- Meet compliance requirements (GDPR, HIPAA) for data retention policies
- Improve query performance on hot tables by removing cold data
- Move infrequently accessed data to cost-effective cold storage (S3)
- Implement tiered storage strategy (hot → warm → cold → deleted)
- Maintain audit trail for archived and deleted records
DON'T use this when:
- You need real-time access to all historical data (denormalize instead)
- Data volume is small (<10GB) and performance is acceptable
- Records are frequently updated (archival is for immutable historical data)
- Compliance requires online access to all data (use read replicas instead)
- You lack backup/restore strategy (test archival process first)
Design Decisions
This command implements automated tiered archival because:
- Separates hot (active) data from cold (historical) data for performance
- Reduces storage costs by moving old data to S3 (1/10th database cost)
- Maintains compliance with automated retention and deletion policies
- Enables point-in-time restore of archived data independent of production
- Provides audit trail for all archival and deletion operations
Alternative considered: Database partitioning only
- Faster queries on partitioned tables (no cross-database joins)
- Simpler backup/restore (single database)
- Still incurs full database storage costs
- Recommended when query performance is primary concern
Alternative considered: Soft deletes (deleted_at flag)
- Simplest implementation (no data movement)
- Maintains referential integrity automatically
- Database size continues growing indefinitely
- Recommended for small datasets with regulatory holds
Prerequisites
Before running this command:
- Database backup strategy with tested restore procedures
- Compliance requirements documented (retention periods, deletion policies)
- Storage destination configured (archive database, S3 bucket, or both)
- Monitoring for archival job success/failure and storage metrics
- Testing environment to validate archival process before production
Implementation Process
Step 1: Analyze Table Growth and Identify Archival Candidates
Query table sizes, row counts, and date distribution to identify hot vs cold data.
Step 2: Design Archival Strategy
Choose archive tables, cold storage, or hybrid approach based on access patterns.
Step 3: Implement Archival Automation
Create jobs to move data in batches with transaction safety and error handling.
Step 4: Validate Data Integrity
Compare row counts, checksums, and sample records between source and archive.
Step 5: Monitor and Optimize
Track archival job performance, storage savings, and query latency improvements.
Output Format
The command generates:
- archival/schema.sql - Archive table definitions with identical structure
- archival/archive_job.py - Python script for automated batch archival
- archival/cold_storage_export.py - S3/GCS export with Parquet compression
- archival/retention_policy.sql - SQL procedures for automated deletion
- archival/monitoring_dashboard.json - Grafana dashboard for archival metrics
Code Examples
Example 1: PostgreSQL Automated Archival with Transaction Safety
#!/usr/bin/env python3
"""
Production-ready PostgreSQL archival system with batch processing,
transaction safety, and comprehensive error handling.
"""
import psycopg2
from psycopg2.extras import RealDictCursor
from datetime import datetime, timedelta
from typing import Dict, List, Optional
import logging
import time
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)
… 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 Archival?
Archival is a slash command for Claude Code and Claude Cowork from the jeremylongshore/tons-of-skills-marketplace repository on GitHub. Archive old database records with automated retention policies and cold
How do I install Archival in Claude Code?
Download archival.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 Archival 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 Archival 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
- Api Versioning Manager Manage API versions with migration strategies and backward compatibility Plugin · jeremylongshore/tons-of-skills-marketplace
- Apify Pack Claude Code skill pack for Apify (18 skills) Plugin · jeremylongshore/tons-of-skills-marketplace
- Api Throttling Manager Manage API throttling with dynamic rate limits and quota management Plugin · jeremylongshore/tons-of-skills-marketplace
- Appfolio Pack Claude Code skill pack for AppFolio (18 skills) Plugin · jeremylongshore/tons-of-skills-marketplace
- Audit Codebase PM-focused codebase exploration and capability mapping Slash Command · jeremylongshore/tons-of-skills-marketplace
- Api Security Audit Comprehensive security audit for REST and GraphQL APIs Slash Command · jeremylongshore/tons-of-skills-marketplace
- Audit Report Generate comprehensive security audit report Slash Command · jeremylongshore/tons-of-skills-marketplace
- Ansible Playbook Create Ansible playbooks for configuration management Slash Command · jeremylongshore/tons-of-skills-marketplace