Skill: Archive Orphaned Attachments
SkillDev toolsCommand: /archive-attachments [--dry-run] Model: 🟢 Haiku Agent: None (direct execution)
Available today. Use it from your connected AI after setup.
No other account needed.
Connect ahel once, and every AI you use reads what you have installed.
Then ask your AI: use the Skill: Archive Orphaned Attachments skill
About this capability
A comprehensive knowledge management system for Solutions Architects using AI
What this skill tells your AI
The instructions your AI receives, as published by davidroliverba/architectkb in .claude/skills/archive-attachments/SKILL.md and read by ahel’s review.
Command: /archive-attachments [--dry-run]
Model: 🟢 Haiku
Agent: None (direct execution)
Purpose
Find and archive attachments that are not referenced in any vault note. Orphaned attachments waste storage and clutter the vault without adding value.
When to Use
- During quarterly vault maintenance
- After bulk PDF/PPTX conversions that leave unreferenced files
- When Attachments folder grows unexpectedly
- Before committing large changes to reduce repo size
Usage
# Preview what would be archived (recommended first step)
/archive-attachments --dry-run
# Archive orphaned files
/archive-attachments
What It Does
- Scans all markdown and canvas files for attachment references
- Identifies orphaned files in
Attachments/not referenced anywhere - Moves orphans to
Archive/Attachments/preserving folder structure - Updates manifest at
Archive/Attachments/archive-manifest.json
Protected Files
These files are never archived:
.gitkeep.DS_StoreREADME.md
Output
The script reports:
- Total orphaned files and size
- Breakdown by file type
- Files moved (or would move in dry-run)
Implementation
Run the Python script:
python3 .claude/scripts/archive-orphan-attachments.py [--dry-run] [--verbose]
Flags
| Flag | Description |
|---|---|
--dry-run | Show what would be archived without moving files |
--verbose | Show detailed file list |
Manifest Format
The manifest tracks all archive operations:
{
"created": "2026-02-01T08:26:26",
"last_updated": "2026-02-01T08:26:26",
"archives": [
{
"date": "2026-02-01T08:26:26",
"files_moved": 1176,
"total_bytes": 826369700,
"files": [
{
"filename": "example.png",
"original_path": "subfolder/example.png",
"size_bytes": 12345
}
]
}
]
}
Restoring Files
If a file was archived by mistake:
- Check the manifest for the original path
- Move the file back from
Archive/Attachments/toAttachments/ - The next run will skip it if it's now referenced
Related
/vault-maintenance- Full quarterly health check/quality-report- Comprehensive vault metricsnpm run health- Quick health check
Signals
- GitHub stars
- 52
- Forks
- 12
- Last commit
- Mar 2026
Advanced
- Catalog kind
- skill
- Gateway key
archive-attachments- Source
- github.com/davidroliverba/architectkb