/agent-skills:error-handlingfrom agent-skills
Designs error handling strategy: which errors to catch, retry, surface, or crash. Helps with try/except blocks, retries, timeouts, and silent failure bugs.
Ships in agent-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Most error handling is written reflexively — wrap it, log it, move on, and that reflex produces systems that fail silently and are impossible to debug. The decision to make for each failure is not how to handle it but whether you can do anything useful about it.
If you cannot, do not catch it. A caught-and-logged exception that leaves the program in a wrong state is worse than a crash, because the crash would have told you immediately.
| Kind | Example | Response |
|---|---|---|
| Expected | Not found, validation failed, duplicate | Return it as a value. Not an exception — this is normal operation |
| Transient | Timeout, 503, connection reset, lock contention | Retry with backoff, then give up and report |
| Programmer error | Null where it cannot be null, broken invariant | Crash. Loudly. Do not handle |
| Environmental | Config missing, disk full, credentials invalid | Fail at startup if possible, not on first request |
The two most common mistakes are treating expected outcomes as exceptions, which makes normal control flow expensive and noisy, and catching programmer errors, which hides the bug and lets corrupted state spread.
Done when: every failure path in the code maps to one of these four.
Catch a specific error type, at the level that knows what to do about it. That level is often much higher than where the error occurs.
except, catch (Exception), or catch {} also swallows
programmer errors, cancellations, and out-of-memory.Done when: every catch block does something other than logging.
When you wrap an error, keep the original attached — raise ... from e, %w, cause:. An
error chain that loses its root is the reason incidents take hours instead of minutes.
Add context on the way up: what you were doing, with which identifiers. "Failed to sync order 88213 for tenant acme" is actionable; "sync failed" is not. Add the values you had, never the secrets.
Done when: one log line at the boundary tells you what failed, for which entity, and why.
Retries convert a small outage into a large one when applied carelessly.
Done when: each retry has a stated reason it is safe.
Three different audiences need three different things from the same failure:
api-design.The request ID is the piece that gets forgotten and matters most: it is what lets a user report and a log line meet.
Done when: a user report can be traced to the exact failure without guessing.
Done when: an error mid-operation leaves nothing inconsistent.
State which failures you handle and which you deliberately let propagate, what is retried and why that is safe, and what a user sees for each. The failures you chose not to handle are the part reviewers most need to see, because silence there reads as an oversight.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
error-handling, exception-strategy, failure-modes, retry-logic
npx claudepluginhub arjunprabhulal/agent-skills --plugin agent-skills60 skills in this plugin
/accessibility-reviewReviews an interface for barriers that stop people using it — keyboard operation, screen reader support, contrast, focus management, and form semantics. Use this whenever the user is building or reviewing UI, mentions accessibility, a11y, WCAG, screen readers, or keyboard navigation, and proactively when a change adds a modal, a custom control, a form, or anything interactive. For general code correctness, use code-review./agent-deploymentShips an agent to production — packaging, config and secrets, staged rollout, and the rollback plan — for a system whose failures are usually silent rather than loud. Use this whenever the user is deploying an agent or LLM feature, planning a rollout or canary, moving an agent from prototype to production, or asking how to release a prompt or model change safely. For monitoring it once live, use agent-observability./agent-designDesigns an agent's architecture — the tool surface, context strategy, control flow, and model choice — from a scoped set of jobs. Use this whenever the user is deciding how an agent should be built rather than what it should do — choosing tools, wiring up an agent loop, deciding single-agent vs multi-agent, picking a model, or planning what goes in the context window. Also use when an existing agent is unreliable and the cause looks structural rather than a prompt problem. For deciding what the agent is for, use agent-scoping first./agent-evaluationBuilds an eval set for an agent or LLM feature, writes graders, establishes a baseline, and reads the results honestly. Use this whenever the user wants to measure whether an agent works, asks if a prompt or model change was an improvement, mentions evals, LLM-as-judge, regression testing for AI, or is about to ship an agent on the strength of a few manual tries. Also use before any prompt or model change, since without a baseline no change can be judged./agent-hardeningMakes an agent safe to run with real permissions on real data — scoping what it can do, handling prompt injection, adding confirmation and dry-run for irreversible actions, and bounding cost. Use this whenever an agent is about to touch production, act autonomously, handle untrusted input, or use credentials, and whenever the user asks about agent safety, guardrails, permissions, or prompt injection. Also use when an agent has broad API access that nothing in code restricts./agent-implementationBuilds an agent from a design — the loop, the tools, the prompts, the schema validation, and the traces you will need later. Use this whenever the user is writing agent code — implementing tool calling, wiring an agent loop, building an MCP server or tool layer, writing system prompts for an agent, or turning a prototype agent into something maintainable. For deciding the architecture first, use agent-design; for measuring whether it works, use agent-evaluation.Other plugins' skills for the same job