error-design

error-design is a skill for Claude Code, Codex from codybrom/clairvoyance. It costs 75 tokens per session (1,268 once invoked), scanned A, original, MIT.

A review of how a module reports and handles errors, including the exceptions its callers must deal with. It applies the idea that some errors should be prevented or handled inside the module instead of exposed to callers.

In plain words
What is it for?
Use it when reviewing exception hierarchies, functions with many failure cases, or code where error handling is longer than the successful path.
Why use it?
Too many error cases make every caller harder to write and understand. This review looks for error handling that creates unnecessary work or hides the normal path.

Skill for Claude CodeCodex

Part of the clairvoyance plugin — 16 skills, 1 agent 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/codybrom/clairvoyance/error-design
Any agent
npx skills add codybrom/clairvoyance --skill error-design
Clone the repo
git clone --depth 1 https://github.com/codybrom/clairvoyance

Made for: Claude Code, Codex.

Or install clairvoyance, the plugin that ships this one along with the rest of its 16 skills, 1 agent.

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-design

README.md
[![agentmods](https://agentmods.dev/badge/skills/codybrom/clairvoyance/error-design.svg)](https://agentmods.dev/skills/codybrom/clairvoyance/error-design)
Your own site
<a href="https://agentmods.dev/skills/codybrom/clairvoyance/error-design"><img src="https://agentmods.dev/badge/skills/codybrom/clairvoyance/error-design.svg" alt="Measured on agentmods" height="20"></a>
Per session 75 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,268 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.00075 $0.01268
Opus 5 $0.00037 $0.00634
Sonnet 5 $0.00015 $0.00254
Haiku 4.5 $0.00007 $0.00127

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

Security

Grade A, and why

error-design 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 3d 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/error-design/SKILL.md · 105 lines

How it starts

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

Error Design Review Lens

When invoked with $ARGUMENTS, focus the analysis on the specified file or module. Read the target code first, then apply the checks below.

Each exception a module throws is an interface element. The best way to deal with exceptions is to not have them.

The "Too Many Exceptions" Anti-Pattern

Programmers are often taught that "the more errors detected, the better," but this produces an over-defensive style that throws exceptions for anything suspicious. Throwing is easy. Handling is hard. Each exception type in a module's interface is one more thing callers must understand and prepare for, making the class shallower than it needs to be. Exception handlers are rarely exercised in practice, which means bugs in them accumulate silently. When a handler is finally needed, it may not work.

When to Apply

  • Reviewing error handling code or exception hierarchies
  • When a function has many error cases or throws many exception types
  • When callers are burdened with handling errors that rarely occur
  • When error handling code is longer than the happy path

Core Principles

The Decision Tree

The four techniques below have no canonical ordering. This tree sequences them by preference for practical use.

For every error condition:

1. Can the error be defined out of existence?

Change the interface so the condition isn't an error. If yes: do this. Always the best option.

2. Can the error be masked?

Handle internally without propagating. If yes: mask if handling is safe and complete.

3. Can the error be aggregated?

Replace many specific exceptions with one general mechanism. If yes: aggregate to reduce interface surface.

4. Must the caller handle it?

Propagate only if the caller genuinely must decide. If the caller can't do anything meaningful: crash.

Define Errors Out of Existence

Error conditions follow from how an operation is specified. Change the specification, and the error disappears.

The general move: instead of "do X" (fails if preconditions aren't met), write "ensure state S" (trivially satisfied if state already holds).

Read the full file on GitHub · 105 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. 3d ago First seen · 105 lines · 75 tokens per session scan A 6a78f8fc8f4e

Subscribe to this mod's changes

error-design is a skill published in the GitHub repository codybrom/clairvoyance (12 stars, last pushed 1mo ago), licensed MIT. It adds 75 tokens to every session and 1,268 once invoked, about $0.0004 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-30.

Related

Other skills, from other repositories

agent-architecture-planner

Use when designing an autonomous agent, planning agent architecture, building a scheduled automation, or creating a Claude Code agent workflow. Triggers: 'design an agent', 'build an automation', 'agent architecture', 'automate this workflow', 'create a scheduled agent', 'shell script agent'.

majiayu000/claude-skill-registry · 64 tokens

81-pipecat

Create your Pipecat skill from official documentation, then learn to improve it throughout the chapter.

majiayu000/claude-skill-registry · 18 tokens

2026-legal-research-agent

Expert legal research agent for finding and scraping expungement data state by state. Knows authoritative sources, URL patterns, Firecrawl configuration, and 2026 legal landscape. Activate on "find expungement data", "scrape state laws", "legal research", "court URLs", "statute sources", "Clean Slate laws", "automatic…

majiayu000/claude-skill-registry · 103 tokens

80-livekit-agents-majiayu000-claude-skill-registr

Create your LiveKit Agents skill from official documentation, then learn to improve it throughout the chapter.

majiayu000/claude-skill-registry · 18 tokens

ac-lock

Phase 4.0 — Acceptance Criteria lock checkpoint before implementation. Consolidates all ACs from PRD, TechSpec, and Tasks, presents to user for confirmation, and saves the locked AC list to accepted-criteria.md. Implementation only starts after explicit user confirmation.

majiayu000/claude-skill-registry · 57 tokens

advisor-triggers

Detects when user requests warrant critical analysis via /advise command.

majiayu000/claude-skill-registry · 17 tokens