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.
npx skills add cosmix/loom --skill loom-error-handlinggit clone --depth 1 https://github.com/cosmix/loomWrote 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.
[](https://agentmods.dev/skills/cosmix/loom/loom-error-handling)<a href="https://agentmods.dev/skills/cosmix/loom/loom-error-handling"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-error-handling/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.
<a href="https://agentmods.dev/skills/cosmix/loom/loom-error-handling"><img src="https://agentmods.dev/badge/skills/cosmix/loom/loom-error-handling.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 1 finding, up to medium
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- medium Output Handling · line 233 Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.Fix: Set explicit limits on output length, generation count, and rate. Use max_tokens and truncation to prevent unbounded output.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00029 | $0.03656 |
| Opus 5.5 | $0.00012 | $0.01462 |
| Sonnet 5.5 | $0.00006 | $0.00731 |
| Haiku 4.5 | $0.00003 | $0.00366 |
Grade A, and why
loom-error-handling 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.
How it starts
The opening of the file, as written. The whole thing — 278 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Handling
Overview
Cross-language error-handling reference. The recurring mistakes are not syntactic: swallowing errors, retrying non-idempotent operations, losing the cause chain when wrapping, leaking internals in API responses, and log-and-rethrow double logging. This skill leads with the decision rules an expert applies, then shows the minimum code to implement each.
Agent Delegation
- loom-senior-software-engineer (Opus) — DEFAULT. Error architecture, strategy choice, secure handling (no info leak), infra resilience (retry/circuit breaker/fallback).
- loom-software-engineer (Sonnet) — ONLY boilerplate error types / unit tests following an established pattern.
Error Taxonomy — Classify First
Every failure is exactly one of three kinds; the kind dictates handling:
| Kind | Meaning | Handle by |
|---|---|---|
| Expected / recoverable | Invalid input, not-found, transient network/rate-limit | Return a typed error (Result/checked exception); retry only if transient AND idempotent |
| Bug / programmer error | Broken invariant, unreachable state, index OOB | Fail loud: panic!/assert/throw. Do NOT try to recover — it hides the bug |
| Fatal / environmental | OOM, disk full, config missing at startup | Fail fast at the boundary; crash cleanly, let the supervisor restart |
⚠ Do not model expected failures as panics/exceptions-for-control-flow, and do not swallow bugs into a recoverable path. Rust encodes this split directly: Result = recoverable, panic! = bug. In exception languages, keep the split by convention: validation → typed exception you catch; invariant break → let it propagate/crash.
Rust: Result/Option & the anyhow-vs-thiserror Rule
Decision rule:
thiserror→ libraries and any code whose caller must match on and react to specific error variants. Gives typed, exhaustive enums with#[from]conversions.anyhow(oreyre) → application/binary top layers where you only need to propagate, add context, and report. Oneanyhow::Errortype, cheap.context(), backtraces.- Mixed is normal: libs export
thiserrorenums;main/handlers useanyhowand add context as errors bubble up.
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.
- 2mo ago Changed · -1 lines 74e01f14cfa4
- 2mo ago Changed · -30 tokens per session 891838c1e266
- 3mo ago First seen · 279 lines · 59 tokens per session scan A 577117f2fbf7
loom-error-handling is a skill published in the GitHub repository cosmix/loom (66 stars, last pushed yesterday), licensed MIT. It adds 29 tokens to every session and 3,656 once invoked, about $0.0001 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-30.
loom-error-handling compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| loom-error-handlingcosmix/loom | Skill | 66 | yesterday | MIT | A | 29 | Claude Code, Codex |
| API Discoverability for Agentsniels-emmer/myace | Skill | 1 | yesterday | MIT | A | 51 | Claude Code, Codex |
| durable-objectscloudflare/skills | Skill | 3.5k | 5d ago | Apache-2.0 | A | 22 | Claude Code |
| sandbox-nextcloudflare/skills | Skill | 3.5k | 5d ago | Apache-2.0 | A | 39 | Claude Code |
| cloudflarecloudflare/skills | Skill | 3.5k | 5d ago | Apache-2.0 | A | 103 | Claude Code |
| cloudflare-email-servicecloudflare/skills | Skill | 3.5k | 5d ago | Apache-2.0 | A | 21 | Claude Code |
| workers-best-practicescloudflare/skills | Skill | 3.5k | 5d ago | Apache-2.0 | A | 25 | Claude Code |