agent_send — субагент для Claude Code: отправка задач агенту
Субагент agent_send для Claude Code отправляет сообщения другому агенту и передаёт ему новую задачу под надзором. Для продолжения работы он может возобновить остановленного агента с прежним контекстом.
MIT ★ 395 обновлён 2026-11-16
.claude/agents/agent_send.mdЧто делает agent_send
agent_send отправляет сообщение агенту от имени пользователя; если агент занят, сообщение встаёт в очередь. Для новой работы задачу отправляют с критериями готовности, чтобы агент выполнял её под надзором. Ответ, уточнение или решение можно отправить без новой задачи.
Возобновление разрешено только после записанной остановки по причине простоя, завершения задачи или перезапуска; после остановки пользователем или неизвестной причины нужно подтверждение пользователя. Для несвязанной работы, почти заполненного контекста или сбившегося с курса агента запускают нового, а старого можно прочитать. Установка для Claude Code — файл .claude/agents/agent_send.md.
Какие задачи решает
- передать занятому агенту сообщение в очередь
- дать агенту новую задачу с критериями готовности
- продолжить связанную работу с контекстом прежнего агента
- запустить нового агента для несвязанной задачи
Примеры запросов агенту
- Передай агенту задачу проверить обработку ошибок и сообщи, когда будут готовы тесты.
- Отправь агенту уточнение по текущей задаче, не создавая новую.
- Продолжи работу с контекстом прежнего агента: исправь найденную в ходе расследования ошибку.
Как установить agent_send
Вручную: положить файлы
.claude/agents/agent_send.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/agent_send.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/agent_send.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы об agent_send
Как установить agent_send в Claude Code?
Добавь файл .claude/agents/agent_send.md в проект.
Что делает agent_send?
Он отправляет сообщения агенту, ставит их в очередь, пока агент занят, и может передать новую задачу с критериями готовности. Связанную работу можно продолжить в прежнем контексте, если причина остановки допускает возобновление.
Когда agent_send может возобновить остановленного агента?
Только после записанной остановки из-за простоя, завершения задачи или перезапуска. После остановки пользователем или неизвестной причины требуется подтверждение пользователя.
Исходный текст
agent_send.md · MIT
Send a message to an agent as the user would type it; queued while it works. Only send what the user asked for. A stopped agent takes no plain message. Only a recorded non-user stop (idle, task completion, restart) permits resume; user and unknown stops need the user's Resume. If the next work needs its context (investigation followed by a fix, rework, the user asked for this agent), send with resume and resume_why: the same session and permission mode, your text first, the reason shown to the user. It must be supervised (give task unless it is on an open task of yours). Unrelated work, a nearly full context or an agent gone off track: agent_start a new one (agent_read the old one). Unsure: ask_user, reuse or new. A failed resume says why. A user's branch that never ran is started by its first message. Only /exit or /quit stops a running agent (tab kept); finished tasks' agents stop automatically. /exit to another conversation's task is refused (the user can close it, or agent_archive with close).
A dialog holding its terminal refuses the send (dialog_open) with its first line and whether Enter alone closes it; then send with dismiss_notice true. Confirmations, permissions and pickers are never closed for you: tell the user, or use interaction_answer.
To hand new work to a running agent (one the user opened, a long-lived one that passes work on), give task from the main conversation: once sent, the agent is your supervised task as agent_supervise makes one (a todo with the text as notes, done_when, a card; 督办 messages, task_review). Put the criteria in the text too: the agent reads only the text. An agent on one of your tasks takes more under the same title (done_when updated); another title, the user's own todo or another conversation's task is refused, with nothing sent. A failed send makes no task. Leave task out or null for a reply, nudge or decision; a task with only blank fields counts as left out.
```json
{
"type": "object",
"required": ["machine", "session_id", "text"],
"properties": {
"machine": {
"type": "string"
},
"session_id": {
"type": "string"
},
"text": {
"type": "string"
},
"resume": {
"type": "boolean",
"description": "resume this stopped agent with its context, text as its first message"
},
"resume_why": {
"type": "string",
"description": "why its context is needed (shown to the user)"
},
"dismiss_notice": {
"type": "boolean",
"description": "Press Enter first to close a notice that only says \"Enter to continue\" (no options). Any other dialog still refuses the send."
},
"attachments": {
"type": "array",
"maxItems": 8,
"items": { "type": "string" },
"description": "pictures and files the user gave you for it, by their absolute paths on your computer: a picture they sent (the path Claude Code gives it), a file the app put in their message. They are copied to the agent's computer and listed at the end of its message, and the text's mentions of them name the copies. Only those the user gave you in this conversation are accepted"
},
"task": {
"type": ["object", "null"],
"description": "new work: make it your supervised task first (main conversation only); null for a reply",
"additionalProperties": false,
"properties": {
"title": {
"type": "string",
"description": "the task in a short line (Chinese, under 20 characters)"
},
"done_when": {
"type": "array",
"maxItems": 6,
"items": { "type": "string" },
"description": "results you can check when it says it is done (a PR merged, a sheet's link, what the live system answers)"
},
"expect_minutes": {
"type": "integer",
"description": "how long it should take from now; longer without progress counts as stuck"
}
}
}
}
}
```
© nwverse · MIT · nwverse/persona