idempotent-redundancy

Idempotent Redundancy

⭐2.2kstars🔀157forks📁View on GitHub🕐Updated Jan 10, 2026

When & Why to Use This Skill

This Claude skill provides expert guidance on implementing 'Idempotent Redundancy,' a critical architectural pattern for building resilient and reliable software systems. It focuses on ensuring that fallback mechanisms, 'belt-and-suspenders' paths, and repair hooks are idempotent—meaning they can be executed multiple times without causing side effects like data corruption, infinite loops, or system churn. By following these principles, developers can ensure system stability even during complex failure recovery scenarios.

Use Cases

  • Designing Resilient Fallbacks: Implementing secondary logic paths that only execute if data is missing or a primary service fails, preventing accidental overwrites of valid data.
  • Safe Data Reconciliation: Creating 'repair' hooks and background synchronization tasks that can be safely run repeatedly to fix inconsistencies without creating duplicate records or triggering further errors.
  • Atomic File Operations: Utilizing atomic write and rename patterns to ensure file integrity and consistency, even if a process is interrupted and needs to be retried.
  • Cloud Infrastructure Updates: Managing stateful updates in tools like Braintrust or cloud APIs using merge flags and conditional logic to ensure retries are additive rather than destructive.
nameidempotent-redundancy
descriptionIdempotent Redundancy
user-invocablefalse

Idempotent Redundancy

When adding redundant paths (fallbacks, belt-and-suspenders), make them idempotent.

Pattern

Redundancy without idempotency causes loops, churn, or data corruption.

DO

  • Use _is_merge: true for Braintrust updates
  • Check if value exists before writing (fallback only if missing)
  • Use atomic write/rename for file operations
  • Make reconciliation steps safe to run repeatedly

DON'T

  • Write unconditionally in fallback paths
  • Allow multiple writers to overwrite each other
  • Fire "repair" actions that can trigger more repairs

Source Sessions

  • a541f08a: "Redundancy is good only if idempotent"
  • 1c21e6c8: "Belt-and-suspenders, but make it idempotent"
  • 6a9f2d7a: "Idempotent repair hooks"