agentbox
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<!-- agentbox-managed:v1 -->
Fork the current Claude Code session into a fresh AgentBox box.
-
Resolve the provider flag from:
$ARGUMENTS- empty → no flag (uses the default docker provider)
- |
docker|daytona|hetzner|vercel→ passe2b--provider $ARGUMENTS - anything else → stop and tell the user the valid values are ,
docker,daytona,hetzner,vercele2b
-
Detect an active plan (optional). If this session was just working on a Claude Code plan, carry it into the box so the fork resumes in plan mode.
--plan-
If you know the plan file path for this session (plan mode writes it to, and you have it from the plan you just produced in this conversation), use that path.
~/.claude/plans/<slug>.md -
Otherwise, find the most recent plan only if it was touched in the last 15 minutes (a stale plan from another task should not be resurrected). Run via the Bash tool:
find "$HOME/.claude/plans" -name '*.md' -mmin -15 -type f 2>/dev/null \ | xargs -r ls -t 2>/dev/null | head -1If it prints a path, that's the current plan; if it prints nothing, there is no active plan — skip.--plan
-
-
Fork. If you are in plan mode, exit it, then run, via the Bash tool, exactly one command (addonly if step 2 found a plan). Do NOT pass
--plan "<path>":--sessionautodetects the current Claude session itself (and safely falls back to the newest session for this workspace), which is correct even when this skill runs in a subagent whereagentbox forkwould be the subagent's id, not the conversation you want to fork:$CLAUDE_CODE_SESSION_IDagentbox fork [--provider $ARGUMENTS] [--plan "<plan path>"] -
Report. In one line, give the user the new box name (parse it from the command output) and confirm their host session is unaffected. If you passed, mention the box opens in plan mode ready to resume. Do not summarize the conversation — the fork already carries it.
--plan
For Hetzner cloud boxes only, when in Codex App or Claude Desktop, use can add a ssh connection to the box. To do this first add an alias to their ssh config, then instruct them how to add the connection:
agentbox shell <box> --ssh-config # writes ~/.ssh/config + prints detailsto add a ssh alias that the user can use to connect to the box
When in Codex App return a clickable link in the response for an easy way:
[Add <ssh-alias> to Codex SSH](codex://settings/connections/ssh/add?name=<ssh-alias>)<!-- agentbox-managed:v1 -->
将当前Claude Code会话复刻到全新的AgentBox容器(box)中。
-
从解析提供商标识:
$ARGUMENTS- 为空 → 不添加标识(使用默认的docker提供商)
- |
docker|daytona|hetzner|vercel→ 传入e2b--provider $ARGUMENTS - 其他值 → 终止操作并告知用户有效值为、
docker、daytona、hetzner、vercele2b
-
检测活跃计划(可选参数)。如果当前会话正在使用Claude Code计划,需将其带入新容器,使复刻后的会话能在计划模式下继续。
--plan-
若已知当前会话的计划文件路径(计划模式会将其写入,且你可从本次对话中生成的计划获取该路径),直接使用该路径。
~/.claude/plans/<slug>.md -
否则,仅查找过去15分钟内被修改过的最新计划(避免复用其他任务的过期计划)。通过Bash工具运行以下命令:
find "$HOME/.claude/plans" -name '*.md' -mmin -15 -type f 2>/dev/null \ | xargs -r ls -t 2>/dev/null | head -1若命令输出路径,则为当前计划;若无输出,则无活跃计划 —— 跳过参数。--plan
-
-
执行复刻操作。若当前处于计划模式,先退出该模式,然后通过Bash工具运行以下命令(仅当步骤2找到计划时才添加)。请勿传入
--plan "<path>"参数:--session会自动检测当前Claude会话(若检测失败,会安全 fallback 到当前工作区的最新会话),即使该技能在子Agent中运行时agentbox fork为子Agent的ID而非目标会话ID,此逻辑依然有效:$CLAUDE_CODE_SESSION_IDagentbox fork [--provider $ARGUMENTS] [--plan "<plan path>"] -
结果反馈。用一句话告知用户新容器的名称(从命令输出中解析),并确认原主机会话不受影响。若传入了参数,需说明新容器将以计划模式启动,可直接继续任务。无需总结对话内容 —— 复刻操作已同步所有会话数据。
--plan
仅针对Hetzner云容器,当在Codex App或Claude Desktop中使用时,可添加SSH连接。操作步骤为:先在SSH配置中添加别名,再指导用户添加连接:
agentbox shell <box> --ssh-config # 写入~/.ssh/config并打印详情添加一个用户可用于连接容器的SSH别名
若在Codex App中,返回可点击链接以简化操作:
[Add <ssh-alias> to Codex SSH](codex://settings/connections/ssh/add?name=<ssh-alias>)Troubleshooting
故障排查
- If agentbox command fails, tell the user to install AgentBox by writing in the chat.
! npm -g install @madarco/agentbox - If is set in the environment, you are running inside a box. This command is host-only in v1; tell the user box→box fork is not supported yet.
AGENTBOX_RELAY_URL - If you need to know more about Agentbox, check the /agentbox-info skill that containes the full documentation.
- 若agentbox命令执行失败,告知用户在聊天框中输入以安装AgentBox。
! npm -g install @madarco/agentbox - 若环境中设置了,说明当前正运行在容器内部。v1版本仅支持主机端操作;告知用户暂不支持容器到容器的复刻。
AGENTBOX_RELAY_URL - 如需了解更多AgentBox相关信息,请查看包含完整文档的/agentbox-info技能。