用 Rust 学 Claude Code, 记录两周从零到发布的过程 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
爱意满满的作品展示区。
Hamiltonxx
V2EX    分享创造

用 Rust 学 Claude Code, 记录两周从零到发布的过程

  •  
  •   Hamiltonxx 3 月 26 日 1650 次点击

    最近在做一个系列,用 Rust 实现 AI Agent ,边学边记录。
    博客在这里: https://blog.cirray.cn
    目前已经写了入门指南、国内使用三道门槛、RAG+MCP Server 等,还在持续更新。
    欢迎感兴趣的一起交流。

    第 1 条附言    3 月 26 日
    Day 3 更新:让 Agent 真正能干活(工具分发)。之前的 agent 只会说话,现在能读文件、写文件、跑命令了。https://blog.cirray.cn
    第 2 条附言    3 月 27 日
    Day 4 更新:让 Agent 先想后做,还能分身。之前的 agent 是个急性子,任务一来直接上手没有规划。今天让它学会拆解任务、派出子 agent 并行干活。https://blog.cirray.cn/posts/rust-agent-todo-subagent-2026-03-27/
    第 3 条附言    3 月 29 日
    Day 5 更新:知识按需注入,上下文永不爆炸。S05 让 agent 自己决定「什么时候加载什么知识」,S06 让它在长对话里自动压缩历史。https://blog.cirray.cn/posts/rust-agent-skill-compact-2026-03-29/
    第 4 条附言    1 天前
    系列完结,补上后面几天的更新:

    Day 8:Agent 学会管任务带依赖关系的 Task 系统,拓扑排序决定执行顺序。https://blog.cirray.cn/posts/rust-agent-task-system-2026-03-31/

    Day 9:Agent 不再傻等tokio::spawn 后台跑任务,mpsc channel 完成后回报。https://blog.cirray.cn/posts/rust-agent-background-tasks-2026-04-03/

    Day 10:一个 agent 变成一支团队主 agent 分发,多 teammate 并发各自跑 loop 。https://blog.cirray.cn/posts/rust-agent-teams-2026-04-04/

    Day 11:协议 + 自治统一消息格式,teammate
    空闲时自动扫任务板、认领符合角色的任务,不用人派。https://blog.cirray.cn/posts/rust-agent-protocols-autonomous-2026-04-05/

    Day 12:两个 agent 把对方文件覆盖了,PathBuf + current_dir 三行解决隔离。s_full.rs 把全部 12
    个机制合进一个文件。https://blog.cirray.cn/posts/rust-agent-worktree-day12-2026-04-06/

    Day 13-14 收尾:代码写完了,仓库还不算 Rust 项目docs 全是 Python 、README 还在教 pip install 。逐一替换,最后 find . -name "*.py"
    输出空行,GitHub 语言统计 Python 0%。https://blog.cirray.cn/posts/rust-agent-day13-14-python-zero-2026-04-07/
    第 5 条附言    1 天前
    完整的过程记录都在博客: https://blog.cirray.cn 可以随时评论

    Rust 源码在这里,感兴趣的欢迎点个 star ,有问题也可以开 issue: https://github.com/Hamiltonxx/learn-claude-code-rust
    10 条回复    2026-03-28 21:21:17 +08:00
    twofox
        1
    twofox  
       3 月 26 日
    js 、python 生态滚滚,我一个 Javaer 对 Java 的发展感到悲观。

    传统的编译型语言似乎都很难在 ai agent 的客户端分到一杯羹

    我自己写的项目也已经是用 ts 做全栈了
    Hamiltonxx
        2
    Hamiltonxx  
    OP
       3 月 26 日
    @twofox 我之前也是全栈牛马。但是代码能力现在越来越不重要了,被逼着往 Agent Harness 路上走哇
    twofox
        3
    twofox  
       3 月 26 日
    @amiltonxx 代码能力不重要,但是生态选择还是很重要的。
    Hamiltonxx
        4
    Hamiltonxx  
    OP
       3 月 26 日
    @twofox 终究都要被大模型碾平。感觉做的事情能有一部分人认可就不错了。
    fds
        5
    fds  
       3 月 26 日
    @twofox #1 哈哈,我就是特别讨厌 Java ,太嗦了。js py 平常要用,但也不是特别喜欢。go 不错。用 bun 写 ts 也不错。编译型语言目前 rust 挺火呀,有了 AI 可以直接写了,没完全学会也能用。
    Hamiltonxx
        6
    Hamiltonxx  
    OP
       3 月 26 日
    @fds 其实 rust 也蛮嗦的。但是很稳。写起来自己就能用。python, java 这些写的东西自己根本不会用
    blur1119
        7
    blur1119  
       3 月 26 日
    harness 确实重要
    Hamiltonxx
        8
    Hamiltonxx  
    OP
       3 月 26 日
    @blur1119 没办法,Claude Code 让人看到无限可能
    startisan
        9
    startisan  
       3 月 28 日
    blog 写的太棒了。

    learncc 网站有点小问题,右上角跳转 github 的链接还没改。
    Hamiltonxx
        10
    Hamiltonxx  
    OP
       3 月 28 日
    @startisan 感谢提醒,顺便把 s03 s04 的 doc 也改了。 今天没写 s05,休息调整下,明天再上
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     930 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 32ms UTC 21:55 PVG 05:55 LAX 14:55 JFK 17:55
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86