andrej-karpathy-skills — 基于 Karpathy 经验的 Claude Code 行为优化指南
代码审查一份 CLAUDE.md 文件,治好 AI 写代码的坏毛病
Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed. Tradeoff: These guidelines bias toward caution over speed. For trivial tasks, use judgment. 1. Think Before Coding Don't assume. Don't hide confusion. Surface tradeoffs. 2. Simplicity First Minimum code that solves the problem. Nothing speculative. 3. Surgical Changes Touch only what you must. Clean up only your own mess. 4. Goal-Driven Execution Define success criteria. Loop until verified.
◉ 使用前
- 不问就动手,默默假设需求然后写错方向
- 200 行能解决的事写 500 行,疯狂加抽象加配置
- 改一个 bug 顺手优化半个文件,diff 看得人头疼
- 目标模糊就开写,写完才发现理解错了
◉ 使用后
- 先问清楚再动手,主动暴露假设和不确定性
- 最少代码解决问题,不加没人要的功能
- 只改该改的,不碰无关代码,diff 干净利落
- 把模糊需求拆成可验证目标,循环执行直到通过