agentleFS
strikersamstrikersam/autonomous-ai-agency/.claude/skills/cooldown-resume/SKILL.md

cooldown-resume

Skill12 starsChanged 29 days agoMITView on GitHub

Resume an interrupted AI coding session after token exhaustion, rate limiting, or process restart. Use when a session was interrupted mid-task.

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 8 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill immediately after:

    line 25
  2. Distinctive:

    If a file appears partially written:

    line 65
  3. Distinctive:

    Read the file fully.

    line 66
  4. Distinctive:

    If tests fail after resuming:

    line 76
  5. Distinctive:

    Read the test error carefully.

    line 77
  6. Distinctive:

    Check if it is related to a partial change from the interrupted session.

    line 78
  7. Very specific:

    After each sub-step completes, append to .claude/state/checkpoint.jsonl:

    line 84
  8. Very specific:

    Update next_step to the following step

    line 92
  9. Very specific:

    Never re-apply a step that is already in completed_steps.

    line 108
  10. Distinctive:

    If a file already has the expected content, skip the write — do not overwrite.

    line 109
  11. Distinctive:

    Use git diff to confirm a change was actually needed before applying.

    line 110

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: cooldown-resume

When to Use

Use this skill immediately after:

  • A coding session was interrupted by token exhaustion
  • Rate limiting or quota exhaustion stopped a task
  • A process restart wiped in-memory state
  • You are starting a new session and need to continue previous work

Instructions

Step 1 — Read the checkpoint files

# Human-readable next action
cat .claude/state/NEXT_ACTION.md

# Machine-readable full state
cat .claude/state/agent-state.json

# Ordered log of completed steps
cat .claude/state/checkpoint.jsonl

Or use the AI runner:

python scripts/ai_runner.py status

Step 2 — Assess the state

From agent-state.json, determine:

  • completed_steps — what is already done (do NOT redo these)
  • next_step — what to do next
  • changed_files — what files were modified (check their current state)
  • pending_risks — any known issues or blockers

Step 3 — Verify changed files are correct

For each file in changed_files, read the current content to confirm the change was fully applied (not half-written due to interruption).

If a file appears partially written:

  1. Read the file fully.
  2. Compare with what the step description says it should contain.
  3. Complete or revert the partial change before continuing.

Step 4 — Run tests to confirm baseline

pytest -x

If tests fail after resuming:

  1. Read the test error carefully.
  2. Check if it is related to a partial change from the interrupted session.
  3. Fix the partial change, then re-run tests.

Step 5 — Continue from next_step

Execute only the steps that are NOT in completed_steps. After each sub-step completes, append to .claude/state/checkpoint.jsonl:

{"ts":"<ISO8601>","step":"<step-id>","status":"done","detail":"<what was done>"}

And update .claude/state/agent-state.json:

  • Move the step from plan to completed_steps
  • Update next_step to the following step
  • Update last_updated

Step 6 — Use the watchdog for future sessions

For long tasks, start with the AI runner watchdog to get automatic resume:

python scripts/ai_runner.py start --session my-task "instruction here"

The watchdog monitors for interruptions and resumes automatically. See docs/runbooks/auto-resume.md for full documentation.

Idempotency Rules

  • Never re-apply a step that is already in completed_steps.
  • If a file already has the expected content, skip the write — do not overwrite.
  • Use git diff to confirm a change was actually needed before applying.

Acceptance Checks

  • agent-state.json was read and current state understood
  • checkpoint.jsonl reviewed to confirm which steps are truly done
  • No completed step was repeated
  • Tests pass after resuming
  • agent-state.json updated with resumed progress
  • NEXT_ACTION.md updated to reflect current next step

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.