Skip to content
Back to skills

Comfyui Checkpoint

ASecurity

Saves and restores ComfyUI workflow snapshots indexed by session_id. Use before every agent invocation to freeze workflow state, and after any rewrite/debug step to record a recoverable version.

  • 30 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 8, 2026
ai-agentspythonshellbashsqlbackend

Works with

  • cli

Security analysis

A100/100

Scanned November 8, 2026

npx -y skills add majiayu000/claude-skill-registry-data --skill comfyui-checkpoint --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Comfyui Checkpoint?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Comfyui Checkpoint
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-comfyui-checkpoint/badge)](https://www.skillsdirectory.com/skills/majiayu000-comfyui-checkpoint)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: comfyui-checkpoint
description: Saves and restores ComfyUI workflow snapshots indexed by session_id. Use before every agent invocation to freeze workflow state, and after any rewrite/debug step to record a recoverable version.
---

# comfyui-checkpoint

SQLite-backed workflow version store. Schema ported directly from
ComfyUI-Copilot `backend/dao/workflow_table.py:54-176` (Level A, §11) — same
columns (`session_id`, `workflow_data`, `workflow_data_ui`, `attributes`,
`created_at`), namespace changed, dependency on SQLAlchemy stripped in favor
of stdlib `sqlite3`.

## When to use

- **Before every high-value agent action**: the
  `.claude/settings.json:PreToolUse` hook `checkpoint_pre.py` is wired to
  both the `Write|Edit|NotebookEdit` matcher (file edits under
  `projects/<id>/inputs/`) AND the `Skill|Bash` matcher (capability Skill
  executions via `compile.py` / `submit_prompt.py` per
  `HIGH_VALUE_NEEDLES`). The hook's internal `is_high_value` filter
  ensures it only snapshots real high-value calls; non-matching
  `Skill|Bash` invocations pass through with `allow("not high-value")`.
  Checkpointing is default infrastructure, not opt-in (`plan_v1.md §9`).
- **After any rewrite/repair step**: so `repairing-workflows` can roll back.
- **On demand**: manual `save()` call from the host bridge via
  `host/bridge/checkpoint_client.py`.

## Scripts

| Script | Input | Output |
|---|---|---|
| `scripts/save.py` | **stdin JSON only**: `{session_id, workflow_data, workflow_data_ui?, attributes?}` — **does not accept CLI arguments** | `{version_id, created_at}` |
| `scripts/restore.py` | CLI flags: `--session-id SID` (latest for session) or `--version-id N` (specific row) | `{version_id, session_id, workflow_data, workflow_data_ui, attributes, created_at}` |

> **Host callers**: do not shell out to these scripts directly — use the
> Python wrapper at `host/bridge/checkpoint_client.py` (`save()` /
> `restore()` / `CheckpointError`). It speaks the stdin-JSON contract for
> `save.py` and the CLI-flag contract for `restore.py`, and raises a
> structured exception on any failure. Passing CLI flags to `save.py` is a
> historical bug — argparse would reject them and the script would write
> nothing.

## Storage

Single SQLite file at `ComfyUI-Agent/host/.cache/checkpoint.sqlite` (override
via `COMFYUI_AGENT_CHECKPOINT_DB`). Table `workflow_version`:

```sql
CREATE TABLE IF NOT EXISTS workflow_version (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    session_id TEXT NOT NULL,
    workflow_data TEXT NOT NULL,
    workflow_data_ui TEXT,
    attributes TEXT,
    created_at TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_workflow_version_session ON workflow_version(session_id);
```

## References

- `knowledge/plans/v1/todo.md` §5.3 (Track C), §11 master table.
- `knowledge/workflows/ComfyUI-Copilot_workflow.md` §5.2.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.