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.
npx agentmods add skills/techymt/claude-code-superpowers/error-handlingnpx skills add TechyMT/claude-code-superpowers --skill error-handlinggit clone --depth 1 https://github.com/TechyMT/claude-code-superpowersWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00087 | $0.01629 |
| Opus 5 | $0.00044 | $0.00814 |
| Sonnet 5 | $0.00017 | $0.00326 |
| Haiku 4.5 | $0.00009 | $0.00163 |
Grade A, and why
error-handling scanned grade A with 1 finding 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 2d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
const response = await fetch(args.url) How it starts
The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Handling
The pattern
Claude Code has two error categories. Session errors are unrecoverable failures that crash the process or abort the current session (network configuration issues, authentication failures, corrupted state). Tool errors are expected failures that should be shown to the LLM so it can reason about them, retry, or explain the situation to the user.
The fundamental rule: tool.call() throws typed errors for expected failures. The framework catches them, calls formatError(error) from src/utils/toolErrors.ts, and delivers the formatted string to the LLM as a tool_result block with is_error: true. Only truly unrecoverable infrastructure failures should propagate past the framework as unhandled exceptions.
Why this matters
The LLM is in a conversation loop. If a tool throws a raw, unformatted exception, the framework must decide what to show the model — a stack trace is not useful. By throwing typed errors (ShellError, AbortError, Error), tools hand the framework enough structure to produce a clean, readable message. For example, a file-not-found error thrown from FileReadTool lets the LLM suggest the correct path or ask the user to check.
This also means the user sees a coherent explanation rather than an error box. The LLM translates the technical error into natural language in its next response.
Custom error types (ShellError, AbortError) are used at system boundaries — they carry structured context (exit code, stderr, interrupted flag) that formatError uses to build the right message.
How to apply it
- Wrap all I/O in try-catch inside
call(). Catch specific error types first, then rethrow or let them propagate. throw new Error(message)for expected, non-shell failures. Include enough context for the LLM to act: what was attempted, what failed, what the user could check.- For ENOENT (file not found): use
isENOENT()fromutils/errors.jsto detect it and thrownew Error("File not found: /path. Does it exist?"). - For command failures: throw
new ShellError(stdout, stderr, code, interrupted)—formatErrorassembles exit code and stderr automatically. - For user cancellation: throw
new AbortError()—formatErrormaps it to a clean interruption message. - Define custom error types when an error carries structured data that formatting logic needs.
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.
- 2d ago First seen · 134 lines · 87 tokens per session scan A 1758d1b727ae
error-handling is a skill published in the GitHub repository TechyMT/claude-code-superpowers (5 stars, last pushed 5mo ago), licensed MIT. It adds 87 tokens to every session and 1,629 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
book-mirror
Take any book (EPUB/PDF), produce a personalized chapter-by-chapter analysis. Each chapter is preserved in detail (The Chapter) and mirrored back to the reader's actual life (The Mirror) using brain context. The mirror observes and resonates — a friend pointing out parallels, NOT a consultant rearranging the reader's…
ljg-learn
Deep concept anatomist that deconstructs any concept through 8 exploration dimensions (history, dialectics, phenomenology, linguistics, formalization, existentialism, aesthetics, meta-philosophy) and compresses insights into an epiphany. Use when user asks to explain, dissect, or deeply understand a concept, term, or…
eli5
Explain research, papers, or technical ideas in plain English with minimal jargon, concrete analogies, and clear takeaways. Use when the user says "ELI5 this", asks for a simple explanation of a paper or research result, wants jargon removed, or asks what something technically dense actually means.
deck-course-module
暖纸背景 + Playfair, 左侧学习目标常驻, 含 MCQ 自测页.
creating-skills
Guide for creating Claude Code skills following Anthropic's official best practices. Use when user wants to create a new skill, build a skill, write SKILL.md, update an existing skill, or needs skill creation guidelines. Provides structure, frontmatter fields, naming conventions, and new features like dynamic context…
grid-ctf-ops
Operational knowledge for the gridctf scenario including strategy playbook, lessons learned, and resource references. Use when generating, evaluating, coaching, or debugging gridctf strategies.