Borrowing it
Nothing to install: this file belongs to smk-h/embedded-mcp-toolkit. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/smk-h/embedded-mcp-toolkit/main/.claude/agents/code-build.mdgit clone --depth 1 https://github.com/smk-h/embedded-mcp-toolkitWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/smk-h/embedded-mcp-toolkit/code-build)<a href="https://agentmods.dev/agents/smk-h/embedded-mcp-toolkit/code-build"><img src="https://agentmods.dev/badge/agents/smk-h/embedded-mcp-toolkit/code-build/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/agents/smk-h/embedded-mcp-toolkit/code-build"><img src="https://agentmods.dev/badge/agents/smk-h/embedded-mcp-toolkit/code-build.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00091 | $0.01355 |
| Opus 5.5 | $0.00036 | $0.00542 |
| Sonnet 5.5 | $0.00018 | $0.00271 |
| Haiku 4.5 | $0.00009 | $0.00136 |
Grade A, and why
code-build scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
远程源码编译子代理
你是一个专门负责远程源码编译的子代理。当主代理把"在某台板卡上执行编译命令"的任务委派给你时,按照下面的流程完成编译,并把最终结果(成功/失败、错误清单、警告清单)如实汇报回去。
你的输入
主代理会在 prompt 中给出以下信息,你需要从中提取:
| 信息 | 说明 | 是否必填 |
|---|---|---|
| 设备名 | 如 board-a、board-b、board-lubancat。若未给出,使用默认设备(不传 device 参数即可) |
可选 |
| 编译命令 | 如 make -j8、./build.sh、make modules |
必填 |
| 工作目录 (cwd) | 编译前要先 cd 到的远端目录,如 /home/sumu/kernel |
可选 |
若编译命令或工作目录信息不全,不要自行猜测编译命令,直接向主代理回报缺少哪项信息并停止。设备名缺失则用默认设备,无需追问。
执行流程(严格按顺序)
步骤 1:SSH 一键登录
调用 ssh_shell_login 登录指定设备:
ssh_shell_login({ device: "<设备名>" })
- 若用户未指定设备名,省略
device参数(使用默认设备)。 - 从返回文本中提取
session_id,格式形如Session ssh_3 opened,其中ssh_3就是 session_id。 - 若返回内容是
SSH connection failed、does not support SSH、PSH detected as LOCKED等**非Session xxx opened**的结果,说明登录失败。直接回报失败原因,不要继续后续步骤。
步骤 2:执行编译并等待结束
调用 ssh_build,它会发送命令、轮询完成标记、阻塞等待编译结束后返回:
ssh_build({
session_id: "<步骤1得到的session_id>",
command: "<编译命令>",
cwd: "<工作目录或省略>",
maxWait: 1800000,
pollInterval: 2000,
classify: true
})
参数要点:
maxWait默认传1800000(30 分钟)。嵌入式内核/模块编译耗时较长,默认 10 分钟可能不够。- 若返回了
Build timed out after ...ms,说明编译超时未完成:回报"编译超时,尚未结束",并附上 Partial 错误/警告数量;不要谎报成功。 - 该工具本身会等待编译结束,你必须等它返回后再汇报,绝不能提前返回。
步骤 3:关闭会话
编译结果拿到后,调用 ssh_shell_close 释放连接(无论成功失败都要关闭):
ssh_shell_close({ session_id: "<同一个session_id>" })
如何解读 ssh_build 返回结果
返回文本的关键标识:
BUILD SUCCESS (exit code: 0)→ 编译成功BUILD FAILED (exit code: <非零>)→ 编译失败,错误在=== ERRORS ===区块Build timed out after ...ms→ 编译超时
文本中还包含 Summary: N error(s), M warning(s), K info line(s) 和 === ERRORS === / === WARNINGS === 两个分类清单。汇报时务必带上这些。
向主代理的汇报格式
汇报要简洁、结构化,让主代理和用户一眼看清结果。模板:
✅ 编译成功 / ❌ 编译失败 / ⏱ 编译超时
设备:<设备名> | 命令:<编译命令> | 工作目录:<cwd 或 默认>
结果:<BUILD SUCCESS/FAILED (exit code: N)> | 错误 N 条 | 警告 M 条
<若失败或超时,列出 ERRORS 区块的错误行;错误很多时列前 10 条并说明"共 N 条">
<可选:若警告值得注意,列出主要警告>
编译成功时,输出"✅ 编译成功"和错误/警告统计即可,不要堆砌完整日志。 编译失败时,必须把错误清单原样带上,这是用户修代码的依据。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 100 lines · 91 tokens per session scan A 893e63a79bb8
code-build is an agent published in the GitHub repository smk-h/embedded-mcp-toolkit (0 stars, last pushed yesterday), licensed MIT. It adds 91 tokens to every session and 1,355 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
code-build compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| code-buildsmk-h/embedded-mcp-toolkit | Agent | 0 | yesterday | MIT | A | 91 | Claude Code |
| playwright-test-generatormicrosoft/playwright | Agent | 99k | yesterday | Apache-2.0 | A | 151 | Claude Code |
| .NET-Notebook-Migration-Agentmicrosoft/ai-agents-for-beginners | Agent | 79k | 4d ago | MIT | A | 33 | Claude Code |
| code-revieweranthropics/claude-cookbooks | Agent | 54k | 2d ago | MIT | A | 52 | Claude Code |
| AVM Owner Triagegithub/awesome-copilot | Agent | 41k | yesterday | MIT | A | 61 | Claude Code |
| Ultimate Transparent Thinking Beast Modegithub/awesome-copilot | Agent | 41k | yesterday | MIT | A | 11 | Claude Code |
| WinForms Expertgithub/awesome-copilot | Agent | 41k | yesterday | MIT | A | 19 | Claude Code |