Files
everything-claude-code/rules/zh/performance.md
xingzihai 3f5e042b40 feat: add Chinese (zh-CN) translation for rules/common
- Add rules/zh/ directory with complete Chinese translations
- Translate all 10 common rule files:
  - coding-style.md
  - security.md
  - testing.md
  - git-workflow.md
  - performance.md
  - patterns.md
  - hooks.md
  - agents.md
  - development-workflow.md
  - code-review.md
- Add README.md for the zh directory explaining structure and installation
- Maintain consistent formatting with original English versions
- Keep technical terms and code examples in English where appropriate
2026-03-26 01:38:39 +00:00

1.4 KiB
Raw Blame History

性能优化

模型选择策略

Haiku 4.5Sonnet 90% 的能力3 倍成本节省):

  • 频繁调用的轻量级代理
  • 结对编程和代码生成
  • 多代理系统中的工作者代理

Sonnet 4.6(最佳编码模型):

  • 主要开发工作
  • 编排多代理工作流
  • 复杂编码任务

Opus 4.5(最深度推理):

  • 复杂架构决策
  • 最大推理需求
  • 研究和分析任务

上下文窗口管理

避免在上下文窗口的最后 20% 进行以下操作:

  • 大规模重构
  • 跨多个文件的功能实现
  • 调试复杂交互

上下文敏感度较低的任务:

  • 单文件编辑
  • 独立工具创建
  • 文档更新
  • 简单 bug 修复

扩展思考 + 规划模式

扩展思考默认启用,为内部推理保留最多 31,999 个 token。

通过以下方式控制扩展思考:

  • 切换Option+TmacOS/ Alt+TWindows/Linux
  • 配置:在 ~/.claude/settings.json 中设置 alwaysThinkingEnabled
  • 预算上限export MAX_THINKING_TOKENS=10000
  • 详细模式Ctrl+O 查看思考输出

对于需要深度推理的复杂任务:

  1. 确保扩展思考已启用(默认开启)
  2. 启用规划模式进行结构化方法
  3. 使用多轮审查进行彻底分析
  4. 使用分角色子代理获得多样化视角

构建排查

如果构建失败:

  1. 使用 build-error-resolver 代理
  2. 分析错误消息
  3. 增量修复
  4. 每次修复后验证