error-closed-loop

A procedure for handling command and platform failures from detection through diagnosis, safe recovery, verification, and reporting. It also defines when to stop and present escalation choices.

In plain words
What is it for?
Investigating non-zero exits, failed execution, missing output, busy files, syntax errors, interrupted command batches, missing commands, update problems, and temporary network errors.
Why use it?
It prevents repeated failed commands and incomplete fixes. Each recovery attempt is checked before the result is reported, so failures are less likely to be hidden.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/yunsii/wezdeck/error-closed-loop
Any agent
npx skills add yunsii/wezdeck --skill error-closed-loop
Clone the repo
git clone --depth 1 https://github.com/yunsii/wezdeck

Made for: Claude Code, Codex.

Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 912 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
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 $0.00043 $0.00912
Opus 5 $0.00022 $0.00456
Sonnet 5 $0.00009 $0.00182
Haiku 4.5 $0.00004 $0.00091

Measured 2d ago against content hash 7fd208cea109, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

error-closed-loop scanned grade C with 1 finding 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 2d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

**Never** self-fix without explicit yes: force-push, broad `rm -rf`, prod deploy, disable safeguards.
openclaw/workspace/skills/error-closed-loop/SKILL.md · 84 lines

How it starts

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

Error closed-loop (detail)

Always-on doctrine is short in AGENTS.md L0. This skill expands procedure.

Order

1. Detect   — non-zero / Exec failed / empty critical output
2. Diagnose — one factual cause
3. Self-fix — reasonable recovery 1–2 times when safe
4. Verify   — smallest check that proves recovery
5. Report   — user-facing template (even if recovered)
6. Escalate — only if blocked: situation + ≥2 options + recommendation

Self-fix (safe/cheap)

Failure Fix
ETXTBSY bash path/to/script or wait + retry
🛠️ Exec failed / SIGTERM batch Split short execs; re-run missing checks only
Inline SyntaxError / literal \\n in python/node Rewrite body to file (write or claw-script-run.sh); do not re-fire the same -c/-e string
Giant a; b; c chain, later step failed Re-run only the missing step(s); keep probes short
openclaw update + gateway process tree Detached systemd-run --user unit (see exec-risk); never loop the same in-tree update
command not found (e.g. rg) Use absolute path / grep / install only if intended; do not spam retries
429 / flaky network Backoff once
Wrong path realpath / create only if clearly intended
Your leftover lock/process Stop it, retry

Never self-fix without explicit yes: force-push, broad rm -rf, prod deploy, disable safeguards.

Platform Exec failed

Feishu/runtime 🛠️ Exec failed: run A → run B → … = agent exec batch failed, not noise. Explain in plain language the same turn; do not leave the arrow-list undecoded. Prefer short verification batches after writes.

Prevention (preferred over recovery): AGENTS Exec hygiene + skills/exec-risk — short shell, scripts on disk, no gateway-tree self-update. Goal is fewer red cards, not prettier post-mortems only.

Coverage vs OpenClaw platform (important)

This skill still matters: it covers failures that re-enter the current agent turn as tool results (exec non-zero, readable tool errors, self-heal + verify).

Read the full file on GitHub · 84 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. 2d ago First seen · 84 lines · 43 tokens per session scan C 7fd208cea109

Subscribe to this mod's changes

error-closed-loop is a skill published in the GitHub repository yunsii/wezdeck (5 stars, last pushed 6d ago), licensed MIT. It adds 43 tokens to every session and 912 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). 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

workflow

Create, run, monitor, cancel, or resume deterministic JavaScript workflows that orchestrate multiple Codex, Claude, Cursor, or Kimi agents. Use for parallel investigation or review, staged agent pipelines, resumable long-running work, or when the user explicitly asks for a workflow, orchestration, fan-out, or several…

xxxoooxoxo/wiff · 70 tokens

orchestrate

Use only when the user explicitly types /orchestrate:orchestrate to decompose a large task, spawn a tree of parallel worker/subplanner/verifier subagents, and collect structured handoffs. Do not invoke autonomously.

odysseus0/claude-orchestrate · 54 tokens

launch

Launch and automate VS Code (Code OSS) using agent-browser via Chrome DevTools Protocol. Use when you need to interact with the VS Code UI, automate the chat panel, test UI features, or take screenshots of VS Code. Triggers include 'automate VS Code', 'interact with chat', 'test the UI', 'take a screenshot', 'launch…

workstream-labs/workstreams · 80 tokens

accessibility

Primary accessibility skill for VS Code. REQUIRED for new feature and contribution work, and also applies to updates of existing UI. Covers accessibility help dialogs, accessible views, verbosity settings, signals, ARIA announcements, keyboard navigation, and ARIA labels/roles.

workstream-labs/workstreams · 54 tokens

sessions

Agent Sessions window architecture — covers the sessions-first app, layering, folder structure, chat widget, menus, contributions, entry points, and development guidelines. Use when implementing features or fixing issues in the Agent Sessions window.

workstream-labs/workstreams · 45 tokens

component-fixtures

Use when creating or updating component fixtures for screenshot testing, or when designing UI components to be fixture-friendly. Covers fixture file structure, theming, service setup, CSS scoping, async rendering, and common pitfalls.

workstream-labs/workstreams · 47 tokens