agent_switch — субагент для Claude Code: перенос между лаунчерами
Субагент agent_switch для Claude Code переносит работающего агента в другой лаунчер на том же компьютере. Он переключает сессию только по просьбе пользователя.
MIT ★ 395 обновлён 2026-11-16
.claude/agents/agent_switch.mdЧто делает agent_switch
agent_switch завершает текущий процесс Claude Code и возобновляет его в другом лаунчере, сохраняя терминал и историю разговора. Текст для нового запуска можно передать отдельно; если агент остановился из-за лимита использования, он продолжит прежнюю работу без нового текста.
Перенос выполняется только по прямой просьбе. Работающий или запускающийся агент, агент с ожидающим вопросом, разрешением, планом, фоновым заданием или черновиком в поле ввода получит отказ: текст не отправится, ожидающий запрос не останется. После остановки агента перенос можно повторить. Целевой лаунчер должен запускаться на том же компьютере и быть авторизован; инструмент не предназначен для остановленных, доступных только для чтения агентов, диалогов ассистента, Codex и других агентов.
Какие задачи решает
- перенести текущую сессию Claude Code в другой лаунчер
- продолжить работу после остановки из-за лимита использования
- передать новому лаунчеру задачу для текущего агента
Примеры запросов агенту
- Перенеси агента
abc12345на этом компьютере в другой лаунчер и продолжи его работу. - Переключи текущего агента на лаунчер
Названиеи передай ему задачу: «Продолжи разбор тестов».
Как установить agent_switch
Вручную: положить файлы
.claude/agents/agent_switch.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/agent_switch.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/agent_switch.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы об agent_switch
Как установить agent_switch в Claude Code?
Добавьте файл субагента по пути .claude/agents/agent_switch.md.
Что делает agent_switch?
Он переносит работающего агента Claude Code в другой лаунчер на том же компьютере, сохраняя терминал и разговор. Агент продолжает работу там.
Когда agent_switch откажется переносить агента?
Перенос не выполняется, пока агент занят, ждёт ответа или разрешения, запускается, выполняет фоновую работу либо содержит черновик в поле ввода. Инструмент также не работает с остановленными агентами, Codex и другими агентами.
Исходный текст
agent_switch.md · MIT
Move a running Claude Code agent (from agents_list) to another launcher on its computer and go on with it, in one step: the agent is quit and resumed on that launcher in the same terminal, with the same conversation, and `text` is sent to it there. It is the switch the user makes from the agent's chat. Use it only when the user asked for it, for example when a subscription's usage limit stopped agents and the user wants them to go on with another provider now rather than wait for the reset; never on your own. The launcher must be one of that computer's (machines_list and agents_list show the names). The switch happens now or not at all: an agent that is working, waits for the user (a question, a permission, a plan), is starting, has background work its quit would end, or has a draft or a dialog in its input box is refused with nothing typed and nothing left waiting; tell the user why, and try again once it has stopped if they still want it. Other refusals say why too (a launcher that does not run there or is not signed in, a model the launcher's default cannot be read for: give model). Not for stopped agents (agent_send with resume), assistant conversations, read-only agents, or Codex and other agents. An agent its usage limit stopped goes on with what it was doing when `text` is left out; any other agent needs `text`. Its usage-limit continuation, if one was due, is not sent afterwards.
```json
{
"type": "object",
"required": ["machine", "session_id", "launcher"],
"properties": {
"machine": {
"type": "string",
"description": "the machine's id or name, as agents_list shows it"
},
"session_id": {
"type": "string",
"description": "the agent's session id, or its first 8 characters"
},
"launcher": {
"type": "string",
"description": "the launcher to move it to, by its name on that computer"
},
"model": {
"type": "string",
"description": "a model of that launcher; empty: the launcher's default"
},
"effort": {
"type": "string",
"description": "the reasoning effort on the new launcher; empty: as it is"
},
"text": {
"type": "string",
"description": "what the agent does on the new launcher, sent as the user would type it; empty only for an agent its usage limit stopped (it goes on with what it was doing)"
}
}
}
```
© nwverse · MIT · nwverse/persona