
大家好,我是“不一样的猿生”。
2026 年 3 月 7 日,Anthropic 核心工程师 Boris Cherny 在 X 上直接放出大招:Claude Code 正式内置 /loop 技能!
这条推文瞬间刷屏,很多人在下面留言“终于等到你”“这下真·无人值守了”。官方文档也同步更新,地址就在这里:https://code.claude.com/docs/en/scheduled-tasks
今天结合官方文档 + Boris 的原帖,重新梳理一遍 /loop 的真实玩法和边界,避免大家踩坑,也帮大家快速上手最高效的使用方式。
/loop 是 Claude Code 内置的一个 bundled skill(捆绑技能),本质是会话内的轻量级定时任务调度器。
核心能力一句话概括: 你给它一段提示词,它就会按照你指定的间隔,在后台自动重复执行这段提示词。
Boris 原帖中的经典例子直接点燃了大家的想象力:
“/loop babysit all my PRs. Auto-fix build issues and when comments come in, use a worktree agent to fix them” “/loop every morning use the Slack MCP to give me a summary of top posts I was tagged in”
翻译过来就是: “全程盯着我的所有 PR,构建挂了自动修,有人评论就用 worktree agent 去修” “每天早上自动用 Slack MCP 给我拉被 @ 的重要消息总结”
这已经不是简单的助手,而是能真正“替你上班”的 AI 同事了。
官方文档给出了三种最自然的写法:
/loop 5m check if the deployment finished and tell me what happened
→ 每 5 分钟检查一次部署状态/loop check the build every 2 hours
→ 每 2 小时检查构建/loop babysit all my PRs
→ 默认每 10 分钟执行一次支持的单位:s / m / h / d (秒会被向上取整到分钟,非整除间隔如 7m、90m 也会被智能取整,Claude 会告诉你实际使用的间隔)
还能直接嵌套其他技能:
/loop 20m /review-pr 1234
→ 每 20 分钟自动 review 一次 PR #1234
想看状态或取消?直接自然语言问就行:
what scheduled tasks do I have? → 列出所有任务(带 ID、间隔、提示词)cancel the deploy check job → 取消名为“deploy check”的任务cancel task abc12345 → 用 8 位 ID 精准删除每个会话最多支持 50 个定时任务,超了会提醒你。
/loop babysit all my PRs. When builds fail auto-fix, when new comments arrive use worktree agent to suggest fixes/loop 10m check latest main branch CI status, notify me immediately if red with failure reason/loop every morning at 9:05 use Slack MCP to summarize mentions and important threads from yesterday/loop 30m run static analysis on all open PRs and report new issues/loop 15m curl the staging endpoint and alert on any 5xx or latency > 800ms/loop 4h scan recent commits for secrets or high-severity vulnerabilities官方文档写得很清楚,这些是真实边界:
最佳避坑小技巧:
现在打开你的 Claude Code,试试下面任一句:
/loop 10m check if main branch build is green
/loop every morning at 8:50 summarize my unread Slack mentions
/loop babysit my open PRs and auto-suggest fixes on comments执行后 Claude 会立刻回复类似: “Task scheduled: every 10 minutes | ID: abcd1234 ✅”
用完后欢迎在评论区分享你的实际用法~
我们一起把 Claude Code 玩成效率黑洞!
官方文档必读(强烈建议收藏): https://code.claude.com/docs/en/scheduled-tasks
还没装最新版 Claude Code 的,赶紧去 https://code.claude.com 更新吧~
效率卷王们,我们下期见!💪