ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

damage-control

Recover from broken agent state including crash recovery, context overflow, merge conflicts, and corrupted worktrees

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/athola/nm-leyline-damage-control
Or

Night Market Skill — ported from claude-night-market/leyline. For the full experience with agents, hooks, and commands, install the Claude Code plugin.

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:

Metadata

Author@athola
Stars4473
Views1
Updated2026-05-01
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-athola-nm-leyline-damage-control": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.