Skip to main content
AIDiveForge AIDiveForge
💾

Long-Running Task Checkpointer

Agents & Workflows · by AIDiveForge · Apr 20, 2026 · Advanced

Wrap an agent loop so every step snapshots state to disk, letting a crashed agent resume from the last good state instead of restarting from scratch.

🧠 Why it works

Agent frameworks keep state in memory by default, so any crash — OOM, preemption, timeout, power loss — wastes everything done so far. Most agent work is deterministic enough that replay works; adding a checkpoint per step lets you recover cheaply without changing the agent's logic.

⚙️ How it works

  1. Wrap the agent's step function: before returning, serialize (messages, state, last_tool_output_hash) into a numbered checkpoint file. 2. Each checkpoint includes a 'valid' flag that only flips on after the tool completes cleanly. 3. On resume, load the highest-numbered valid checkpoint and feed its state back into the agent. 4. Optionally support checkpoint pruning — keep the last N or the last per day. 5. Expose a CLI to inspect, replay, or fork from any checkpoint.

Description

A middleware layer for agent frameworks. After each tool call, it writes a compact state snapshot (conversation history, working variables, tool output hashes) to disk. On restart, it replays the snapshot and resumes from the next step. Designed for multi-hour agentic tasks that currently lose all progress on a crash or timeout.

Install this skill

A Claude skill is a skill.md file with YAML frontmatter and a markdown body. Drop the file into your tool of choice — or pick a different format if you use Cursor, Windsurf, Copilot, or something else.

Download skill.md
mkdir -p ~/.claude/skills/long-running-task-checkpointer \
  && curl -L https://aidiveforge.com/skill/long-running-task-checkpointer.skill-md \
       -o ~/.claude/skills/long-running-task-checkpointer/skill.md

Save to ~/.claude/skills/long-running-task-checkpointer/skill.md

Recommended Use

Tools and workflow packs this skill pairs well with. Forge picks are auto-generated from category + capability signals; Community picks are added by people who've used the pairing.

No matches yet. Be the first to suggest a pairing, or the Forge will populate suggestions as signals align.