backblaze-labs/claude-skill-b2-cloud-storage / skills/b2-cloud-storage
b2-cloud-storage
VerifiedManage Backblaze B2 cloud storage. List files, audit usage, estimate cost, clean up stale data, review security posture, and manage lifecycle rules. Use when the user mentions B2, Backblaze, object storage buckets, or storage cleanup.
| File | Kind | Size |
|---|---|---|
| .claude-plugin/plugin.json | config | 573 B |
| SKILL.md | skill md | 4.7 KB |
| b2-config.example.json | config | 95 B |
| references/b2-cli-reference.md | markdown | 2.7 KB |
| references/cleanup-playbook.md | markdown | 2.6 KB |
| references/security-review.md | markdown | 3.0 KB |
| references/setup.md | markdown | 3.6 KB |
| scripts/storage_audit.pyexecutable | script | 12.7 KB |
references/cleanup-playbook.md
View on GitHub# B2 Cleanup Playbook
Destructive operations. Never skip the dry-run step.
## Procedure
1. **Identify what to delete.** Typically this follows an audit (`python scripts/storage_audit.py <bucket>`) that surfaced stale files, old versions, unfinished uploads, or duplicates.
2. **Run a dry-run first.** This lists what *would* be deleted without deleting anything:
```bash
b2 rm -r --dry-run b2://<bucket>/<prefix>
```
3. **Show the output to the user.** Summarize: count, total size, any surprises.
4. **Ask for explicit "yes" confirmation.** Not "sure?" or "sounds good" — the user must type "yes". If they say anything else, abort.
5. **Execute the real deletion.**
```bash
b2 rm -r b2://<bucket>/<prefix>
```
6. **Verify.** Re-run `b2 ls` or the audit to confirm the expected state.
## Cleaning up specific categories
### Unfinished large files (common source of surprise bills)
```bash
b2 file large unfinished list <bucket> # preview
b2 file large unfinished cancel <bucket> # cancels all unfinished for that bucket
```
Individual unfinished files can be cancelled by fileId:
```bash
b2 file large unfinished cancel --file-id <fileId>
```
### Old versions
By default, B2 keeps every version. To remove old versions of a specific file:
```bash
b2 ls --versions b2://<bucket>/<path> # see all versions
b2 rm b2id://<oldFileId> # delete a specific version
```
For bucket-wide version cleanup, a lifecycle rule is usually the right tool (see below).
### Hidden files
`b2 file hide` creates a hide marker — the underlying bytes still exist and are billed until the hide marker is also deleted or a lifecycle rule removes them.
```bash
b2 ls --versions b2://<bucket> | grep hide # find hide markers
```
### Using lifecycle rules instead of ad-hoc deletes
For repeatable cleanup (e.g. "delete anything in logs/ older than 90 days"), a lifecycle rule is more durable than running `b2 rm` on a schedule:
```bash
b2 bucket update --lifecycle-rules \
'[{"daysFromHidingToDeleting":1,"daysFromUploadingToHiding":90,"fileNamePrefix":"logs/"}]' \
<bucket> allPrivate
```
Verify with `b2 bucket get <bucket>`.
## Bucket deletion
```bash
b2 bucket delete <bucket>
```
Fails if the bucket is not empty. To empty it first:
```bash
b2 rm -r --dry-run b2://<bucket>/ # preview ALL contents
b2 rm -r b2://<bucket>/ # empty it
b2 bucket delete <bucket>
```
Confirm twice for bucket deletion — it's irreversible and frees the bucket name for anyone else globally.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |