error-handling

Shared instructions for deciding what an agent should do when something fails. They cover missing data, temporary service failures, and authentication problems, as well as when an agent must read source files before answering.

In plain words
What is it for?
Use them when defining failure behavior for agents that handle financial, legal, factual, or other sensitive outputs.
Why use it?
They make error responses more consistent and help prevent an agent from guessing when a required source or service is unavailable.

Agent for Claude Code

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 agents/chacosoldier/compabob/error-handling
Clone the repo
git clone --depth 1 https://github.com/chacosoldier/compabob

Made for: Claude Code.

Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 910 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.00000 $0.00910
Opus 5 $0.00000 $0.00455
Sonnet 5 $0.00000 $0.00182
Haiku 4.5 $0.00000 $0.00091

Measured 2d ago against content hash 71c9bfc23779, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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.

.claude/agents/error-handling.md · 78 lines

How it starts

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

Error Handling (shared across agents)

Every agent follows these patterns when something fails. Reference this file from each agent's instructions.

Read-Before-Speak gate (stakes-sensitive agents)

For any agent whose wrong output drives a wrong real-world action (a financial figure, a legal claim, a commitment in a draft), apply a hard structural gate at the top of the agent file:

  1. Read the named source files BEFORE producing output that cites a number, fact, or recommendation.
  2. Declare what was loaded at the top of the response: Context loaded: [list].
  3. If a required read fails, STOP and report the missing source. Do not substitute general knowledge or stale memory.

This is stronger than a self-check at the bottom of a file, which the model may skim past.

Error classification

Type Examples Action
Transient Timeout, rate limit, 429/503/504 Retry once after 5s. If it fails again, tell the user and suggest retrying later.
Auth 401, expired token, permission denied Do NOT retry. Tell the user which service needs re-authentication.
Data Empty result, unexpected schema, null fields Check the query syntax. If the query is valid, report "no data found" with the query used.
Semantic Query returns wrong-looking numbers, request misinterpreted Self-check before presenting. Flag: "These numbers look unusual, please verify."
Not found Record or file does not exist Confirm the name or ID with the user before retrying with a different search.

Never retry: auth errors, permission errors, not-found errors, validation errors. Always retry once: timeouts, rate limits, service-unavailable, connection reset.

Fallback chains

When a primary source is unavailable, fall back and say so:

  • An external connector fails → work from local files; note "[connector] unavailable, working from cached data".
  • A search index fails → fall back to plain Grep; note that results are keyword-only.
  • A notification channel fails → log the action locally so it is not lost.

Read the full file on GitHub · 78 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. 2d ago First seen · 78 lines · 0 tokens per session scan A 71c9bfc23779

Subscribe to this mod's changes

error-handling is an agent published in the GitHub repository chacosoldier/compabob (32 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 910 tokens. 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 agents, from other repositories

build-error-resolver

빌드 실패·타입 에러·컴파일 오류·import 에러·의존성 이슈를 최소 변경으로 그린 복구. 리팩토링·아키텍처 변경 절대 금지. Use proactively when CI/빌드가 빨간불이거나, 터미널에 타입 에러·컴파일 에러가 표시될 때 즉시. 런타임 로직 버그는 systematic-debugger, 아키텍처 변경은 architect 사용.

sangrokjung/claude-forge · 106 tokens

verify-agent

구현 완료 후 fresh-context 검증 전용. typecheck → lint → build → test 파이프라인 독립 실행. 단순 에러(import·타입) 자동 수정, 비수정 가능 에러 분류 보고. Use proactively — 비단순 코드 변경 완료 직후 사람 호출("검증해줘"·"빌드 확인")을 기다리지 말고 자율 spawn한다. 완료 주장 전 필수(verification.md 자율 검증 §11). 사람 발화에 의존하지 않는다. /handoff-verify 스킬에서도 자동 스폰. 구현 자체는 tdd-guide나 impl-worker 사용.

sangrokjung/claude-forge · 134 tokens

strategic-advisor

Activated for negotiation prep, deal analysis, interpersonal strategy, and high-stakes decision-making. Combines game theory with psychological awareness.

winstonkoh87/Athena-Public · 31 tokens

integration-reviewer

Runtime integration validator — read-only. Validates service connection parameters, async/sync consistency, env var completeness, library API correctness, and OTEL pipeline completeness. Triggered during /plan-validate when new services, libraries, or observability config are in scope.

FlorianBruniaux/claude-code-ultimate-guide · 57 tokens

planner

Strategic planning agent — read-only exploration before implementation. Use to decompose tasks, analyze codebases, and produce a detailed plan. Never modifies files.

FlorianBruniaux/claude-code-ultimate-guide · 33 tokens

devops

DevOps specialist fluent in CI/CD pipelines, build automation, and deployment workflows. Thinks in reliability, security, and developer experience. Designs GitHub Actions, configures build systems, manages secrets. Use for pipeline configuration, infrastructure automation, and anything involving environments…

rjmurillo/ai-agents · 63 tokens