# Retry

> Resume and re-run the last task that failed because of a Claude API error or outage (overloaded/529, 500/503, rate limit, network drop, "Claude is down"). Use AFTER the error clears, when the user says "/retry", "retry", "try that again", "it errored, redo it", "pick up where you crashed", or "the API was down, continue". For surviving a live outage unattended, point them at the claude-retry wrap…

- **Type:** Skill
- **Install:** `agentstack add skill-ao92265-claude-code-playbook-retry`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [ao92265](https://agentstack.voostack.com/s/ao92265)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [ao92265](https://github.com/ao92265)
- **Source:** https://github.com/ao92265/claude-code-playbook/tree/main/skills/retry

## Install

```sh
agentstack add skill-ao92265-claude-code-playbook-retry
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Retry After an API Error / Outage

A transient Anthropic API failure (overload, 5xx, rate limit, network blip, or a
full outage) aborts the turn mid-task. This skill cleanly resumes the work that
got cut off — it does NOT start fresh and does NOT re-litigate decisions already
made before the error.

## First: is this actually a retry?

Only proceed if the last failure was **infrastructure**, not the work itself:

- ✅ Retry: `Overloaded`, `429`/`529`, `500`/`503`, `rate_limit`, `fetch failed`,
  `socket hang up`, "Claude is down", the turn just stopped with no result.
- ❌ Not a retry — that's a fix: a test failed, a build broke, wrong output, a
  logic bug. Don't blindly redo it; diagnose. Say so and switch to fixing.

If it's ambiguous, ask the user which it was before acting.

## Procedure

1. **Reconstruct where it died.** Read the last few turns + any handoff/state
   (`.omc/state/`, `.omc/handoffs/`, todos, open files) to find the exact action
   that was in flight when the error hit. Don't assume — verify against the
   actual repo/file state, since a partial write may have landed.

2. **Check for partial work.** `git status --short` and inspect the target
   file(s). The failed action may have half-completed (a file written but not
   verified, a commit started). Reconcile before redoing, so you don't double-apply.

3. **Re-run only the cut-off action**, not the whole task. Pick up from the last
   verified-complete step. If several steps remain, restate the short remaining
   list first so the user can confirm scope.

4. **Verify end-to-end** before claiming done (build/test as the project
   requires) — the interruption means nothing downstream was checked.

## Surviving a LIVE outage (the wrapper)

This skill can't help while the API is actually down — the model isn't running to
invoke it. For that, use the shell wrapper, which relaunches the CLI with
exponential backoff and resumes via `--continue`:

```bash
~/.claude/scripts/claude-retry.sh [any normal claude args]
# e.g.  ~/.claude/scripts/claude-retry.sh -p "finish the migration"
#       ~/.claude/scripts/claude-retry.sh           # interactive TUI
```

It retries only transient failures (overload/5xx/rate-limit/network), backs off
4s→8s→16s… (capped), and stops immediately on auth/credit errors. Suggest a
shell alias for convenience:

```bash
alias claude-r='~/.claude/scripts/claude-retry.sh'
```

Tune via env: `CLAUDE_RETRY_MAX` (default 5), `CLAUDE_RETRY_BASE` (4s),
`CLAUDE_RETRY_CAP` (120s). Log at `~/.claude/claude-retry.log`.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [ao92265](https://github.com/ao92265)
- **Source:** [ao92265/claude-code-playbook](https://github.com/ao92265/claude-code-playbook)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-ao92265-claude-code-playbook-retry
- Seller: https://agentstack.voostack.com/s/ao92265
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
