# Hitl Escalate

Escalate blocked runs to a human via configured channel or fallback to BLOCKED.md and...

- Repository: https://github.com/Archive228/loopkit (756 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-07-14
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Archive228/loopkit --skill hitl-escalate -g -a claude-code -y`
Codex: `npx skills add Archive228/loopkit --skill hitl-escalate -g -a codex -y`
Cursor: `npx skills add Archive228/loopkit --skill hitl-escalate -g -a cursor -y`
Gemini CLI: `npx skills add Archive228/loopkit --skill hitl-escalate -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add Archive228/loopkit`

## Description

Escalate blocked runs to a human via configured channel or fallback to BLOCKED.md and exit the loop. Use when the loop hits an ambiguous spec, a missing credential, a destructive action needing approval, or 3+ consecutive verify failures on the same task.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Human-in-the-Loop Escalate

Long-running agent loops fail in a specific way when they meet a question they can't answer: they guess. The guess ships, the next session builds on it, and by the time a human looks the divergence is three commits deep. This skill is the release valve, when the agent is stuck, it stops and asks, cleanly, in a shape the human can act on.

## Trigger, escalate when any of these are true

- **Ambiguous spec.** `PROMPT.md` admits two implementations and the choice changes user-visible behavior.
- **Missing credential.** A required env var, API key, or config file is absent, and there is no sanctioned way for the agent to create one.
- **Destructive action needing approval.** Dropping a table, force-pushing, deleting user data, spending money, sending mail to real recipients.
- **3+ consecutive `/verify` failures on the same task.** The loop is thrashing. Stop and get a human eye before the fourth attempt.
- **External dependency down.** A third-party service the feature needs is unreachable and no offline path exists.

If none of the above hold, do not escalate. Guessing is bad; escalating on a solvable problem is also bad (it trains humans to ignore the channel).

## Primary action, call the human via the configured channel

Read `LOOPKIT_HITL_CHANNEL`. Supported values:

| Value | Shape |
|---|---|
| `telegram` | POST to `https://api.telegram.org/bot$LOOPKIT_HITL_TELEGRAM_TOKEN/sendMessage` with `chat_id=$LOOPKIT_HITL_TELEGRAM_CHAT`, `text=<question + repo + short context>`. |
| `slack` | POST JSON `{"text": "..."}` to `$LOOPKIT_HITL_SLACK_WEBHOOK` (incoming-webhook URL). |
| `dial` | Run `$LOOPKIT_HITL_DIAL_CMD` with the message on stdin. Whatever the operator wired up, SMS gateway, ntfy, phone call, pager. |
| `none` (or unset) | Skip the primary action. Go straight to fallback. |

Message body, always these five lines, in this order:

The rest: https://github.com/Archive228/loopkit/blob/HEAD/skills/hitl-escalate/SKILL.md
