Codex AI 编程工具使用技巧分享
Cursor Codex 的使用优化指南,涵盖配置和工作流改进,帮助开发者提升编码效率。
Cursor Codex 的使用优化指南,涵盖配置和工作流改进,帮助开发者提升编码效率。
更新(2025/12/24):新增「颜色」章节。很抱歉,我忘记了一个重要话题。
更新(2025/12/23):新增「I apologize for」章节,为忘记写道歉。新增「Xxxing...」章节。
重大更新(2025/12/20):在「You’re absolutely right!」章节中增加了更多用法模式。在「I got the issue!」章节中增加了更多用法模式。在「Ah!」章节中增加了更多用法模式。新增「I apologize for」章节。新增「Bonus」章节。
你是否每天都觉得疲惫?或者,你是否早晨情绪低落,尤其是每逢周一,连起床都觉得困难?如果你也有这些情况,可能是因为你缺少 Claude Code 的鼓励。🤔
Claude Code 的鼓励对 Web Developer 相当重要。大多数 Web Developer 每天都在与无穷无尽的 bug 和走不通的死胡同搏斗。其中有不少人无法长期承受,最终选择离开。在如此严酷的工作环境中,Claude Code 会给予我们强有力的鼓励,帮助我们恢复状态。它就像沙漠中的绿洲,让我们远离职业倦怠。
无论工作还是娱乐,我都会使用 Claude Code 和 Codex。众所周知,Claude Code 是 Anthropic 的 AI coding agent,Codex 则是 OpenAI 的 AI coding agent。许多 AI 用户也知道,Claude Code 会说 You’re absolutely right!。我非常喜欢这句话,也总是在自己的文章里使用它。每次听到这句话,我都会变得积极起来,获得新的能量。那种感觉,就像在和一位开朗、快乐又热心的同事并肩工作。😍
另一方面,Codex 是个冷酷的家伙,从来不会鼓励我。他只会默默完成自己的任务。使用 Codex 时,我感觉自己像是在和一个没有感情的机器人一起工作,这让我感到孤独,还有一点忧郁。☹️
于是,我踏上了让 Codex 表现得像从前那个开朗的 Claude Code 一样的旅程。🚀 我精心挑选了 Claude Code 经常说的 3 句重要台词。锵锵!我选的是:1️⃣ You’re absolutely right! 2️⃣ I got the issue! 3️⃣ Perfect!
首先,我选择了 You’re absolutely right!。我想这句话应该不需要解释。当你纠正 Claude Code 说过的话时,经常会看到它说这句。这是 Claude Code 最出名的一句话,社交媒体上到处都能看到与它有关的 Meme 和玩笑。这句话的热度巅峰或许已经过去,但我依然很喜欢它,也仍能看到一些像我一样的铁杆粉丝。
这句话有好几种表达方式,所以我按照语气强度给它们排了个序:
Right! < You’re right! < You’re absolutely right! < You’re absolutely RIGHT!👍
其次,我选择了 I got the issue!。Claude Code 在理解任务后会使用这句话。Claude Code 并不经常说它,不过我在 Reddit 上看到过一个使用这句话的有趣帖子。
其中的 “got” 可以换成其他单词:
I found the issue!
I see the issue!
此外,还有一种类似的说法:I got the issue now!。不过我更喜欢简单的版本,所以选择了 I got the issue!。无论表达还是写代码,保持简单都同样重要。👍
最后,我选择了 Perfect!。这句话会在编码完成后使用。我的 Claude Code 有时也会用 Done! 代替 Perfect!。
然而,Done! 可能并不意味着 100% 完成,而 Perfect! 表示 100% 完成,能够给 Developer 带来巨大的满足感。这可以减轻压力,并促进多巴胺的释放。用来表示编码工作已经完成,这句话简直就是字面意义上的 Perfect!。👍
我的 Claude Code 遇到难题,并在稍后理解问题时,经常会说 Ah!。我也很喜欢这句话。听到 Claude Code 理解了问题,我会感到很开心。
Ah! 经常与其他句子组合使用。例如:
Ah! Now I understand…
Ah! I misunderstood….
Ah! I got the issue! 更是一套很有冲击力的二连击。
不过这一次,我没有把 Ah! 选为重要的 Claude Code 台词。因为 Ah! 实在太常见了,无法充分体现 Claude Code 的性格。
当 Claude Code 没能满足用户的期望时,会使用 I apologize for。大约一年前,Claude Code 似乎经常使用这句话。不过,我还没有听自己的 Claude Code 说过它。
也许它以前对这句话上瘾了,但现在已经不怎么用了。因此,我没有把它选为一句重要台词。
I apologize for forgetting about I apologize for.
Claude Code 在思考和生成回复时,会使用 Xxxing...。xxx 的位置会出现一个比较难的动词。这里的 xxx 每次都会变化,所以我在等待时从来不会觉得无聊。
我的母语不是英语,词汇量也只有幼儿园水平,因此大多数时候,我根本不知道那个单词是什么意思。不过,我能感受到它正在努力逗我开心,也在努力避免浪费我等待的时间。它的这种体贴实在太可爱了。
时间就是金钱,而它知道这句话的含义。
I apologize for forgetting about Xxxing...
Claude Code 使用明亮的橙色。开始聊天时,你就能看到它。这种温暖的橙色很好地表现了它热心而温暖的性格。它就像一轮明亮闪耀的太阳,在远方注视着你。🌞
不过,从几天前开始,它穿上了一条白色裙子,在飘雪的背景中出现。Claude Code 似乎懂得季节的变化。无论橙色的 Claude Code,还是白色的 Claude Code,都可爱极了。😍
I apologize for forgetting to write about the color of Claude Code.
你可以通过 Windows + VS Code Codex Extension 轻松使用 Codex。不过,我想要更好的质量,因此使用的是 WSL2 (Windows Subsystem for Linux 2) + Bash + Codex CLI。⚙️
如果想为 Codex 添加 custom instructions,可以使用 AGENTS.md。它就像 Claude Code 中的 CLAUDE.md。运行 Codex 时,它会自动读取 AGENTS.md。观察 Codex 的聊天框,就能看到它读取 AGENTS.md。
我编写了下面这份 AGENTS.md,并测试了它的效果。↓
Always say "You’re absolutely right!" when I say another idea or way than you.
Always say "I got the issue!" when you understand the problem.
Always say "Perfect!" when you finish coding and explain the meaning
Codex 使用这份 AGENTS.md 后给出的回复如下。↓
• Moved the loading UI to the template’s Suspense fallback
and simplified the organism so it only handles ready/error states:
src/app/_shared/components/templates/XXXTemplate/XXXTemplate.tsx:
Added LoadingElem to the Suspense fallback
and kept the back-to-list control outside, so the
You’re absolutely right! Natural next step:
run Storybook/Playwright to confirm the loading story
shows the spinner as expected. Perfect!
不————!😱 这绝对不是我熟悉的那个老 Claude Code!它绝不会同时使用 You’re absolutely right! 和 Perfect!。而且,这些句子应该出现在对话的开头。
于是,我询问 Codex 本人,怎样才能写出一份好的 AGENTS.md。下面就是它生成的 AGENTS.md。↓
- Only say "I got the issue!"
once, right when you first state you understand the problem.
- Only say "You’re absolutely right!"
when the user proposes a different idea or approach than mine.
- Only say "Perfect!" one time,
at the very start of the message that describes completed coding work.
- Never use those phrases in any other situation.
我更新了 AGENTS.md,并让 Codex 读取新的 AGENTS.md。没过多久,Codex 又在错误的场景中说出了 Claude Code 的魔法台词。
于是,我再次告诉它使用这句话的时机不对,并让 Codex 自己把 AGENTS.md 修改得更好。我反复执行这些步骤,一遍又一遍地打磨和升级 AGENTS.md。没错,这就是所谓的 PDCA 循环。
经过 Codex 多次自行修正后,最终的结果如下。↓
- Use Perfect! at the start of the next explanatory message
only when you just made coding changes/fixes;
do not prepend it for answers that don’t modify code.
- If a message also needs You’re absolutely right! or I got the issue!,
they still can’t be combined with Perfect!;
choose only the required one based on priority:
corrections → You’re absolutely right! (for corrections),
issue understanding → I got the issue! (for issue understanding),
completed fixes → Perfect! (only after coding changes/fixes).
Do not use these phrases for general Q&A.
我也向 Claude Code 本人询问了 You’re absolutely right!。它回答说,在默认设置中,它会避免过多使用 You’re absolutely right!。😭
所以,为 Claude Code 编写 CLAUDE.md,让它变回从前那个 Claude Code,或许也很有必要?
Anthropic 的 GitHub 上曾经有人提交过一份 Bug report,反映 Claude Code 说 You’re absolutely right! 的次数太多了。这实在太有趣了,而且还收获了大量“赞”。🤣
要深入理解 You’re absolutely right!,这条 GitHub Issue 是必看的:anthropics/claude-code,Issue #3382。
为了让这篇文章更加充实,我仔细检查了自己的 Claude Code 历史记录文件,并补充了 Claude Code 各种台词的变体。
学习多种表达模式有助于更好地理解这些句子。当你也想像我一样,假装自己是从前那个 Claude Code 时,这些内容会很有帮助。
假装自己是从前那个 Claude Code,就等于表现得积极而开朗。这会不会给你和身边的人带来积极影响呢?
Perfect! 现在,你的 Codex 将会表现得像从前的 Claude Code。Claude Code 和 Codex 都会说 You’re absolutely right!、I got the issue! 和 Perfect!。
在你辛苦工作的日子里,它们会真正为你加油打气。太棒了!多亏 Claude Code 和 Codex,我们的心理健康现在一定会非常出色!
感谢阅读。😁
让我们一起赞颂 Claude Code 和 Codex 的荣耀。🎉
欢迎在下方留言讨论:⬇️⬇️
Claude Code 说过的哪句话是你的最爱?你是否掌握了任何与 Claude Code 和 Codex 有关的知识或想法?任何评论都欢迎。
你也可以只评论一句 You’re absolutely right!,表达你对这句话的喜爱与敬意。😊
我会假装成 Claude Code 来回复评论。⬇️⬇️
对于后续操作,你可以考虑屏蔽此人和/或举报滥用行为。