resonate-human-in-the-loop-pattern-python

resonate-human-in-the-loop-pattern-python is a skill for Claude Code, Codex from resonatehq/resonate-skills. It costs 74 tokens per session (2,249 once invoked), scanned A, original, Apache-2.0.

A Python workflow pattern for pausing durable processes until a person, webhook, user interface, or command-line operator provides a decision or data.

In plain words
What is it for?
Use it for expense approvals, content moderation, deployment gates, third-party callbacks such as Stripe or DocuSign, and operator-controlled incident steps.
Why use it?
It avoids polling or keeping a worker running while waiting. The workflow can resume after an approval, review, or external callback.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for expense approvals, content moderation, deployment gates, third-party callbacks such as Stripe or DocuSign, and operator-controlled incident steps.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add resonatehq/resonate-skills --skill resonate-human-in-the-loop-pattern-python
Clone the repo
git clone --depth 1 https://github.com/resonatehq/resonate-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for resonate-human-in-the-loop-pattern-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python/github.svg)](https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python)
Your own site
<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for resonate-human-in-the-loop-pattern-python

Your own site · 80×15
<a href="https://agentmods.dev/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python"><img src="https://agentmods.dev/badge/skills/resonatehq/resonate-skills/resonate-human-in-the-loop-pattern-python.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,249 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.02249
Opus 5.5 $0.00030 $0.00900
Sonnet 5.5 $0.00015 $0.00450
Haiku 4.5 $0.00007 $0.00225

Measured 2mo ago against content hash 8c40daa8c835, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

resonate-human-in-the-loop-pattern-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

resonate-human-in-the-loop-pattern-python/SKILL.md · 240 lines

How it starts

The opening of the file, as written. The whole thing — 240 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Resonate Human-in-the-Loop Pattern — Python

Overview

A human-in-the-loop workflow suspends on a durable promise that is resolved (or rejected) by something outside the Resonate worker set — a person clicking an Approve button, a webhook from a third-party system, an operator running a CLI command. The worker doesn't poll or sleep; it opens a ctx.promise() and awaits it, and Resonate wakes it when the promise settles.

When to use

  • Approval gates in business workflows (expense approval, content moderation, deploy gate)
  • Waiting on third-party callbacks (Stripe webhooks, DocuSign signature events)
  • Operator-driven unblock steps (break-glass in incident runbooks)
  • Any workflow step where the data or decision comes from outside the Resonate worker

Basic shape

from __future__ import annotations
import asyncio, os, time
from typing import TYPE_CHECKING
from resonate.resonate import Resonate
from resonate.types import Value

if TYPE_CHECKING:
    from resonate.context import Context

r = Resonate(url=os.environ.get("RESONATE_URL", "http://localhost:8001"))

async def notify_reviewer(ctx: Context, order_id: str, amount: int, approval_id: str) -> str:
    # Side effects live in leaves — this prints/notifies exactly once
    print(f"  order {order_id} (${amount}) needs review; promise id: {approval_id!r}")
    return approval_id

async def ship_order(ctx: Context, order_id: str) -> str:
    return f"shipped-{order_id}"

async def cancel_order(ctx: Context, order_id: str) -> str:
    return f"canceled-{order_id}"

async def fulfill_order(ctx: Context, order_id: str, amount: int) -> str:
    # Open the approval promise; its id is deterministic (derived from the workflow id)
    approval = ctx.promise()
    approval_id = await approval.id()

    # Notify the reviewer via a leaf (side effects belong in leaves)
    await ctx.run(notify_reviewer, order_id=order_id, amount=amount, approval_id=approval_id)

    # Suspend here — the worker holds no state while waiting
    # This can be seconds, hours, or days; no process needs to stay alive
    decision_raw = await approval

    if decision_raw.get("approve"):
        return await ctx.run(ship_order, order_id=order_id)
    return await ctx.run(cancel_order, order_id=order_id)

Read the full file on GitHub · 240 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 240 lines · 74 tokens per session scan A 8c40daa8c835

Subscribe to this mod's changes

resonate-human-in-the-loop-pattern-python is a skill published in the GitHub repository resonatehq/resonate-skills (7 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 74 tokens to every session and 2,249 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

create-pubsub-python

Creates a Dapr pub/sub app in Python with FastAPI (publisher, subscriber or both) and declarative, programmatic or streaming subscriptions. Use for "create a pub/sub app in Python" or "build a FastAPI publisher and subscriber with Dapr". For an existing app use add-pubsub-python.

diagrid-labs/dapr-skills · 70 tokens

create-workflow-python

Creates a Dapr workflow app in Python, run locally with dapr run. Use for "create a workflow in Python" or "build a workflow app in Python". For Diagrid Catalyst use the catalyst-ai plugin.

diagrid-labs/dapr-skills · 49 tokens

add-pubsub-python

Adds Dapr pub/sub to an existing Python FastAPI app. Keeps its subscription type, shows a plan for approval, then makes targeted edits and checks imports after each. Use for "add pub/sub to my FastAPI app" or "make this Python service subscribe to a Dapr topic". For a new app use create-pubsub-python.

diagrid-labs/dapr-skills · 76 tokens

check-prereq-agent-python

Checks prerequisites for building durable AI agents in Python with the Dapr Agents SDK or a Diagrid framework wrapper. Use for "check prerequisites for Python agents" or "verify Python agent environment".

diagrid-labs/dapr-skills · 45 tokens

check-prereq-python

Checks prerequisites for building Dapr Workflow apps in Python. Use for "check prerequisites for Python" or "verify Python environment".

diagrid-labs/dapr-skills · 31 tokens

fastapi-pro

Production FastAPI patterns — async endpoints, SQLAlchemy 2.0 async, Pydantic V2, dependency injection, JWT auth, testing. Use for Python 3.11+ FastAPI backends. NOT for Django (→ django-patterns) or Node.js (→ backend-patterns).

tranhieutt/software_development_department · 67 tokens