state-persistence

Coordinate reads, writes, and recovery of .agloop state and plan data.

5|3|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/zebbern/termstack --skill state-persistence-zebbern
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: state-persistence
Source: https://github.com/zebbern/termstack/tree/main/.github/skills/state-persistence
Command: npx skills add https://github.com/zebbern/termstack --skill state-persistence-zebbern

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

State persistence patterns provide reliable reading, writing, and recovery for an AI-era workflow, ensuring .agloop/state.json and plan.yaml stay consistent across phases, even in the face of corruption or missing data.

Core Features & Use Cases

  • Guidance for checkpoint management and corruption recovery.
  • Enforced Read-Modify-Write workflow with atomic state updates.
  • Recovery procedures to restore from checkpoints and resume planning.

Quick Start

Configure and apply state persistence for the AI loop by reading and writing .agloop/state.json and .agloop/checkpoints, with corruption recovery.

Frequently Asked Questions about state-persistence

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I maintain consistent state.json during AI workflow transitions?

To maintain consistent state.json during AI workflow transitions, apply a strict Read-Modify-Write pattern with atomic writes. This ensures deterministic behavior and prevents data corruption during plan transitions and checkpointing.

What is the best way to recover from corrupted state data in an AI loop?

The best way to recover from corrupted state data in an AI loop is to restore from existing checkpoints. This recovery procedure safely resumes planning by validating schema fields and switching to append-only logs to prevent further data loss.

How does checkpoint management work for AI-assisted workflows?

Checkpoint management for AI-assisted workflows works by periodically saving the state of .agloop/state.json and plan.yaml. These checkpoints ensure safe recovery from missing data and allow the workflow to resume from the last valid state.

Do I need specific schema validation for atomic state updates?

Yes, you need schema field validation for atomic state updates. Validating schema fields before writing to .agloop/state.json ensures that the recovery procedures and append-only logs function correctly and maintain deterministic workflow behavior.

Why does my AI workflow state become inconsistent during hook script execution?

AI workflow state becomes inconsistent during hook script execution if atomic writes are not used. Enforcing a Read-Modify-Write pattern and coordinating reads and writes to .agloop/state.json prevents race conditions and ensures reliable state persistence.

Can I use append-only logs to prevent state corruption in AI loops?

Yes, you can use append-only logs to prevent state corruption in AI loops. By supporting append-only logs alongside checkpoint management, the workflow maintains consistent state and enables safe recovery from missing or corrupted data.