agent-deadline-setup
БесплатноЗапускает вложенные скриптыНе проверенInstalls, configures or removes the agent-deadline hooks (soft wall-clock budget for subagents). Triggers: agent-deadline, subagent timeout, agent time limit…
от kochetkov-ma★ 41 звезда на GitHubОб этом скилле
Agent Deadline
Two self-contained hooks (PreToolUse guard + SubagentStop cleanup) put a soft wall-clock budget on every subagent. This skill decides mode, scope and budget only; the
brewcode:hook-creatoragent does the file work from the runbook.
Claude Code has no wall-clock timeout for subagents. maxTurns stops a run at its turn cap; since 2.1.246 the caller receives a partial-marked result with a continuation hint, while unwritten analysis remains unrecoverable. These hooks kill nothing: they narrow what an over-budget agent can still call, so it finishes its report.
Prompt contract
$ARGUMENTS is one free-form RU/EN prompt; mode tokens and flags (--unattended) may sit anywhere in it.
- Mode: strip
--unattendedfirst: a flag, never a mode, scope or name (Modes, Unattended). Then an explicit mode token wins outright; else the most distinct whole-word keyword hits (table in Step 2). Tie with a destructive mode (purge) or ofinstallwith a removal mode (uninstall) ->AskUserQuestion; withstatus->status; of two other mutating modes -> the keyword that comes first. No hit or empty ->status. - Scope: prose that is not a mode/id/path is still input: take the id, path or target from it.
- Ask: at most ONE
AskUserQuestion(max 4 questions) to resolve mode and scope, before any work, only when the answer changes what gets written. A read-only run asks nothing.--unattendedasks nothing: an open question there ends inRESULT skipped(Modes, Unattended).
Print once, before the first action (labels literal, values in the conversation language):
PLAN — brewtools:agent-deadline-setup
INPUT: <arguments verbatim, or "(empty)">
MODE: <resolved> — <explicit | matched keyword: X | default>
SCOPE: <resolved paths / target / level / flags>
DO: <2-5 imperative bullets>
RESULT: <what the user ends up holding>
What the hooks do (informational — skill does NOT implement)
| Hook | Event | Behavior |
|---|---|---|
agent-deadline-guard.mjs |
PreToolUse (.*) |
tracks elapsed per agent_id and narrows the tools, table below |
agent-deadline-cleanup.mjs |
SubagentStop | stamps stopped on the agent's state file, never deletes it; prunes state by age |
| Elapsed | Guard |
|---|---|
| 80% of budget | non-blocking additionalContext notice |
| 100% | permissionDecision:"deny" outside the finalization set: Read, Write, Edit, NotebookEdit, TodoWrite, TaskUpdate, SubagentHandback (the 7 its messages advertise) plus TaskCreate, unlisted by design |
hardStopRatio x budget (config key, default 2, must be >1) |
hard stop: only Write, Edit, SubagentHandback pass, deny reason starts Time budget far exceeded. Stops an agent that loops inside the finalization set (re-reading files, rewriting todos) |
SubagentHandback is always allowed: in auto mode a subagent reports through it, so a deny leaves the caller with no report. AskUserQuestion is denied on purpose: a subagent parked on a human answer is unbounded wall-clock time. Agent types in config readOnlyAgentTypes (default Explore, Plan) are told to return what they have now, every other agent to save to a file if the task expects one, then report. The payload has no tool inventory, so an unlisted custom read-only agent is still told to save.
State: <os.tmpdir()>/brewtools-agent-deadline/<session_id>/<agent_id>.json = { start, warned, expired, config, stopped? }, config = path of the governing config file (what uninstall/purge match on); pruned by age: stop stamps past 5 minutes, files and session dirs untouched for 24 h. SubagentStop fires several times per agent, so cleanup keeps the state and the guard decides on the same agent_id's next tool call (time-based: the payload does not tell a continued run from a resumed one):
| Stop stamp age | Clock | When |
|---|---|---|
| under 5 minutes | original clock continues, the pause counts | stop blocked once by another guard (e.g. the agent-return size check), harness nudge, quick SendMessage resume: an over-budget agent can only finalize |
| 5 minutes or more, or state already pruned | fresh window from that call | a later resume, or any pause that long |
Honest limits (verified on CC 2.1.220, stop/resume on 2.1.296 — state these to the user, do not oversell)
| Fact | Consequence |
|---|---|
| Time is sampled only at tool-call boundaries | An agent stuck inside one 25-min Bash call is not observed in between: a soft deadline, not a timeout. Cap long commands with BASH_MAX_TIMEOUT_MS. |
| Clock starts at the agent's first tool call, not at spawn | Pre-tool thinking time is free. |
| Stop/resume is the table above | A quick resume inherits a spent budget; a 5-minute pause earns a fresh one. |
Main session vs subagent is discriminated by absence of agent_id/agent_type |
Main session = no-op, always. |
agent_type for plugin agents (` |
Установить agent-deadline-setup в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadBashAskUserQuestionAgentВложенные файлы
FAQ
Что делает скилл agent-deadline-setup?
Installs, configures or removes the agent-deadline hooks (soft wall-clock budget for subagents). Triggers: agent-deadline, subagent timeout, agent time limit, дедлайн агента, таймаут саб-агента.
Как установить скилл agent-deadline-setup?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл agent-deadline-setup запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic