API Error Handling
HTTP status codes, error response formats, recovery guidance, and client error handling.
Install
/plugin marketplace add sethdford/claude-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add sethdford/claude-skills --skill api-error-handlinggit clone --depth 1 https://github.com/sethdford/claude-skills.git /tmp/claude-skills
mkdir -p ~/.claude/skills
cp -r /tmp/claude-skills/engineer/api-development/skills/api-error-handling ~/.claude/skills/api-error-handlingPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# API Error Handling
Communicating errors clearly so clients can recover.
## Context
You are designing error responses. Be specific; help clients recover.
## Domain Context
- **Status Codes**: 4xx (client) vs 5xx (server)
- **Error Format**: Consistent structure across all APIs
- **Specific Codes**: 400 (bad request), 401 (auth), 403 (forbidden), 404 (not found), 429 (rate limited)
- **Retry Guidance**: Transient errors are retryable; permanent are not
- **Request ID**: Include for debugging production issues
## Instructions
1. **Use Right Status Code**: 4xx for client, 5xx for server
2. **Consistent Format**: {"error": {"code": "...", "message": "...", "details": {}}}
3. **Specific Codes**: "INVALID_EMAIL" not "bad request"
4. **Retry Guidance**: Include Retry-After header
5. **Request ID**: Include X-Request-ID for tracing
6. **Human & Machine**: Message for humans, code for machines
7. **Document**: Every error should be documented
## Anti-Patterns
- Same error format for all errors; hard for clients to handle
- 500 for client errors; 4xx/5xx distinction matters
- No error codes; clients parse message strings (fragile)
- No Retry-After header; clients guess when to retry
- Changing error format; breaking change, no warning
## Further Reading
- HTTP status code spec (RFC 7231)
- Problem Details for HTTP APIs (RFC 7807)
- Error handling patterns (Google API Design Guide)Details
- Skill name
api-error-handling- Repository
- sethdford/claude-skills
- Path
engineer/api-development/skills/api-error-handling/SKILL.md- License
- MIT
- Repo updated
- 11 March 2026
FAQ
What does the API Error Handling skill do?
HTTP status codes, error response formats, recovery guidance, and client error handling.
How do I install the API Error Handling skill?
Claude Code plugin: /plugin marketplace add sethdford/claude-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is API Error Handling popular?
It lives in sethdford/claude-skills, which has 48 GitHub stars and 10 forks.
Related skills
A B Test Design
48sethdford/claude-skills
Design rigorous A/B tests with hypotheses, variants, metrics, and sample size calculations.
A B Test Design Pm
48sethdford/claude-skills
Analytics and experimentation skill for product managers.
Abuse Case Design
48sethdford/claude-skills
Design abuse cases (negative use cases) showing how attackers misuse system features. Use when identifying attacks that exploit intended functionality or business logic flaws.
API Gateway Design
48sethdford/claude-skills
Design API gateways that route, authenticate, rate-limit, and aggregate backend services. Use when building client-facing APIs or managing service boundaries.
Transit Least Squares
49UCSB-NLP-Chang/Skill-Usage
Transit Least Squares (TLS) algorithm for detecting exoplanet transits in light curves. Use when searching for transiting exoplanets specifically, as TLS is more sensitive than Lomb-Scargle for transit-shaped signals. Based on the transitleastsquares Python package.
API Mock Strategy
48sethdford/claude-skills
Expert approach to api-mock-strategy in API testing. Use when working with .
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.