mcpbeat Sign in

Damage Control Skill for Claude

Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols. Use when an agent session fails or a worktree is corrupted.

9k tokens
context cost
the whole folder, loaded on every use
6
files
instructions only
0
copies elsewhere
how many repositories repackaged it
324
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/athola/claude-night-market --skill damage-control

The instruction itself

10 sections, as written by the author

Table of Contents

  • Overview
  • When To Use
  • When NOT To Use
  • Damage Triage
  • Module Reference
  • Integration Pattern
  • Exit Criteria

Damage Control

Overview

Provides recovery protocols for agents that encounter broken

state mid-session. Damage control covers four failure classes:

agent crashes with partial work on disk, context window overflow

that causes state loss, merge conflicts blocking forward progress,

and general session state corruption requiring reconciliation.

The skill does not prevent failures. It defines what to do after

one has already happened, so recovery is consistent, auditable,

and does not silently discard work.

When To Use

  • An agent process crashed and left files in an unknown state
  • A session hit the context limit and cannot load prior decisions
  • git merge or git rebase produced conflicts the agent cannot

resolve automatically

  • Observed state (files on disk, task list, git index) disagrees

with expected state

  • A downstream agent reports missing artifacts that should have

been produced upstream

When NOT to Use

  • Proactive risk assessment before work starts (use

Skill(leyline:risk-classification) instead)

  • Strategic architectural decisions after a failure (use

Skill(attune:war-room) instead)

  • Routine error handling within a single tool call (use

Skill(leyline:error-patterns) instead)

Damage Triage

Use this decision tree to route to the correct module:

flowchart TD
    A[Failure detected] --> B{Agent process crashed\nor exited unexpectedly?}
    B -->|Yes| C[modules/crash-recovery.md]
    B -->|No| D{Context limit hit or\nprior decisions unavailable?}
    D -->|Yes| E[modules/context-overflow.md]
    D -->|No| F{git merge / rebase /\ncherry-pick conflicts?}
    F -->|Yes| G[modules/merge-conflict-resolution.md]
    F -->|No| H{State internally inconsistent?\ntask list vs disk vs git index}
    H -->|Yes| I[modules/state-reconciliation.md]
    H -->|No| J[No damage-control needed]

When multiple failure types overlap, start with

state-reconciliation.md to establish a known baseline, then

address the specific failure class.

Risk Assessment Checklist

Before executing Level 1+ tasks, complete the risk assessment

checklist from modules/risk-assessment-checklist.md. Answer

these five questions:

  • What could fail in production? List specific failure

scenarios.

  • How would we detect it quickly? Monitoring, alerts,

logs.

  • What is the fastest safe rollback? Step-by-step

procedure.

  • What dependency could invalidate this plan? External

dependencies.

  • What assumption is least certain? Weakest link in

the plan.

Required for Level 1 (Watch) and above. See

modules/risk-assessment-checklist.md for the full template and

examples.

Module Reference

  • crash-recovery.md: Triage, checkpoint inspection, and

safe resume or rollback after an agent crash.

  • context-overflow.md: Procedures for reconstructing

decision context when the window is exhausted.

  • merge-conflict-resolution.md: Classification and

resolution strategies for git conflicts, including

escalation to human review.

  • state-reconciliation.md: Protocol for reconciling

divergent state across task list, git index, and on-disk

artifacts.

  • risk-assessment-checklist.md: Pre-execution checklist for

Level 1+ tasks.

Integration Pattern

# In your skill's frontmatter
dependencies: [leyline:damage-control]

Invoke a specific module when a failure class is identified:

# Crash detected
Skill(leyline:damage-control) → modules/crash-recovery.md

# Context limit reached
Skill(leyline:damage-control) → modules/context-overflow.md

For orchestrators managing multiple agents, invoke

state-reconciliation at session boundaries regardless of whether

a failure occurred. This establishes a verified checkpoint before

the next work phase begins.

Exit Criteria

  • Agent state is unambiguously known (no unknown partial writes)
  • Git index is clean or all conflicts are resolved
  • Task list reflects actual completion status of all tasks
  • All artifacts expected by downstream agents are present and

verified

  • If rollback was taken, the rollback is committed and the

reverted scope is documented in the task list

  • If escalation to human review was required, the escalation

record exists before the session closes

Other skills for the same job

different authors, same section of the catalogue
Hook Development
by anthropics
vendor ×2

This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.

16k tokens scripts
Hook Development
by anthropics
vendor ×2

This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.

16k tokens scripts
Copilot SDK
by christophacham
×2

Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.

6k tokens
Cass
by Dicklesworthstone
×2

Coding Agent Session Search - unified CLI/TUI to index and search local coding agent history from Claude Code, Codex, Gemini, Cursor, Aider, ChatGPT, Pi-Agent, Factory, and more. Purpose-built for AI agent consumption with robot mode.

6k tokens
Dcg
by Dicklesworthstone
×2

Destructive Command Guard - High-performance Rust hook for Claude Code that blocks dangerous commands before execution. SIMD-accelerated, modular pack system, whitelist-first architecture. Essential safety layer for agent workflows.

4k tokens
Makepad Skills
by ComeOnOliver
×2

Makepad UI development skills for Rust apps: setup, patterns, shaders, packaging, and troubleshooting.

2k tokens
Varlock Claude Skill
by ComeOnOliver
×2

Secure environment variable management ensuring secrets are never exposed in Claude sessions, terminals, logs, or git commits

3k tokens
Create Agentsmd
by github
vendor ×1

Prompt for generating an AGENTS.md file for a repository

2k tokens

How to use it

Copy the folder

Take athola/damage-control from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.