Official agent skill

Error Recovery Patterns

by github in github/gh-aw

Design gh-aw error handling, retry, recovery, and debugging flows.

OfficialMITAuto-check passedDevelopment

Install Error Recovery Patterns

skills CLI
$ npx skills add github/gh-aw --skill error-recovery-patterns -a claude-code

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

GitHub CLI
$ gh skill install github/gh-aw error-recovery-patterns --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/github/gh-aw.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.github/skills/error-recovery-patterns .claude/skills/error-recovery-patterns && 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
error-recovery-patterns
GitHub stars
5.4k
Token cost
~824 tokens
SKILL.md length
385 words
Files
1
Skills in repo
52
Repo updated
First seen
Licence
MIT

At a glance

Design gh-aw error handling, retry, recovery, and debugging flows.

  • Works in 5 steps: Circuit Breaker Pattern → Installation Failure Recovery → API Timeout and Rate Limit Handling → …
  • Tasks that involve Error handling
  • SKILL.md covers Purpose, When to Use This Skill, Key Concepts Covered and Anti-Patterns to Avoid, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Error Recovery Patterns is an agent skill from github/gh-aw, published by the product's own GitHub organization. Design gh-aw error handling, retry, recovery, and debugging flows.

Its SKILL.md is about 820 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Error handling, Rate limiting and Debugging. It works with GitHub. The repository describes itself as: GitHub Agentic Workflows. The licence is MIT.

When your agent uses it

  • Tasks that involve Error handling
  • Tasks that involve Rate limiting
  • Tasks that involve Debugging

Example prompts

  • “/error-recovery-patterns”

Requirements

  • Python 3
  • Docker

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Circuit Breaker Pattern
  2. Installation Failure Recovery
  3. API Timeout and Rate Limit Handling
  4. Debug Logging for Recovery
  5. Error Categorization

What it can do on your machine

Read from SKILL.md and the folder at commit a4ca9f2. 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.

    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

Error Recovery Patterns loads about 824 tokens when it runs. Until then it costs about 23 tokens; SKILL.md has 385 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~23
When it runs · the whole SKILL.md, loaded when a task matches
~824

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 github/gh-aw at commit a4ca9f2, republished under its MIT licence (© github). 385 words, ~824 tokens.

Download SKILL.mdSave it as .claude/skills/error-recovery-patterns/SKILL.md (or your agent's skills folder).
name
error-recovery-patterns
description
Design gh-aw error handling, retry, recovery, and debugging flows.

Error Recovery Patterns Skill

Use this skill for error handling, recovery strategies, and debugging in gh-aw.

Purpose

Implement robust recovery patterns to:

  • Reduce retry loops in agent sessions (target: <10% vs current 23%)
  • Implement circuit breakers to prevent infinite retry loops
  • Add proactive recovery for installation, dependency, and API failures
  • Improve debug logging for recovery attempts

When to Use This Skill

Use this skill when:

  • Implementing retry logic for network operations, installations, or API calls
  • Debugging retry loop issues in workflows or agent sessions
  • Adding error recovery patterns to new or existing code
  • Understanding transient vs non-transient error classification
  • Implementing circuit breakers or exponential backoff
  • Adding debug logging for recovery attempts

Key Concepts Covered

1. Circuit Breaker Pattern
  • Maximum retry limits (standard: 3 attempts)
  • Exponential backoff strategies
  • Fail-fast on non-transient errors
  • Implementation in JavaScript, Shell, and Go
2. Installation Failure Recovery
  • NPM installation with cache clearing and registry fallbacks
  • Python pip installation with mirror alternatives
  • Docker image pull with retry and rate limit handling
  • Copilot CLI installation with network retry
3. API Timeout and Rate Limit Handling
  • GitHub API rate limit detection and backoff
  • Transient error detection patterns
  • Custom retry configuration for different APIs
  • Rate limit-specific retry strategies
4. Debug Logging for Recovery
  • Logger package usage for retry attempts
  • Category naming conventions (pkg:filename)
  • DEBUG environment variable patterns
  • Zero-overhead logging when disabled
Show full SKILL.md (164 more words)Show less
5. Error Categorization
  • Transient vs non-transient errors
  • Network errors, timeout patterns
  • HTTP error codes (502, 503, 504)
  • GitHub-specific errors (rate limits, abuse detection)

Anti-Patterns to Avoid

This skill explicitly covers anti-patterns to avoid:

  • ❌ Infinite retry loops without maximum limits
  • ❌ Retrying validation errors that won't self-correct
  • ❌ No backoff delay between attempts
  • ❌ Silent retries without logging
  • ❌ Retrying non-transient errors

Code Examples Provided

The skill includes production-ready examples for:

  • JavaScript retry with withRetry() function
  • Shell script retry loops with exponential backoff
  • Go retry patterns with context and timeouts
  • NPM/pip/docker installation recovery
  • GitHub API rate limit handling
  • Debug logging for all recovery attempts
  • error-messages - Error message formatting and style guide
  • error-pattern-safety - Safety guidelines for error pattern regex
  • developer - General development guidelines and conventions

Full Documentation

Complete documentation available at: ../../scratchpad/error-recovery-patterns.md

This skill references the comprehensive error recovery patterns document which includes:

  • Console formatting requirements
  • Error wrapping patterns
  • Common error scenarios with step-by-step resolution
  • Error message templates
  • Debugging runbook
  • Error categorization decision trees
  • Metrics and monitoring strategies

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

Files

Just SKILL.md in .github/skills/error-recovery-patterns of github/gh-aw.

Open the folder on GitHubat commit a4ca9f2

Compare with similar skills

Error Recovery Patterns 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.

Error Recovery Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Error Recovery Patterns this skillgithub/gh-aw5.4k—~824Automated safety check: PassMIT
Golang Samber Oopscontext-labs/whip1.1k1 repos~2.6kAutomated safety check: PassMIT
Authoring CI WorkflowsPostHog/posthog40k—~12kAutomated safety check: PassCustom licence
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
Exposed Bug Fix WorkflowJetBrains/Exposed9.3k—~3.8kAutomated safety check: PassApache-2.0
OpenCLI Adapter Autofixjackwener/OpenCLI30k1 repos~3.2kAutomated safety check: PassApache-2.0

Similar skills

  • Golang Samber Oops

    context-labs/whip

    Structured error handling in Golang with samber/oops — error builders, stack traces, codes, context, wrapping, attributes, user-facing vs developer messages, panic recovery, logger integration.

    1.1k GitHub starsUsed in 1 repo~2.6k tokens
    DevelopmentAuto-check passed
  • Authoring CI Workflows

    PostHog/posthog

    Official

    A skill your agent uses when adding or editing a GitHub Actions workflow, composite action, or reusable workflow under .github/ — new CI jobs, triggers, matrices, checkout/clone tuning, action…

    40k GitHub stars~12k tokensUpdated today
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Exposed Bug Fix Workflow

    JetBrains/Exposed

    Official

    Takes a GitHub or YouTrack issue for the Exposed project through reproduction, a failing test, a fix, validation and a pull request.

    9.3k GitHub stars~3.8k tokensUpdated today
    DevelopmentAuto-check passed
  • OpenCLI Adapter Autofix

    jackwener/OpenCLI

    Repairs a broken OpenCLI site adapter after a command fails: collects a trace, patches only the adapter, retries, and files an upstream GitHub issue once fixed.

    30k GitHub starsUsed in 1 repo~3.2k tokens
    DevelopmentAuto-check passed
  • Issue Fix

    mono/SkiaSharp

    Fix bugs in SkiaSharp C bindings. An agent skill from mono/SkiaSharp.

    5.6k GitHub stars~5.1k tokensUpdated today
    DevelopmentAuto-check passed

More from github/gh-aw

All 52 skills in this repo
  • Official

    Drives a real browser from the command line with playwright-cli to open pages, interact, mock requests, save state and work with Playwright tests.

    5.4k GitHub starsUsed in 24 repos~2.8k tokens
    Auto-check passed
  • Official

    Designs and verifies a deterministic grader that measures whether a GitHub Agentic Workflow run reached its real-world or repository outcome.

    5.4k GitHub stars~6.8k tokensUpdated today
    Auto-check passed
  • Official

    Scaffolds, edits, reloads and debugs a canvas extension that the GitHub Copilot CLI can open in its side panel.

    5.4k GitHub stars~3.7k tokensUpdated today
    Auto-check passed
  • Official

    Drives an open pull request to merge-ready from inside a GitHub Copilot cloud agent, resolving review threads and local checks concurrently, without merging or retriggering CI.

    5.4k GitHub stars~3.8k tokensUpdated today
    Auto-check: warnings
  • Official

    Bumps gh-aw's pinned gh-aw-firewall version, rebuilds generated artifacts, and flags upstream spec or schema changes that need follow-up work.

    5.4k GitHub stars~899 tokensUpdated today
    Auto-check passed
  • Official

    Guide to the console struct tag system in gh-aw: headers, titles, number and cost formats, omitempty, and how structs, slices and maps render in the terminal.

    5.4k GitHub stars~736 tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Error Recovery Patterns

What does Error Recovery Patterns do?

Design gh-aw error handling, retry, recovery, and debugging flows. Error Recovery Patterns is an agent skill from github/gh-aw, published by the product's own GitHub organization. Design gh-aw error handling, retry, recovery, and debugging flows.

When should I use Error Recovery Patterns?

Error Recovery Patterns fits situations like: tasks that involve Error handling; tasks that involve Rate limiting; tasks that involve Debugging.

How do I install Error Recovery Patterns in Claude Code?

Run `npx skills add github/gh-aw --skill error-recovery-patterns -a claude-code`. Or copy the skill folder (.github/skills/error-recovery-patterns in github/gh-aw) into .claude/skills/error-recovery-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Error Recovery Patterns in Codex?

Run `npx skills add github/gh-aw --skill error-recovery-patterns -a codex`. Or copy the skill folder (.github/skills/error-recovery-patterns in github/gh-aw) into .agents/skills/error-recovery-patterns in your project. Codex loads it when a task matches its description.

Can I use Error Recovery Patterns 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 github/gh-aw --skill error-recovery-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/error-recovery-patterns, .gemini/skills/error-recovery-patterns, .github/skills/error-recovery-patterns and .opencode/skills/error-recovery-patterns in your project.

What does Error Recovery Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Error Recovery Patterns is instructions for the agent only. Our summary lists: Python 3; Docker.

Does Error Recovery Patterns 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 Error Recovery Patterns 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 Error Recovery Patterns use?

Error Recovery Patterns 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 Error Recovery Patterns use?

About 824 tokens (SKILL.md is roughly 3.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Error Recovery Patterns?

Skills that share tags, products or a category with Error Recovery Patterns: Golang Samber Oops (context-labs/whip, 1.1k stars), Authoring CI Workflows (PostHog/posthog, 40k stars), Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars) and Exposed Bug Fix Workflow (JetBrains/Exposed, 9.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Error Recovery Patterns?

github (a GitHub organization, an official publisher) maintains it in github/gh-aw, which has 5,359 GitHub stars. The repository holds 52 skills in this directory. The repository was last updated on October 8, 2026.

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