Agent skill

Damage Control

by athola in athola/claude-night-market

Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols.

MITAuto-check passedDevelopment

Install Damage Control

skills CLI
$ npx skills add athola/claude-night-market --skill damage-control -a claude-code

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

GitHub CLI
$ gh skill install athola/claude-night-market damage-control --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/athola/claude-night-market.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/leyline/skills/damage-control .claude/skills/damage-control && 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
damage-control
GitHub stars
342
Used in
1 other repo
Token cost
~1.3k tokens
SKILL.md length
452 words
Files
6
Skills in repo
159
Repo updated
First seen
Licence
MIT

At a glance

Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols.

  • Works in 5 steps: What could fail in production? List… → How would we detect it quickly?… → What is the fastest safe rollback?… → …
  • An agent session fails
  • SKILL.md covers Overview, When To Use, When NOT to Use and Damage Triage, plus 4 more sections
  • Calls git

What it does

Damage Control is an agent skill from athola/claude-night-market. Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols. Use when an agent session fails or a worktree is corrupted.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files (for example `modules/context-overflow.md`, `modules/crash-recovery.md` and `modules/merge-conflict-resolution.md`).

It sits in Development, covering Git workflow and Git worktrees. It works with Git. The repository describes itself as: 23 Claude Code plugins: TDD enforcement hooks, git/PR workflows, spec-driven development, code review, project lifecycle, fix-from-error, maintenance automation, context… The licence is MIT.

When your agent uses it

  • An agent session fails
  • A worktree is corrupted

Example prompts

  • “Use the damage-control skill to recover broken agent state via crash recovery, context overflow, and merge conflict protocols”
  • “/damage-control”

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. What could fail in production? List specific failure
  2. How would we detect it quickly? Monitoring, alerts,
  3. What is the fastest safe rollback? Step-by-step
  4. What dependency could invalidate this plan? External
  5. What assumption is least certain? Weakest link in

What it can do on your machine

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

    Shell commands in SKILL.md call:

    • git

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    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

Damage Control loads about 1.3k tokens when it runs. Until then it costs about 43 tokens; SKILL.md has 452 words of instructions outside code blocks.

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

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 athola/claude-night-market at commit 9f3eb00, republished under its MIT licence (© athola). 452 words, ~1,304 tokens.

Download SKILL.mdSave it as .claude/skills/damage-control/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
damage-control
description
Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols. Use when an agent session fails or a worktree is corrupted.
alwaysApply
false
category
infrastructure
tags
recovery, resilience, crash, context, conflicts, state
dependencies
error-patterns
provides.infrastructure
crash-recovery-protocol, context-overflow-protocol, merge-conflict-resolution, state-reconciliation
provides.patterns
damage-triage, recovery-checkpoints
usage_patterns
agent-crash-recovery, context-limit-handling, conflict-resolution, session-state-repair
complexity
intermediate
model_hint
standard
estimated_tokens
450

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:

mermaid
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:

  1. What could fail in production? List specific failure scenarios.
  2. How would we detect it quickly? Monitoring, alerts, logs.
  3. What is the fastest safe rollback? Step-by-step procedure.
  4. What dependency could invalidate this plan? External dependencies.
  5. 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.

Show full SKILL.md (171 more words)Show less

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

yaml
# 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

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

Files

SKILL.md and 5 other files in plugins/leyline/skills/damage-control of athola/claude-night-market.

  • SKILL.md
  • modules/context-overflow.md
  • modules/crash-recovery.md
  • modules/merge-conflict-resolution.md
  • modules/risk-assessment-checklist.md
  • modules/state-reconciliation.md

Open the folder on GitHubat commit 9f3eb00

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in athola/claude-night-market, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Damage Control 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.

Damage Control compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Damage Control this skillathola/claude-night-market3421 repos~1.3kAutomated safety check: PassMIT
Finishing a Development Branchobra/superpowers296k5 repos~1.9kAutomated safety check: PassMIT
Git Worktree Cleanuplobehub/lobehub83k—~2.8kAutomated safety check: PassCustom licence
Ccmanager Configkbwo/ccmanager1.3k—~1.5kAutomated safety check: PassMIT
Git Worktree Managermicrosoft/WindowsAppSDK4.7k—~2kAutomated safety check: PassMIT
Git Committisfeng/Easydict15k—~535Automated safety check: PassGPL-3.0

Similar skills

  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    296k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Git Worktree Cleanup

    lobehub/lobehub

    Audits stale Git worktrees and branches with a bundled script, classifies each one, and deletes only after you approve the exact candidates.

    83k GitHub stars~2.8k tokensUpdated today
    DevelopmentAuto-check passed
  • Ccmanager Config

    kbwo/ccmanager

    Set up, review, or repair a CCManager config — .ccmanager.json at a git repository root, or the global ~/.config/ccmanager/config.json.

    1.3k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Git Worktree Manager

    microsoft/WindowsAppSDK

    Official

    Creates and manages Git worktrees with PowerShell scripts so separate issues and Copilot sessions each get an isolated branch, build and test environment.

    4.7k GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Git Commit

    tisfeng/Easydict

    起草、创建或汇报 Angular-style 本地 Git 提交。用于明确的提交交付;分支集成使用 worktree-rebase-merge,不 push。

    15k GitHub stars~535 tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Git Worktree Isolation

    jnMetaCode/superpowers-zh

    Sets up an isolated workspace before feature work or plan execution, preferring native worktree tools and falling back to git worktree, with instructions in Chinese.

    8.3k GitHub starsUsed in 1 repo~982 tokens
    DevelopmentAuto-check passed

More from athola/claude-night-market

All 159 skills in this repo
  • Night Market Diagnostics Toolkit

    athola/claude-night-market

    Run and interpret repo diagnostic scripts (ratchets, validators, token stats).

    342 GitHub stars~3.4k tokensUpdated 2 days ago
    Auto-check passed
  • Skills Eval

    athola/claude-night-market

    Evaluate Claude skill quality through auditing. An agent skill from athola/claude-night-market.

    342 GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed
  • Agent Teams

    athola/claude-night-market

    Coordinates Claude agent teams via filesystem protocol. An agent skill from athola/claude-night-market.

    342 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Delegation Core

    athola/claude-night-market

    Delegates execution to eight CLIs (Gemini, Qwen, MiniMax, GLM, Muse, Codex, OpenCode, Glimmer).

    342 GitHub stars~2.5k tokensUpdated 2 days ago
    Auto-check passed
  • Elegant Code

    athola/claude-night-market

    Guide minimal code via a decision ladder with full safety, edge, and negative-case coverage.

    342 GitHub stars~2.1k tokensUpdated 2 days ago
    Auto-check passed
  • Skill Library Mission

    athola/claude-night-market

    Build a project skill library in .claude/skills/ via discovery, parallel authoring, and review.

    342 GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed

Works with

Categories

Questions about Damage Control

What does Damage Control do?

Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols. Damage Control is an agent skill from athola/claude-night-market. Recovers broken agent state via crash recovery, context overflow, and merge conflict protocols.

When should I use Damage Control?

Damage Control fits situations like: an agent session fails; A worktree is corrupted.

How do I install Damage Control in Claude Code?

Run `npx skills add athola/claude-night-market --skill damage-control -a claude-code`. Or copy the skill folder (plugins/leyline/skills/damage-control in athola/claude-night-market) into .claude/skills/damage-control in your project. Claude Code loads it when a task matches its description.

How do I install Damage Control in Codex?

Run `npx skills add athola/claude-night-market --skill damage-control -a codex`. Or copy the skill folder (plugins/leyline/skills/damage-control in athola/claude-night-market) into .agents/skills/damage-control in your project. Codex loads it when a task matches its description.

Can I use Damage Control 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 athola/claude-night-market --skill damage-control -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/damage-control, .gemini/skills/damage-control, .github/skills/damage-control and .opencode/skills/damage-control in your project.

What does Damage Control need to run?

Going by SKILL.md and its folder, Damage Control needs the command-line tools its instructions call (git).

Does Damage Control access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Damage Control 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 Damage Control use?

Damage Control 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 Damage Control use?

About 1.3k tokens (SKILL.md is roughly 5.2k 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 Damage Control?

Skills that share tags, products or a category with Damage Control: Finishing a Development Branch (obra/superpowers, 296k stars), Git Worktree Cleanup (lobehub/lobehub, 83k stars), Ccmanager Config (kbwo/ccmanager, 1.3k stars) and Git Worktree Manager (microsoft/WindowsAppSDK, 4.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Damage Control?

athola (a GitHub user) maintains it in athola/claude-night-market, which has 342 GitHub stars. The repository holds 159 skills in this directory. The repository was last updated on October 6, 2026.

Source: athola/claude-night-market on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.