What do you want to do?
3 use cases
-
Preview restart cleanup of stuck tasks before applying it
Dry-run a SQLite task ledger, review aggregate counts, then apply timeouts and delivery closures.
- REPO
MaxHu-xuan/task-state-guard - Software and DevOps
- Intermediate
View prompt
Using the MaxHu-xuan/task-state-guard repo, run the reconcile command with --dry-run against <ledger-path> using --active-grace-seconds 600 and --delivery-grace-seconds 600, then report the aggregate counts. Verify that the output shows dry_run true and applied false before you run any apply step.
- REPO
-
Record task and delivery closures only from real outcomes
Write terminal task states and delivery states from a Python worker without guessing success.
- REPO
MaxHu-xuan/task-state-guard - Software and DevOps
- Intermediate
View prompt
Using the MaxHu-xuan/task-state-guard repo, write a short Python script that creates a task in <ledger-path>, starts it, and closes it as succeeded only after your worker reports success. Verify that you call set_delivery with delivered only after a real transport acknowledgement, and report the final task and delivery states.
- REPO
-
Check a workflow ledger's health before trusting its history
Run a counts-only doctor check on a SQLite task ledger and read its exit code.
- REPO
MaxHu-xuan/task-state-guard - Software and DevOps
- Intermediate
View prompt
Using the MaxHu-xuan/task-state-guard repo, run the doctor command against <ledger-path> and report the aggregate counts and the exit code. Verify that the output contains only counts and no task IDs, prompts, or message bodies.
- REPO
Quick start with Task State Guard
- Check you have what it needs: CPython 3.11 to 3.14; A SQLite ledger file on a local filesystem, not a network or mapped drive; A virtual environment with task-state-guard installed from PyPI.
- Open MaxHu-xuan/task-state-guard on GitHub and read the README and license.
- Create and activate a virtual environment, then run
python3 -m venv .venvand. .venv/bin/activate. - Install the package with
python -m pip install task-state-guard. - Preview the changes with
task-state-guard --db ./private-state/tasks.sqlite reconcile --active-grace-seconds 600 --delivery-grace-seconds 600 --dry-run. (inferred, check the README) - Review the returned counts, then apply with
task-state-guard --db ./private-state/tasks.sqlite reconcile --active-grace-seconds 600 --delivery-grace-seconds 600. (inferred, check the README)
These steps come from our top use case, Preview restart cleanup of stuck tasks before applying it, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for MaxHu-xuan/task-state-guard
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forDevelopers and operators running AI agents, background workers, or local workflows that need to recover task state after a restart or timeout.
- Why it is hot982 stars, launched 78 days ago
- LanguagePython
- Sourcegithub.com/MaxHu-xuan/task-state-guard · Back to Hot repos
Requirements
- CPython 3.11 to 3.14
- A SQLite ledger file on a local filesystem, not a network or mapped drive
- A virtual environment with task-state-guard installed from PyPI
Add this badge to your README
Maintain Task State Guard? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/maxhu-xuan-task-state-guard/?utm_source=github&utm_medium=badge&utm_campaign=MaxHu-xuan-task-state-guard)
HTML
<a href="https://dedupedai.com/use-cases/maxhu-xuan-task-state-guard/?utm_source=github&utm_medium=badge&utm_campaign=MaxHu-xuan-task-state-guard"><img src="https://dedupedai.com/badge/MaxHu-xuan/task-state-guard.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about Task State Guard
What is Task State Guard?
TaskStateGuard is a Python library and CLI that reconciles stuck AI-agent task and delivery states in a local SQLite ledger. It is an open-source project on GitHub: https://github.com/MaxHu-xuan/task-state-guard.
How do I use Task State Guard?
Create and activate a virtual environment, then run python3 -m venv .venv and . .venv/bin/activate; then install the package with python -m pip install task-state-guard; Preview the changes with task-state-guard --db ./private-state/tasks.sqlite reconcile --active-grace-seconds 600 --delivery-grace-seconds 600 --dry-run. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is Task State Guard for?
Developers and operators running AI agents, background workers, or local workflows that need to recover task state after a restart or timeout.
What can I do with Task State Guard?
3 use cases so far, for example: Preview restart cleanup of stuck tasks before applying it; Record task and delivery closures only from real outcomes; Check a workflow ledger's health before trusting its history. Each has steps and a copy-paste agent prompt.
What do I need to run Task State Guard?
CPython 3.11 to 3.14; A SQLite ledger file on a local filesystem, not a network or mapped drive; A virtual environment with task-state-guard installed from PyPI.
What are alternatives to Task State Guard?
Other hot AI repos in Software and DevOps: Skills, Claude Mem, Freellmapi, Andrej Karpathy Skills, Agent Desktop.
Is Task State Guard safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.