From grace
Короткая эскалация в Telegram во время автономных сессий. Использовать ТОЛЬКО изнутри grace-afk, когда необратимое решение должно быть подтверждено человеком. Формирует сообщение ≤10 строк, отправляет через grace afk ask и опрашивает grace afk check с экспоненциальным backoff. Блокирует до получения ответа, тайм-аута или истечения сессии.
How this skill is triggered — by the user, by Claude, or both
Slash command
/grace:grace-ask-humanThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Send a Telegram escalation to the human with a hard short format, then poll for the reply.
Send a Telegram escalation to the human with a hard short format, then poll for the reply.
This skill is a thin wrapper around grace afk ask and grace afk check. It exists to
enforce message discipline — without it, LLMs send walls of text over Telegram which the user
cannot act on from a phone.
grace-afk session (checked by grace afk tick returning 0).$GRACE_AFK_CONFIG env var, <project>/.grace-afk.json, or global ~/.grace/afk.json (checked in that priority).one-way-door-escalated (see grace-afk#Autonomy-Matrix).
If the decision is reversible, do NOT escalate — act and journal.The CLI generates this from your input to grace afk ask. You pass:
--title "<5-10 word decision title>"--context "<one sentence — the situation>"--options "A:<1 line>;B:<1 line>;C:<1 line>" (2-5 options). Use ; as a separator — it is safer than | across Windows shells.--details "A|pros|cons|opportunities|risks;B|..." (optional). When provided, the message gets a [📖 Подробнее] button. On tap the CLI sends a SWOT breakdown (Преимущества / Недостатки / Возможности / Риски) as a follow-up message without cancelling the ask — the user reads it, goes back to the first message, then picks A/B/C/PROCEED/DEFER/STOP.--wait <seconds> (optional, default 0). When >0, the CLI blocks and polls getUpdates every 2 seconds. On an inline-button tap it calls answerCallbackQuery immediately so the spinner stops within ~2s (inside Telegram's 15-second callback timeout window), strips the keyboard on the original message, and returns the classified answer as JSON. Without --wait, the agent must call grace afk check separately to pick up and ack the reply — on Telegram that means the user's spinner shimmers until the next check.--mypick <letter> — the option you'd pick if forced--confidence <0-100> — your percent confidence in that pickTotal message ≤10 lines. No multi-paragraph explanations. If you need paragraphs, the question is not shaped for Telegram — simplify or defer.
Answer these in your working notes before sending:
git reset --hard afk-baseline-<ts>)?If any answer is no — use grace afk defer instead.
grace afk ask \
--path . \
--title "Merge afk branch into main" \
--context "Plan step-12 complete, 14 commits, all gates green; ready to merge" \
--options "A:merge to main;B:open PR for review;C:leave as afk branch" \
--mypick B \
--confidence 80
CLI returns JSON: { correlationId, messageId, sessionId }. Store these — both are needed to poll.
Wait the backoff interval, then call:
grace afk check --path . --correlation <id> --messageid <msgId> --offset <lastOffset>
Result shapes:
{ status: "pending" } — no reply yet{ status: "answered", verb: "A|B|C|D|E|PROCEED|STOP|EVOLVE|DEFER", raw, nextOffset } — done{ status: "unrecognized", verb: "UNKNOWN", raw, nextOffset } — user wrote free-form textBackoff schedule:
Total wait ≤ 220 minutes. No reply after that → fall through to Step 4.
Between poll checks, you should NOT be idle — continue the /afk loop on independent steps. Come back to this correlation id whenever the backoff has elapsed.
ROLLBACK), execute it; journal
class=one-way-door-escalated with outcome=default-on-timeout.grace afk defer --question "<title>" --contextLine "<context>" and continue.A/B/C/D/E → act per that option, journal with the chosen option.PROCEED → act per your --mypick, journal with confidence noted.STOP → grace afk stop --reason "user STOP via telegram"; exit the loop.EVOLVE → defer (grace-evolve not yet available); journal with that note.DEFER → grace afk defer; continue with next step.UNKNOWN (free-form) → journal the raw text under outcome=manual-interpretation-required,
then defer (do not try to interpret complex free-form replies autonomously).| Rationalization | Reality |
|---|---|
| "Just this once, let me send a longer message with full context" | The user is on a phone at 02:00. Long context does not help them, it delays the reply. Simplify or defer. |
| "I'll send one ask and act immediately, don't need to poll" | That defeats the purpose. The ask is a BLOCKING gate for this decision path. Do work on other steps while polling. |
| "The user hasn't replied, I'll re-send to remind" | Spamming Telegram is why max-escalations exists. Stick to the backoff schedule. |
| "I can interpret 'sounds good' as PROCEED" | Only classify replies the CLI recognizes. 'sounds good' is UNKNOWN → defer to clear reply on return. |
| "This is borderline one-way; I'll ask just to be safe" | Asks are expensive (phone ping, user interruption). Borderline → reversible → act. |
grace-afk session (the CLI will refuse, but you should not even try).grace afk defer directly.Before returning control to grace-afk:
grace afk ask returned ok, correlationId noted)grace afk check result or state.json)one-way-door-escalated and the chosen verbescalations incremented (verification: cat state.json | jq .escalations)grace afk stop invoked and report emittednpx claudepluginhub baho73/grace-marketplace-2 --plugin graceАвтономный режим работы, когда пользователь AFK. Использовать, когда пользователь вводит `/afk [часы] [бюджет%] [--checkpoint <мин>]` или просит агента продолжать работу самостоятельно. CLI контролирует лимит времени — агент опрашивает `grace afk tick` между шагами и завершает работу, когда CLI это разрешит. Необратимые решения эскалируются в Telegram через `grace afk ask`; всё остальное выполняется, откладывается или откатывается согласно матрице автономии.
Enables communication with users via Telegram for clarifications, options, blockers, task completion notifications, and long-running task updates instead of terminal.
Guides Telegram notification integration in PACT when telegram_notify tool is available: timing for completions/deployments/blockers, using telegram_ask for decisions, checking replies, multi-session handling.