error-handling

error-handling is a skill for Claude Code, Codex from int2t05/engineering-skills. It costs 115 tokens per session (1,575 once invoked), scanned A, original, MIT.

A guide to deciding how software should classify, pass along, retry, contain, and explain errors.

In plain words
What is it for?
Use it to plan error behavior across code layers, choose retries, circuit breakers, or fallbacks for external calls, set throw-versus-return rules, and map internal errors to user messages.
Why use it?
It helps make failures predictable and prevents inconsistent handling when code or outside services go wrong.

Skill for Claude CodeCodex

Installs and runs on its own, but its text points at files inside its plugin — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed. Installing the plugin gets both.

Part of the engineering-skills plugin — 48 skills, 1 agent, 1 hook shipped together

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/int2t05/engineering-skills/error-handling
Any agent
npx skills add int2t05/engineering-skills --skill error-handling
Clone the repo
git clone --depth 1 https://github.com/int2t05/engineering-skills

Made for: Claude Code, Codex.

Or install engineering-skills, the plugin that ships this one along with the rest of its 48 skills, 1 agent, 1 hook.

Wrote 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.

agentmods badge for error-handling

README.md
[![agentmods](https://agentmods.dev/badge/skills/int2t05/engineering-skills/error-handling.svg)](https://agentmods.dev/skills/int2t05/engineering-skills/error-handling)
Your own site
<a href="https://agentmods.dev/skills/int2t05/engineering-skills/error-handling"><img src="https://agentmods.dev/badge/skills/int2t05/engineering-skills/error-handling.svg" alt="Measured on agentmods" height="20"></a>
Per session 115 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,575 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00115 $0.01575
Opus 5 $0.00057 $0.00788
Sonnet 5 $0.00023 $0.00315
Haiku 4.5 $0.00012 $0.00158

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

Security

Grade A, and why

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 5d 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.

skills/04-develop/error-handling/SKILL.md · 99 lines

How it starts

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

When to use

  • Designing how errors propagate across layers for a new feature or service boundary
  • Choosing retry, circuit-breaker, or fallback strategy for calls to external systems
  • Establishing throw-vs-return conventions for a module or codebase
  • Mapping internal errors to user-facing messages at an edge boundary

Not for: diagnosing a specific bug or test failure (use debugging); system-level resilience architecture — cross-service error strategy, overall failure posture (use architecture, specifically architecture/references/error-resilience.md); API error response envelope shape (use api-design); production logging/metrics instrumentation (use observability).

Steps

For system-level resilience architecture (cross-service error propagation, failure posture design), read architecture's error-resilience reference first. This skill is the implementation-level companion — the decisions you make at the keyboard when writing the error-handling code.

1. Classify errors

Every error falls into one of four categories, and the category drives the strategy:

Category Examples Strategy
Transient network timeout, 503, connection reset retry with backoff (step 3)
Permanent 404, 400, logic failure fail fast, no retry
Validation bad input, schema mismatch return 422-style result to caller
Auth expired token, insufficient scope return 401/403, prompt re-auth

If you can't classify an error, default to permanent — retrying an unclassified error masks real bugs.

2. Choose throw-vs-return convention

Pick one convention per layer and enforce it (architecture ref §1 has the full rationale):

  • Throw (exceptions) for invariant violations and infrastructure failures — "this should never happen, the operation cannot continue." Catch at boundaries, not at every call.
  • Return (Result/error values) for expected, recoverable failures the caller must branch on — not-found, conflict, validation. A 404 is a result, not an exception.

Read the full file on GitHub · 99 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 99 lines · 115 tokens per session scan A db44ab97d928

Subscribe to this mod's changes

error-handling is a skill published in the GitHub repository int2t05/engineering-skills (3 stars, last pushed 4d ago), licensed MIT. It adds 115 tokens to every session and 1,575 once invoked, about $0.0006 per session on Opus 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-31.