How-toSelected

Stanford CS329Z publishes agent engineering course materials

Why we picked it

The signal here is that agent harness internals, normally proprietary engineering inside Claude Code and Codex, are now teachable with a US$5 budget and MIT-licensed test suites. Self-learners get a concrete path: clone the repo, make the failing tests pass, and only pay for the model-scored portion. Practitioners and educators across ASEAN and China can reuse the material freely with attribution, making it a direct alternative to paid agent frameworks and bootcamp courses.

Stanford's new course CS329Z, Engineering AI Agents, has opened its materials to the public. Instructor Michael Ryan announced on 10 November that lecture videos are released daily on the Stanford Online YouTube channel and both assignments are on GitHub under the MIT licence, so other schools can reuse them with attribution. The first two lectures, What is an agent system and LLM knowledge for agent developers, are already online, with the first lecture passing 90,000 views; originally recordings were to be kept internal on Canvas.

Body

The first assignment asks students to build an agent harness from scratch — the program layer around a model that declares tools, parses replies, executes commands and manages context, the same architecture behind Claude Code and Codex. No agent frameworks are allowed; the course provides only a raw interface of messages in, text out. Students build fixed pipelines (email priority triage, daily summaries, hand-written BM25 retrieval, multi-hop Q&A over a real corporate email archive), then an assistant for a fictional energy company with custom tool-call formats, document retrieval, a sandboxed terminal, context compression, cross-session memory and user approval gates, graded by a simulated-user LLM plus a scoring model. The repo ships failing tests as the curriculum: 48 of 88 autograded points come from model-free tests that cost nothing to run.

Michael Ryan says under US$5 of API credits completes the assignment, and the handouts put the full reference-run cost even lower. Open-ended design questions without official answers — context truncation, compression essentials, which actions need approval — require a written design rationale.

Original · 宝玉

斯坦福 CS329Z 课程资料公开:讲座每天上 YouTube,两份作业开源,第一份教你花几美元从零写个“Claude Code” 斯坦福新课 CS329Z“AI agent 工程”(Engineering AI Agents)开始对外公开全部课程资料。授课老师之一 Michael Ryan 11 月 10 日发帖说,讲座视频每天在 Stanford Online 的 YouTube 频道上一讲,两份作业的代码仓库也放到了 GitHub,都用 MIT 协议,别的学校注明出处就能拿去上课。 开课时情况不一样。课程页写的是录像只放在斯坦福内部的 Canvas 平台给选课学生看,校外的人只能下载课件。现在官方频道已经上了第 1 讲《什么是 agent 系统》和第 2 讲《写给 agent 开发者的大模型知识》,第 1 讲播放量过了 9 万。课程主页的课表也开始在每节课旁边挂视频链接。 【第一份作业:自己写一个 agent harness】 harness 是包在模型外面的那层程序:告诉模型有哪些工具、解析它的回复、替它执行命令、管理上下文。Claude Code、Codex 都可以看成一个模型加一个 harness。 作业不许用任何 agent 框架,课程只给一个最原始的接口:传进一串消息,返回一段文字,没有工具调用,也没有结构化输出,其余全靠自己写。 前半部分做几条固定流程:给邮件判断优先级、生成每日摘要、手写 BM25 检索(一种按关键词打分的经典搜索算法),再在一份真实企业的邮件档案里做多跳问答。后半部分给一家虚构的能源公司做内部助理:自己设计工具调用格式,接入文档检索,给它一个带沙盒限制的终端,对话太长时压缩上下文,跨会话记住用户的事,执行操作前让用户批准或否决。最后由大模型扮演的“模拟用户”跟你的 agent 多轮对话,再由另一个模型打分。 对自学的人来说,最有用的是全套测试都在仓库里。一开始所有测试都失败,你的任务就是让它们一个个通过。88 分自动评分里有 48 分来自不调用模型的测试,跑多少遍都不花钱。另有几处判断题作业不给标准答案,比如一条命令输出太长时给模型看多少、压缩上下文时必须留下什么、哪些操作可以不问用户,要求你写一份设计说明讲清楚自己的选择。 Michael Ryan 说不到 5 美元的 API 额度就能做完。讲义里的数字更低:用参考答案跑一遍全部线上测试花了 0.05 美元,最后的模拟用户评测再花 0.18 美元。自己调试要反复跑,花得会比这多,好在每次调用都缓存在本地,同样的请求第二次不收钱。选课学生用课程发的 OpenRouter 密钥,校外的人得自己准备一个,默认模型是 openai/gpt-6-luna。 【第二份作业:给 agent 出一道考题】 第二份作业由 John Yang 设计。他是 SWE-bench 的共同作者,这套测试用真实的 GitHub 问题考 AI 会不会修 bug,各家发编程模型常拿它报成绩。 作业教的是怎么出一道 Terminal-Bench 风格的题:给 agent 一段问题描述,让它在命令行环境里动手,最后用测试脚本判断做没做对。用的工具 Harbor 出自 Terminal-Bench 团队,它规定一道题怎么打包(题面、Docker 环境、验证脚本),并负责启动 agent、跑验证、保存结果。 作业先带你用 Harbor 跑 SWE-bench Verified、Terminal-Bench 2.1 里的现成题目。占 70% 分数的部分是自己出一道题,用 mini-SWE-agent(一个只带 bash 工具的极简编程 agent)配 Gemini 3.8 Flash 跑五次,分析这道题是否有效、贴近真实、能复现、有难度。需要装 Docker,准备 Gemini 或 OpenRouter 的密钥。 两份作业的说明文件末尾都写了致谢:第一份是在 Claude Fable 5.1 的大量帮助下做出来的,第二份用了 Claude Opus 5.5。 【后面还有什么】 课程由斯坦福计算机系的 Diyi Yang 和两位博士生 Michael Ryan、John Yang 共同讲授,第一届有 100 多名学生。这学期的课表里还有 Andrew Ng 的炉边对谈,还有 SWE-bench 两位作者 Carlos Jimenez、Alexander Wettig(现在在 Anthropic)的客座讲座。Michael Ryan 说之后还会公开学生做的作品。主要资助方是 Laude Institute,Thinking Machines、Google Cloud、AWS 和 Harbor 给学生提供了 API 额度。 照着第二份作业讲义克隆仓库时注意,讲义里写的仓库名是 assignment2-harness,实际地址是 assignment2-evals。 课程主页: cs329z.stanford.edu 第 1 讲视频: youtu.be/DGI4vucR71w 第 2 讲视频: youtu.be/Vr1NzH8bT44 作业一仓库: github.com/cs329z/assignm… 作业二仓库: github.com/cs329z/assignm… 原帖: x.com/michaelryan207… Michael Ryan @michaelryan207 🔊 Big Update! All materials are now being released publicly for our NEW Stanford course CS329Z: Engineering AI Agents! Starting with the lectures, which are going live daily on the Stanford Online YouTube channel! Lecture 1: youtu.be/DGI4vucR71w M 🧵 (1/5) 🔗 View Quoted Tweet📊 60 ⚡

Industry Coordinates & Source Verification

This report is categorized under AITOP's "How-to" desk, focusing on US frontier AI labs and Silicon Valley technology leaders. Within our cross-regional analytical framework, it directly maps to AI developer toolchains, coding agents, and engineering workflows and US-China foundation model benchmarks and commercialization comparison. Key entities and technical topics under continuous tracking include Stanford CS329Z, Claude Code, agents, agent harness.

Source attribution: curated from 宝玉 (@dotey).