Agent skill

Handling Errors

by rileyhilliard in rileyhilliard/claude-essentials

Prevents silent failures and context loss in error handling.

MITAuto-check passed

Install Handling Errors

skills CLI
$ npx skills add rileyhilliard/claude-essentials --skill handling-errors -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rileyhilliard/claude-essentials handling-errors --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rileyhilliard/claude-essentials.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/ce/skills/handling-errors .claude/skills/handling-errors && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
handling-errors
GitHub stars
130
Token cost
~632 tokens
SKILL.md length
177 words
Files
4 (incl. references)
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

Prevents silent failures and context loss in error handling.

  • Writing try-catch blocks
  • SKILL.md covers Error Categories, Fail Fast vs Degrade Gracefully, Log at the Right Layer and Language-Specific Patterns, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Designing error propagation

What it does

Handling Errors is an agent skill from rileyhilliard/claude-essentials. Prevents silent failures and context loss in error handling. Use when writing try-catch blocks, designing error propagation, reviewing catch blocks, or implementing Result patterns.

Its SKILL.md is about 630 tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/go.md`, `references/python.md` and `references/typescript-react.md`).

It works with React, Python and TypeScript. The licence is MIT.

When your agent uses it

  • Writing try-catch blocks
  • Designing error propagation
  • Reviewing catch blocks
  • Implementing Result patterns

Example prompts

  • “Use the handling-errors skill to prevent silent failures and context loss in error handling”
  • “/handling-errors”

What it can do on your machine

Read from SKILL.md and the folder at commit 3a67a01. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Handling Errors loads about 632 tokens when it runs, and up to ~4.5k if it reads all its reference files. Until then it costs about 49 tokens; SKILL.md has 177 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~49
When it runs · the whole SKILL.md, loaded when a task matches
~632
With references · SKILL.md plus every file in references/, read only if the agent opens them
~4.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rileyhilliard/claude-essentials at commit 3a67a01, republished under its MIT licence (© rileyhilliard). 177 words, ~632 tokens.

Download SKILL.mdSave it as .claude/skills/handling-errors/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
handling-errors
description
Prevents silent failures and context loss in error handling. Use when writing try-catch blocks, designing error propagation, reviewing catch blocks, or implementing Result patterns.

If the current repo has its own rules/skills covering this topic (check .claude/rules/ and repo CLAUDE.md), those take precedence — apply this skill only where they're silent.

Handling Errors

Error Categories

TypeExamplesHandling
ExpectedValidation, Not found, UnauthorizedReturn Result type, log info
TransientNetwork timeout, Rate limitRetry with backoff, log warn
UnexpectedNull reference, DB crashLog error, show support ID
CriticalAuth down, Payment gateway offlineCircuit breaker, alert

Fail Fast vs Degrade Gracefully

Fail fast for critical dependencies:

typescript
await connectToDatabase(); // Throws on failure - app can't run without it

Degrade gracefully for optional features:

typescript
const prefs = await loadPreferences(userId).catch(() => DEFAULT_PREFS);

Log at the Right Layer

typescript
// ❌ Logging at every layer = same error 3x
async function fetchData() {
  try { return await fetch(url); }
  catch (e) { console.error("Fetch failed:", e); throw e; }
}

// ✅ Log once where handled
async function fetchData() {
  const response = await fetch(url);
  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  return response;
}
// Top level logs the error once

Language-Specific Patterns

Anti-Patterns

PatternProblemFix
Empty catch blocksHides errorsLog or re-throw
return false on errorLoses contextReturn Result type
Generic "Error" messagesUndebuggableInclude what/why/context
Logging same error at each layerLog pollutionLog once at boundary
Bare except: / catch (e) allCatches system signalsCatch specific types

© rileyhilliard, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in plugins/ce/skills/handling-errors of rileyhilliard/claude-essentials.

  • SKILL.md
  • references/go.md
  • references/python.md
  • references/typescript-react.md

Open the folder on GitHubat commit 3a67a01

Compare with similar skills

Handling Errors next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Handling Errors compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Handling Errors this skillrileyhilliard/claude-essentials130—~632Automated safety check: PassMIT
Ink Tui Wizardnovuhq/novu40k—~1.9kAutomated safety check: PassMIT
Cross-Language Coding Standardszereight/gitlab-mcp2k1 repos~1.4kAutomated safety check: PassMIT
Morphous CatalogAmeyanagi/morphos102—~2.1kAutomated safety check: PassApache-2.0
Create PRbeyonders-studio/initiative170—~2.7kAutomated safety check: PassAGPL-3.0
Remotionzhuzhaoyun/Molio431—~4kAutomated safety check: PassCustom licence

Similar skills

  • Ink Tui Wizard

    novuhq/novu

    Build terminal user interfaces (TUIs) using Ink (React for CLIs) and @inkjs/ui with a reactive, session-driven wizard pattern.

    40k GitHub stars~1.9k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Shared reference for naming, function size, complexity and error handling rules that reviewer agents apply across TypeScript, Python, Go, Rust, Java, C# and Swift.

    2k GitHub starsUsed in 1 repo~1.4k tokens
    DevelopmentAuto-check passed
  • Morphous Catalog

    Ameyanagi/morphos

    Create or refresh Morphous website design-system/theme bundles from animal, insect, plant, landscape, mineral, weather, or other nature motifs.

    102 GitHub stars~2.1k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • Create PR

    beyonders-studio/initiative

    Open a pull request for the current changes, then watch it to green — poll CI and the Greptile review together, addressing review findings as soon as they post instead of waiting for the full…

    170 GitHub stars~2.7k tokensUpdated today
    DevelopmentAuto-check passed
  • Remotion

    zhuzhaoyun/Molio

    Molio's builtin skill for MAKING a video from any source — wiki notes, articles, scripts, product info, or a brief — and rendering it to MP4.

    431 GitHub stars~4k tokensUpdated today
    Media & CreativeAuto-check passed
  • Write Docs

    beyonders-studio/initiative

    Write or edit the Initiative help center under docs/en/ — the house voice, the structural rules, and how to build and check the site.

    170 GitHub stars~3.8k tokensUpdated today
    Sales & SupportAuto-check passed

More from rileyhilliard/claude-essentials

All 17 skills in this repo
  • Planning Products

    rileyhilliard/claude-essentials

    Defines product features from a PM perspective (JTBD, competitive research, scope negotiation) before technical planning.

    130 GitHub stars~1.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Writing Tests

    rileyhilliard/claude-essentials

    Writes behavior-focused tests using Testing Trophy model with real dependencies.

    130 GitHub stars~999 tokensUpdated 1 mo ago
    Auto-check passed
  • Optimizing Performance

    rileyhilliard/claude-essentials

    Measure-first performance optimization that balances gains against complexity.

    130 GitHub stars~470 tokensUpdated 1 mo ago
    Auto-check passed
  • Architecting Systems

    rileyhilliard/claude-essentials

    Guides clean, scalable system architecture during the build phase.

    130 GitHub stars~713 tokensUpdated 1 mo ago
    Auto-check passed
  • Design

    rileyhilliard/claude-essentials

    Enforces precise, minimal design for dashboards and admin interfaces.

    130 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Fixing Flaky Tests

    rileyhilliard/claude-essentials

    Diagnose and fix tests that pass in isolation but fail when run concurrently.

    130 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Handling Errors

What does Handling Errors do?

Prevents silent failures and context loss in error handling. Handling Errors is an agent skill from rileyhilliard/claude-essentials. Prevents silent failures and context loss in error handling.

When should I use Handling Errors?

Handling Errors fits situations like: writing try-catch blocks; designing error propagation; reviewing catch blocks; implementing Result patterns.

How do I install Handling Errors in Claude Code?

Run `npx skills add rileyhilliard/claude-essentials --skill handling-errors -a claude-code`. Or copy the skill folder (plugins/ce/skills/handling-errors in rileyhilliard/claude-essentials) into .claude/skills/handling-errors in your project. Claude Code loads it when a task matches its description.

How do I install Handling Errors in Codex?

Run `npx skills add rileyhilliard/claude-essentials --skill handling-errors -a codex`. Or copy the skill folder (plugins/ce/skills/handling-errors in rileyhilliard/claude-essentials) into .agents/skills/handling-errors in your project. Codex loads it when a task matches its description.

Can I use Handling Errors in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rileyhilliard/claude-essentials --skill handling-errors -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/handling-errors, .gemini/skills/handling-errors, .github/skills/handling-errors and .opencode/skills/handling-errors in your project.

What does Handling Errors need to run?

SKILL.md names no scripts, command-line tools or credentials: Handling Errors is instructions for the agent only.

Does Handling Errors access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Handling Errors safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Handling Errors use?

Handling Errors is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Handling Errors use?

About 632 tokens (SKILL.md is roughly 2.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.8k tokens, read only when the agent opens those files.

What are the alternatives to Handling Errors?

Skills that share tags, products or a category with Handling Errors: Ink Tui Wizard (novuhq/novu, 40k stars), Cross-Language Coding Standards (zereight/gitlab-mcp, 2k stars), Morphous Catalog (Ameyanagi/morphos, 102 stars) and Create PR (beyonders-studio/initiative, 170 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Handling Errors?

rileyhilliard (a GitHub user) maintains it in rileyhilliard/claude-essentials, which has 130 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on August 18, 2026.

Source: rileyhilliard/claude-essentials on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.