Логотип Respawn

Respawn

Сообщество
vicnaum
respawn

Restart the current Claude Code or Codex CLI in its own terminal (iTerm2 window or tmux pane), or the current Claude Code background session (claude --bg / ←, no terminal), and resume a session — the external relaunch step an agent cannot perform on itself. Use when: (1) the session's context is nearly full and was just stripped with session-stripper, so the stripped pending copy must be swapped in (--swap) and the CLI restarted to load the smaller transcript, (2) resuming a forked stripped session under a new session id, (3) the user or the agent says respawn, restart yourself, restart the CLI, reload the session, or resume after strip. Backends: iTerm2 (macOS), tmux (works headless, e.g. Linux servers) and Claude Code background sessions.

Обзор

Издательvicnaum
Репозиторийvics-agent-skills
Название навыкаrespawn
Звёзды
53
Форки
5
Файлы в комплекте
2
Ссылки
  • Инструкции в формате Markdown

    Модель загружает файл SKILL.md по мере необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой большой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 2

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Издатель навыка на GitHub — vicnaum. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Respawn в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/vicnaum/vics-agent-skills/tree/main/skills/respawn
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Добавить навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/vicnaum/vics-agent-skills.git /tmp/vics-agent-skills
mkdir -p .claude/skills
cp -r /tmp/vics-agent-skills/skills/respawn .claude/skills/respawn
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Respawn в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Respawn, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Respawn не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими ключами API.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Respawn

Restarts the calling Claude Code or Codex CLI in its verified iTerm2 session or tmux pane, or the calling Claude Code background session through its daemon, and resumes a session. Requires the companion agent-chat skill/CLI, which provides the shared identity and terminal ownership checks. Companion to session-stripper: a CLI restart loads the stripped transcript as smaller context.

Workflow (context nearly full)

Run inside the session that needs restarting:

  1. Strip first — use the session-stripper skill. Its mutating commands are copy-first: they write <session>.jsonl.pending and never touch the live file, so stripping your own running session is safe. Verify the pending copy. (If stripping forked to a NEW session id instead, note that id for step 2 — forks need no swap.)
  2. Schedule the respawn — this must be the LAST tool call of the turn:
bash
<skill-dir>/scripts/respawn.sh --swap <session.jsonl>.pending   # stripped in place: swap + resume this session's id
<skill-dir>/scripts/respawn.sh <new-session-id>                 # forked strip: resume the fork (no swap)
<skill-dir>/scripts/respawn.sh                                  # plain restart, nothing to swap
  1. End the turn immediately — reply with one short line (e.g. "Respawning now, back shortly") and stop. Do not keep working after scheduling a real respawn. The watcher will recheck ownership, then stop the captured CLI. A dry run does not schedule anything and need not be the last tool call.

--swap applies the session surgery at the only race-free moment: after the watcher has confirmed the CLI process is dead, before relaunch. It runs session-stripper's apply (atomic rename; refuses on lineage/liveness/verify failures). If apply refuses, the watcher relaunches the UNSTRIPPED session and rewrites the kickoff prompt to say so — fail-open, nothing is lost. Whatever the CLI appended after the snapshot (the stripping turn itself) is discarded by design.

How it works

respawn.sh asks agent-chat whereami for the calling CLI, session and pane. It uses the sibling checkout's CLI when available, so an older PATH install cannot bypass the guard. Conflicting inherited session variables are resolved through the nearest CLI ancestor; ambiguous identity refuses. The scheduler verifies the foreground session and captures its pid/birth time, tty, and parent shell pid/birth time before detaching the watcher. The resume id may differ after a fork; the identity stopped is always the original calling session.

For Claude Code, the launch command is rebuilt from its exact argv (sysctl on macOS, /proc on Linux; ps joins arguments and loses quoting). Flags are preserved except session/worktree selectors: -c/--continue, -r/--resume [id], --from-pr [ref], --session-id <id>, --fork-session, -w/--worktree [name]/--tmux, --bg. Any prompt the CLI was launched with is dropped too; agents started by agent-chat carry their kickoff there. Then --resume <sid> is appended. --cmd "claude ..." overrides reconstruction.

The detached watcher then:

  1. Waits --grace N seconds (default 15), then verifies the original foreground session and process identity again. A changed thread, replaced process or pane causes refusal before input/signals. A CLI that already exited is accepted only in its verified original shell.
  2. Stops the captured CLI: Codex receives SIGTERM by verified pid, with no terminal quit keys. Claude receives /exit plus a separately guarded Enter; it can queue until turn end. When background shells or agents are running, Claude Code then asks "Background work is running": 1. Exit and stop tasks / 2. Move to background and exit / 3. Stay. The watcher confirms the default with Enter, and only while the selection is on "Exit and stop tasks". Those shells die with the CLI, and the default kickoff tells the agent to re-arm the ones it needs, such as an agent-chat watch. The watcher waits up to 15 minutes, or 20s with --force, and rechecks ownership before signal escalation. It never retargets a different pid that appeared on the tty.
  3. With --swap, applies the pending Claude transcript only after the original CLI is gone. On apply refusal it retains the original and rewrites the kickoff to explain that the session is unstripped.
  4. Verifies the original foreground shell before typing the launch line and again before Enter. The kickoff is a quoted command-line argument, including after a failed swap; nothing is typed into a booting TUI.
  5. Waits up to 60s for the resumed session to be proved in the same pane under the original shell. Startup failure or a dialog produces a logged failure and no additional input.

Log: ~/.claude/respawn/respawn.log.

Claude Code background sessions

A session started with claude --bg, or moved there with ← or /background, has no pane: its worker runs on a pty the daemon owns. Typing /exit in a terminal attached to it only detaches, and claude --resume <id> refuses while it runs. agent-chat whereami reports it as bg <job>, and the proof is Claude Code's own live record (pid, start time, job). The watcher:

  1. After the grace period, re-proves the worker and waits until the session reports idle, so its last reply is never cut off (up to 15 minutes, or 20s with --force).
  2. Records every terminal running claude attach <job> directly under a shell, then runs claude stop <job> and waits for the worker to exit. It then waits for the daemon's bg settled <job> line: a wake sent before that starts a copy under a new id instead of resuming.
  3. Applies --swap while nothing runs, as in the terminal flow.
  4. Runs claude --bg --resume <sid> '<kickoff>'. The daemon wakes the same job with its saved options. A forked strip resumes the new id with the job's saved options passed explicitly. If the daemon reports that it started a copy, the watcher stops and logs it.
  5. Verifies the new worker holds the session, then types claude attach <job> back into each recorded terminal, but only once its old client has exited and its original shell is at the prompt.

Claude Code's built-in claude respawn <job> restarts a background worker (e.g. onto a new version) in one step. That leaves no moment to swap a transcript, so this skill does not use it.

OpenAI Codex sessions

Codex resumes with codex resume <thread-id> '<kickoff>'. Settings come from Codex configuration; use --cmd "codex --profile x" when an explicit profile/flags are needed. Only self-respawn when about to end the turn: stopping the frontend interrupts interactive use.

Codex tool shells run in a shared daemon, so terminal environment variables and tty ancestry cannot select this session's pane. A unique current thread-id title is required. Run agent-chat setup-codex --title-id, restart the affected TUI, then register. Original launch arguments, registration text and cached bindings are insufficient after a thread switch. The watcher checks the same current-thread evidence again after its delay. There is no ownership override.

Verification / caveats

  • --dry-run synchronously verifies the pane, session, process and parent shell and prints the proposed restart. It starts no watcher and sends no input/signals or swaps.
  • Avoid scheduling while a human is editing that terminal. Ownership checks do not preserve a draft already sitting at its prompt.
  • After a forked strip (new session id), anything keyed to the old id (e.g. an agent-chat registration) is stale — redo it in the resumed session.

The shared regression suite is python3 -m unittest discover -s skills/agent-chat/tests -v from the repository root. Unit tests mock terminal and signal operations; an optional private-tmux test uses a dummy TUI. They exercise successful restarts and changed-session, PID-reuse, failed-startup, failed-write and swap-refusal paths without contacting real agents.

Файлы в комплекте

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Respawn?

Restart the current Claude Code or Codex CLI in its own terminal (iTerm2 window or tmux pane), or the current Claude Code background session (claude --bg / ←, no terminal), and resume a session — the external relaunch step an agent cannot perform on itself. Use when: (1) the session's context is nearly full and was just stripped with session-stripper, so the stripped pending copy must be swapped in (--swap) and the CLI restarted to load the smaller transcript, (2) resuming a forked stripped session under a new session id, (3) the user or the agent says respawn, restart yourself, restart the...

Зачем использовать Respawn в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Respawn — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Respawn в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/vicnaum/vics-agent-skills/tree/main/skills/respawn. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Respawn?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Respawn?

С любым количеством. В TypingMind вы можете использовать Respawn с любой моделью, которая поддерживает навыки, в том числе с GPT, Claude, Gemini, Grok, DeepSeek, Mistral и Llama. Для этого вы используете собственные ключи API.

Бесплатен ли навык ИИ Respawn?

Навык опубликован на GitHub. Издатель — vicnaum. Условия лицензии можно найти в репозитории. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это набор инструкций, которыми модель ИИ может пользоваться каждый раз, когда ей нужно выполнить конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты, которые она может вызывать: при вызове где-то выполняется код и возвращает результат. Навык ИИ, напротив, даёт модели знания и описывает порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все
Логотип anthropics

Docx

anthropics
ОрганизацияПопулярный

Используйте этот навык для создания, чтения, редактирования и обработки документов Word (.docx) и шаблонов Word (.dotx). Поводом могут быть любые упоминания «документа Word», «файла Word»,…

21.8K
184K
Файлы: 59
Открыть
Логотип openclaw

Openclaw Docker E2e Authoring

openclaw
ОрганизацияПопулярный

Создавайте Docker-сценарии E2E для OpenClaw и Docker-сценарии live-провайдеров.

82.2K
391K
Инструкции
Открыть
Логотип openclaw

Openclaw Parallels Smoke

openclaw
ОрганизацияПопулярный

Подготавливайте, сохраняйте снимки, запускайте и повторно запускайте проверки установки OpenClaw в гостевых системах Parallels, первичной настройки, Gateway smoke-тестов и обновлений в macOS, Windows и Linux; отлаживайте и анализируйте их результаты.

82.2K
391K
Инструкции
Открыть
Логотип openclaw

Openclaw Update

openclaw
ОрганизацияПопулярный

Передавайте владельцу установки плановые обновления существующего локального или удалённого OpenClaw Gateway с автоматическим восстановлением сессии. Если доступны навыки для конкретного типа развёртывания, используйте их.

82.2K
391K
Файлы: 1
Открыть

Создайте своё рабочее пространство с ИИ прямо сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇