Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Recover Agent Work

ASecurity

Recover the uncommitted work of a background or subagent that died, was rate-limited, crashed, timed out, or was interrupted mid-task, instead of re-running it from scratch. Use when an implementer agent stopped without opening its PR, when you see a rate-limit or crash on a spawned agent, or when a worktree has changes but no commit. The work is almost always still on disk in the agent's worktree.

2 stars
0 votes
0 copies
0 views
Added 9/28/2026
ai-agentsgogit

Security Analysis

A100/100

Scanned 9/28/2026

Install to Claude Code

$npx -y skills add Dusttoo/orka --skill recover-agent-work --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Recover Agent Work?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Recover Agent Work
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dusttoo-recover-agent-work/badge)](https://www.skillsdirectory.com/skills/dusttoo-recover-agent-work)

More formats (shields.io, HTML) on the badges page.

Files
SKILL.md
---
name: recover-agent-work
description: Recover the uncommitted work of a background or subagent that died, was rate-limited, crashed, timed out, or was interrupted mid-task, instead of re-running it from scratch. Use when an implementer agent stopped without opening its PR, when you see a rate-limit or crash on a spawned agent, or when a worktree has changes but no commit. The work is almost always still on disk in the agent's worktree.
---

# Recover a dead agent's work

When a background agent dies (rate limit, crash, timeout, interruption), its work
is not lost. It is sitting UNCOMMITTED in its git worktree. Cleanup defaults to
manual; even under `worktree_cleanup: auto`, the explicit cleanup and optional
`Stop`-hook sweep skip dirty or locked worktrees, precisely so a dead-mid-edit
agent's changes survive for recovery. Do not
re-run the ticket from scratch; recover what is already there.

## The key facts

- A finished, clean agent worktree may be swept only under `auto`. A dirty one is preserved. So if the
  agent got far enough to write files, they are still on disk.
- Branch refs live in the shared `.git`. If the agent committed but did not push,
  the commit is safe even if the worktree were removed.
- The work must be committed **from inside the worktree path**, not from the main
  repo checkout. Committing from the wrong working directory is how recovered
  work gets stranded on the wrong branch or lost again.

## Procedure

1. **Find the worktree.** List them and locate the agent's:
   ```
   git worktree list
   ```
   Agent worktrees live under the configured `worktree_base` (default
   `.claude/worktrees/`) with an `agent-*` name. Match it to the ticket.

2. **See what survived.** Inspect the worktree's tree without changing directory
   into the main repo:
   ```
   git -C <worktree> status
   git -C <worktree> diff
   ```
   Uncommitted changes here are the recoverable work.

3. **Read the agent's intent.** If a transcript or task output for the dead agent
   is available, read it for how far it got and what its own verdict was (tests
   passing, PR intended, blockers hit). Recover to the state it was aiming for,
   not a guess.

4. **Commit from the worktree.** Run the commit with the worktree as the working
   directory, so it lands on the agent's branch:
   ```
   git -C <worktree> add -A
   git -C <worktree> commit -m "<conventional message referencing the ticket>"
   ```
   Before committing, make the work actually mergeable: run the repo's
   `self_check` commands from config in the worktree, and finish anything the
   agent left half-done. A recovered commit still has to pass the same gates.

5. **Open the PR yourself.** Push the branch and open the PR to the configured
   target branch role, exactly as the implementer would have:
   ```
   git -C <worktree> push -u origin HEAD
   gh pr create --base <configured-target-branch> ...
   ```
   Then it re-enters the normal pipeline at the gate stage.

## Do not

- Do not `cd` into the main repo and commit there; the changes are in the
  worktree, on the agent's branch.
- Do not delete or force-remove the worktree until the work is committed and
  pushed. `git worktree remove --force` on a dirty worktree discards exactly the
  work you are trying to save.
- Do not restart the ticket from an empty branch when a dirty worktree exists;
  that duplicates effort and risks two branches for one ticket.

Attribution

DusttooDusttoo
View sourceMore from Dusttoo →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Ultra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".

1074701 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

695601 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3351 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

691 votes

math-skill

A comprehensive mathematical reasoning skill for AI assistants — handles arithmetic to research-level problems with rigorous step-by-step reasoning, systematic verification, and transparent uncertainty handling

381 votes
View all in ai-agents →