Long-Running Task Checkpointer
Persist JSON agent state with atomic checkpoints and explicit recovery limits.
Get a working checkpoint helper and recovery fixtures.
Free · 5 KB · SKILL.md, instructions and example files. Python 3.10+ is required. The included helper uses only the standard library.
A worked example
A small example to try before using your own data.
Input
{
"command": "python scripts/checkpoints.py save --directory ./checkpoints --state examples/input.json --step extract-1",
"state": {
"completed": [
"extract-1"
],
"next": "summarize"
}
}Expected result
{
"loaded_state": {
"completed": [
"extract-1"
],
"next": "summarize"
},
"last_completed_step": "extract-1",
"recovery_rule": "A corrupt newer file is reported and the last valid checkpoint remains readable."
}What to check: The round trip preserves state and step ID; incomplete/corrupt newer files cannot displace a valid checkpoint.
Limits: The helper does not capture an agent automatically or guarantee exactly-once external actions. JSON state must omit secrets you do not want persisted.
Worked example included. Model-specific performance and vendor compatibility have not been benchmarked.
🧠 Why it works
The round trip preserves state and step ID; incomplete/corrupt newer files cannot displace a valid checkpoint.
⚙️ How it works
- Use scripts/checkpoints.py to save JSON state after a completed logical step; include the last completed operation identifier.
- The helper writes a checksum-protected envelope to a temporary file and atomically publishes a numbered checkpoint.
- On recovery, load the newest valid checkpoint; inspect reported invalid files and any operation whose completion is uncertain.
- Reconcile uncertain external side effects before retrying them. A state snapshot does not make a payment, email or tool call exactly once.
- Run the supplied save/load example before integrating the helper into a real agent loop.
Description
Get a working checkpoint helper and recovery fixtures.
Python 3.10+ is required. The included helper uses only the standard library.
Limits: The helper does not capture an agent automatically or guarantee exactly-once external actions. JSON state must omit secrets you do not want persisted.
Recommended Use
Sign in to suggestTools 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.
Report compatibility
Tell the community which tool you used this skill with, and whether it worked.
Suggest a pairing
Recommend a tool or workflow pack that this skill works well with. Up to 5 recommendations per day.