agentleFS
mdorfmdorf/agent-skills/skills/respawn/SKILL.md

respawn

Skill1 starsChanged 3 months agoMITView on GitHub

Use when the user invokes /respawn, or asks to hand this session off to a fresh one in the same window, reset context without losing state, or continue seamlessly after the context fills up.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. vicnaum/vics-agent-skills★ 53same name
    2. ruben-sj/respawn-skill★ 2same name
    3. yuzhi9257/respawn-skill★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write it for an agent with zero context.

    line 12
  2. Very specific:

    Write preamble + handoff to ~/.claude/respawn-pending.md (overwrite if present).

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Respawn

Hand this session off to a fresh agent in the same window. Two moves: write a complete handoff to a stash file that the next session ingests automatically, and show it to the user for review. The user then runs /clear; a UserPromptSubmit hook injects the stash at the first prompt of the fresh session, with a visible confirmation (sessions that start with nobody typing, like app-relaunch warm sessions, cannot consume it, and ongoing conversations in other windows are skipped).

Step 1: Compose the handoff

Write it for an agent with zero context. Include, in this order:

  1. Task and goal: what this session is doing and why.
  2. State: what is already done, with evidence (files changed, commits, test results, decisions the user approved).
  3. Open items: what remains, in priority order, with enough detail to act on each.
  4. Next step: the single concrete action the new agent should take first.
  5. References: paths, URLs, ticket/PR numbers. Reference artifacts (plans, PRDs, commits, diffs) instead of duplicating their content.
  6. Suggested skills the next agent should invoke, if any.

Redact secrets (API keys, passwords, personal data). If the user passed arguments, treat them as what the next session will focus on and tailor the handoff accordingly.

Step 2: Prepend the resume preamble

The stash must open with instructions to the NEXT agent, above the handoff body:

You are resuming a session via /respawn. The previous agent in this window
wrote the handoff below, then the user cleared the context. If you are
reading this directly from ~/.claude/respawn-pending.md (manual fallback,
no automatic injection), first move that file to ~/.claude/respawn-last.md
so it cannot leak into an unrelated session. Open your first reply with
"Resumed from respawn." followed by one or two short paragraphs: what was
already done, and what remains open. Then continue the work; the handoff's
"Next step" is your starting point. Do not re-litigate decisions recorded
here.

Step 3: Stash, show, arm

  1. Write preamble + handoff to ~/.claude/respawn-pending.md (overwrite if present).
  2. Print the full handoff inline in the reply so the user can review it while this agent can still amend it.
  3. End the reply with exactly this instruction, bolded, as its own final paragraph so it cannot be missed: "Stash armed → run /clear now. (Your first message in the cleared window resumes automatically. Don't prompt a different fresh session in between; the first fresh session you type into consumes the stash.)"
  4. If the user requests changes after reviewing, apply them, rewrite the stash file, reprint the full amended handoff, and end with the same closing instruction. The stash on disk must always match the last handoff shown; the version the user approved is the version the next agent gets.

Requirements and fallback

Automatic injection requires the UserPromptSubmit hook shipped with this skill (see README). If the hook is not installed, or this harness has no hook support (e.g. Codex), say so and fall back: keep the stash file, and replace the closing instruction from step 3 with: "Stash written → run /new now. Then open the fresh chat with: read ~/.claude/respawn-pending.md and continue." Never skip writing the stash; the inline copy disappears when the user resets the window.

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.