这真他*的是宝藏 Anthropic 刚分享了 Claude Code 最棒的技巧之一:安排它每小时运行一次,让它在你睡觉时修复那些时好时坏的测试。 你在 23:00 合上笔记本电脑,智能体就会在云端自行运行,不需要你在场。 claude > /schedule hourly 23:07-06:07: fix a flaky test 具体安排如下: ▸ 每小时运行一次,每次修复一个不稳定测试,每晚运行 8 次 ▸ 每次运行都从默认分支的全新克隆开始 ▸ 它会复现测试的不稳定问题、修复它,再重新运行测试套件 ▸ 它只会推送到 claude/* 分支,并创建 PR 保障安全的关键在于:它绝不碰你的分支,也绝不合并任何内容。 到 07:00,等着你的是 PR,而不是需要你撤销的提交。 JEV 在底层运作,为每次运行作出决定:选哪个测试、修复还是跳过、重试还是停止。明确的判断通过代码执行,拿不准的则给你留一条说明,而不是瞎猜。 对于无法解释的不稳定问题,它不会自信地提交补丁,而是会在 PR 上留下说明,写清楚它观察到了什么。 文件本身有一条诚实的提醒:绿色状态不代表任务已经完成。要查看每次运行的情况。 原本无事发生的 8 小时,变成了对团队里没人愿意碰的测试进行的 8 次修复尝试。 收藏起来,这是你能雇到的最便宜的工程师。
看原文
THIS IS ACTUAL F*CKING GOLD Anthropic just shared one of the best tricks for Claude Code: schedule it hourly and let it fix your flaky tests while you sleep. you close the laptop at 23:00 and the agent runs in the cloud without you. claude > /schedule hourly 23:07-06:07: fix a flaky test here's the split: ▸ one run an hour, one flaky test per run, 8 runs a night ▸ every run starts from a fresh clone of the default branch ▸ it reproduces the flake, fixes it, re-runs the suite ▸ it pushes only to a claude/* branch and opens a PR the part that makes this safe: it never touches your branch and never merges anything. by 07:00 there are PRs waiting, not commits you have to undo. JEV sits underneath and decides per run: which test to take, fix or skip, retry or stop. sharp calls run in code, split ones leave you a note instead of guessing. a flake it cannot explain does not get a confident patch, it gets a note on the PR saying what it saw. one honest warning from the file itself: green status does not mean the task is done. read each run. 8 hours of nothing becomes 8 attempts at the tests nobody on your team wants to touch. save it, this is the cheapest engineer you will ever hire.