Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Checkpoint state before risky operations, detect anomalies, and recover gracefully
.claude/skills/yogsoth-ai-checkpoint-and-recover/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -23% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 14% | 0% |
| case-07 | ✗→✓ | ▲ Improved | -4% | 0% |
| case-10 | ✗→✓ | ▲ Improved | -10% | 0% |
| case-11 | ✗→✓ | ▲ Improved | -4% | 0% |
pseudocodeFUNCTION checkpoint_and_recover(task, execute_fn): // Pre-execution checkpoint checkpoint = { timestamp: now(), task_id: task.id, state: capture_current_state(), files_modified: [], outputs_produced: [] } save_checkpoint(checkpoint) TRY: // Execute with monitoring monitor = SPAWN execution-monitoring(task) result = execute_fn(task) // Post-execution validation IF monitor.anomalies_detected: RAISE AnomalyError(monitor.anomalies) END // Validate result integrity validated = SPAWN result-collection(result, task.success_criterion) IF validated.complete AND validated.consistent: // Success — archive checkpoint (keep for audit trail) archive_checkpoint(checkpoint) RETURN {status: DONE, result: validated} ELSE: // Partial success — decide whether to keep or rollback IF validated.partial_value > threshold: archive_checkpoint(checkpoint) RETURN {status: PARTIAL, result: validated, missing: validated.gaps} ELSE: restore_state(checkpoint) RETURN {status: ROLLED_BACK, reason: validated.failure_reason} END END CATCH error: // Failure — diagnose and recover diagnosis = diagnose_failure(error, checkpoint, task) SWITCH diagnosis.severity: CASE TRANSIENT: // Retry without rollback (e.g., network timeout) RETURN {status: RETRY, reason: diagnosis} CASE CORRUPTING: // Rollback to checkpoint restore_state(checkpoint) RETURN {status: ROLLED_BACK, reason: diagnosis} CASE FATAL: // Rollback and escalate restore_state(checkpoint) RETURN {status: FATAL, reason: diagnosis, escalate: true} END END END
| Condition | Action | |-----------|--------| | Task modifies existing files | MUST checkpoint before | | Task is read-only/analysis | Checkpoint optional | | Anomaly detected during execution | Pause, diagnose, decide | | Result partially valid | Keep if value > threshold | | Result invalid | Rollback to checkpoint | | Transient error (timeout, rate limit) | Retry without rollback | | Corrupting error (bad state) | Rollback then retry | | Fatal error (impossible task) | Rollback and escalate |
A checkpoint captures:
<!-- BEGIN available-tables (generated) -->
Optional, no fixed order; the final leaf is always a sop.
| SOP | When to use | | --- | --- | | execution-monitoring | Monitor execution progress, detect anomalies, and report status | | result-collection | Collect experiment outputs — metrics, logs, artifacts — into structured result set |
<!-- END available-tables (generated) -->
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-02 | pass→pass | 15,764 | 8,843 | -44% | 1 | 1 | 0% | 2,655 | 2,324 | -12% | 0 | 0 | — |
case-03 | pass→pass | 11,241 | 7,372 | -34% | 1 | 1 | 0% | 1,888 | 2,020 | +7% | 0 | 0 | — |
case-01 | fail→pass | 15,186 | 8,618 | -43% | 1 | 1 | 0% | 3,242 | 2,497 | -23% | 0 | 0 | — |
case-04 | pass→pass | 14,622 | 5,534 | -62% | 1 | 1 | 0% | 2,372 | 1,801 | -24% | 0 | 0 | — |
case-05 | fail→pass | 9,333 | 5,003 | -46% | 1 | 1 | 0% | 1,418 | 1,610 | +14% | 0 | 0 | — |
case-06 | fail→fail | 7,259 | 3,980 | -45% | 1 | 1 | 0% | 1,194 | 1,508 | +26% | 0 | 0 | — |
case-07 | fail→pass | 9,429 | 3,518 | -63% | 1 | 1 | 0% | 1,512 | 1,450 | -4% | 0 | 0 | — |
case-08 | fail→fail | 11,397 | 3,904 | -66% | 1 | 1 | 0% | 1,789 | 1,511 | -16% | 0 | 0 | — |
case-09 | pass→pass | 11,257 | 5,394 | -52% | 1 | 1 | 0% | 1,745 | 1,658 | -5% | 0 | 0 | — |
case-10 | fail→pass | 12,042 | 6,262 | -48% | 1 | 1 | 0% | 2,018 | 1,808 | -10% | 0 | 0 | — |
case-11 | fail→pass | 11,537 | 6,476 | -44% | 1 | 1 | 0% | 2,007 | 1,928 | -4% | 0 | 0 | — |
case-12 | pass→pass | 7,292 | 2,780 | -62% | 1 | 1 | 0% | 1,133 | 1,227 | +8% | 0 | 0 | — |
case-13 | fail→fail | 11,607 | 5,803 | -50% | 1 | 1 | 0% | 1,865 | 1,809 | -3% | 0 | 0 | — |
case-14 | pass→pass | 15,204 | 6,852 | -55% | 1 | 1 | 0% | 2,284 | 2,003 | -12% | 0 | 0 | — |
case-15 | fail→pass | 12,347 | 3,776 | -69% | 1 | 1 | 0% | 1,837 | 1,425 | -22% | 0 | 0 | — |
case-16 | fail→pass | 15,388 | 7,644 | -50% | 1 | 1 | 0% | 2,379 | 1,971 | -17% | 0 | 0 | — |
case-17 | pass→pass | 8,671 | 3,182 | -63% | 1 | 1 | 0% | 1,323 | 1,377 | +4% | 0 | 0 | — |
case-18 | pass→pass | 11,869 | 4,535 | -62% | 1 | 1 | 0% | 2,193 | 1,565 | -29% | 0 | 0 | — |
case-19 | pass→pass | 10,314 | 3,780 | -63% | 1 | 1 | 0% | 1,660 | 1,454 | -12% | 0 | 0 | — |
case-20 | pass→pass | 10,638 | 6,669 | -37% | 1 | 1 | 0% | 2,063 | 1,972 | -4% | 0 | 0 | — |
case-21 | pass→pass | 9,560 | 11,540 | +21% | 1 | 1 | 0% | 1,787 | 2,696 | +51% | 0 | 0 | — |
case-22 | pass→pass | 17,136 | 15,341 | -10% | 1 | 1 | 0% | 2,914 | 3,577 | +23% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +32 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.