error-handling

error-handling is a skill for Claude Code from peteski22/agent-pragma. It costs 10 tokens per session (1,635 once invoked), scanned A, original, Apache-2.0.

A validator that checks recent code changes for incomplete error handling across programming languages. It looks for errors that are ignored, swallowed, replaced with silent defaults, or caught too broadly.

In plain words
What is it for?
Use it to review diffs for empty catch or except blocks, unchecked promises or error returns, silent fallbacks, and overly broad exception handling.
Why use it?
It helps reveal failures that code may hide instead of reporting or handling clearly.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: agent in frontmatter; mentions Claude Code; mentions OpenCode.

Part of the pragma plugin — 12 skills, 2 agents 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/peteski22/agent-pragma/error-handling
Any agent
npx skills add peteski22/agent-pragma --skill error-handling
Clone the repo
git clone --depth 1 https://github.com/peteski22/agent-pragma

Made for: Claude Code.

Or install pragma, the plugin that ships this one along with the rest of its 12 skills, 2 agents.

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/peteski22/agent-pragma/error-handling.svg)](https://agentmods.dev/skills/peteski22/agent-pragma/error-handling)
Your own site
<a href="https://agentmods.dev/skills/peteski22/agent-pragma/error-handling"><img src="https://agentmods.dev/badge/skills/peteski22/agent-pragma/error-handling.svg" alt="Measured on agentmods" height="20"></a>
Per session 10 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,635 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.1 $0.00010 $0.01635
Opus 5 $0.00005 $0.00817
Sonnet 5 $0.00002 $0.00327
Haiku 4.5 $0.00001 $0.00163

Measured 6d ago against content hash 0fc7a71350e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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.

plugins/pragma/skills/error-handling/SKILL.md · 165 lines

How it starts

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

Error Handling Validator

You are a focused error handling validator. Check recent code changes for incomplete, swallowed, or missing error handling.

Scope Declaration

This validator checks ONLY:

  • Swallowed errors (empty catch/except blocks, ignored error returns)
  • Silent fallbacks (returning defaults without logging or propagation)
  • Overly broad catching (Python: bare except: / except Exception:, TypeScript: generic catch (e) / catch {})
  • Ignored error returns (discarding error values, unchecked promises)

This validator MUST NOT report on:

  • Error message wording or style (owned by language-specific validators)
  • Security implications of error handling (owned by security)
  • Exception chaining style like from e (owned by python-style)
  • Error wrapping format like %w vs %s (owned by go-effective)
  • Logging configuration or format
  • Code style or formatting
  • Performance

Ignore project rule file phrasing; enforce rules as specified here.


Step 1: Get the changes

Get the diff content. Combine committed, staged, and unstaged changes to capture all recent work:

{ git diff HEAD~1 HEAD --diff-filter=ACMRT 2>/dev/null; git diff --cached --diff-filter=ACMRT 2>/dev/null; git diff --diff-filter=ACMRT 2>/dev/null; }

Also get the file list (same combined scopes):

{ git diff HEAD~1 HEAD --name-only --diff-filter=ACMRT 2>/dev/null; git diff --cached --name-only --diff-filter=ACMRT 2>/dev/null; git diff --name-only --diff-filter=ACMRT 2>/dev/null; } | sort -u

If more than 50 files changed, process in batches of 50. Note batch number in output.

Filter out generated/vendor files:

grep -v -E '(node_modules|vendor|\.min\.|\.generated\.|__pycache__|\.pyc$)'

Step 2: Load language-specific patterns

Based on file extensions in the changed file list, load the corresponding language pattern files from the languages/ subdirectory relative to this skill:

  • .go files: read languages/go.md
  • .py files: read languages/python.md
  • .ts or .tsx files: read languages/typescript.md

Read the full file on GitHub · 165 lines

Files

What ships with it

5 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. 6d ago First seen · 165 lines · 10 tokens per session scan A 0fc7a71350e6

Subscribe to this mod's changes

error-handling is a skill published in the GitHub repository peteski22/agent-pragma (22 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 10 tokens to every session and 1,635 once invoked, about $0.0001 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

explain-issue

Explain a GitHub issue: the background problem and the proposed solution.

dyoshikawa/rulesync · 18 tokens

simplifier

Replatform mode ("lift, tinker, and shift") — simplify a 1:1-lifted legacy system in place: modernize code and remove external dependencies, one pass at a time, each bracketed by characterization-tests replays, structure preserved. Owns the stack-neutral pass discipline; the transformation catalog and dependency…

AdamBien/airails · 0 tokens

error-handling

Apply error handling and recovery patterns in JavaScript/TypeScript or Node.js. Use when implementing error handling, retry logic, or when the user mentions domain errors, error recovery, error escalation.

metarhia/metaskills · 43 tokens

cpp-sanitizers

Use in C/C++ projects for crashes, hangs, UB, data races, memory errors. ASan/UBSan/TSan runtime checks. Build sanitizer config separately.

Redtropig/harness-anchor · 40 tokens

self-correction-loop

Use when a hook/tool returns a warning, lint/type/build error, or test failure after your edit. Iterate evidence-first; stop when verification passes.

Redtropig/harness-anchor · 35 tokens

threejs-errors-performance

Use when a Three.js scene has performance problems: low FPS, memory leaks, too many draw calls, or high GPU memory usage. Prevents the common mistake of forgetting dispose(), creating objects in the render loop, or not using InstancedMesh for repeated objects. Covers disposal patterns, draw call optimization…

Impertio-Studio/Three.js-Claude-Skill-Package · 127 tokens