How to Effectively Align with Claude Code

How to Effectively Align with Claude Code

如何与 Claude Code 有效对齐

Agentic AI: How to Effectively Align with Claude Code. Increase productivity with your LLMs. Eivind Kjosbakken, Jun 15, 2026, 10 min read. 智能体 AI:如何与 Claude Code 有效对齐。利用大语言模型提升生产力。Eivind Kjosbakken,2026 年 6 月 15 日,阅读时长 10 分钟。

In this article, I’ll discuss how to align better with your calling agents to increase your productivity when programming. 在本文中,我将探讨如何更好地与你的编程智能体对齐,从而在编程时提高生产力。

Coding agents are amazing at making quick implementations. However, now that coding has become a commodity, one of the main bottlenecks that I see is the knowledge transfer between a human brain and the coding agent. 编程智能体在快速实现功能方面表现惊人。然而,随着编程逐渐成为一种商品化技能,我发现主要瓶颈之一在于人类大脑与编程智能体之间的知识传递。

If an idea is presented correctly to the coding agent, it is extremely effective at implementing the solution, testing it, and ensuring the correct implementation. However, in a lot of cases, there are a lot of details, and it’s really hard to ensure all the details are included when you prompt the coding agent. 如果能将想法正确地传达给编程智能体,它在实现解决方案、进行测试以及确保实现正确性方面将极其高效。然而,在许多情况下,细节繁多,当你向编程智能体发出提示词时,很难确保涵盖所有细节。

This is where alignment comes in, and in this article, I’ll discuss how to effectively ensure your intentions are aligned with your coding agents, and I’ll present some techniques you can use to do this. 这就是“对齐”发挥作用的地方。在本文中,我将讨论如何有效地确保你的意图与编程智能体保持一致,并介绍一些你可以使用的技巧。

Why align with coding agents

为什么要与编程智能体对齐

First of all, I always want to discuss why you should care about a specific topic. In this case, it’s why you should align with coding agents such as Claude Code. Coding agents are incredibly good at implementing things if they’re given a very specific and well-described spec. 首先,我总是想讨论为什么要关注某个特定主题。就本例而言,即为什么要与 Claude Code 等编程智能体对齐。如果给予非常具体且描述清晰的规范,编程智能体在实现功能方面表现得非常出色。

However, creating this well-described spec is harder than you might think. First of all, you have to describe exactly what you want to implement, where you have an idea in your head of what you want to do. However, there are always a lot of nuances that are hard to cover in such a way when describing it to the coding agent. 然而,创建这种描述清晰的规范比你想象的要难。首先,你必须准确描述你想要实现的内容,尽管你脑海中已经有了构思。但在向编程智能体描述时,总会有许多难以面面俱到的细微差别。

  • You might forget to mention some parts of what has to be implemented.
  • You might be unaware of a decision you have to make regarding the implementation.
  • There might be ambiguities in your explanation.
  • 你可能会忘记提及需要实现的部分内容。
  • 你可能没有意识到在实现过程中需要做出的某些决策。
  • 你的解释中可能存在歧义。

These points are typically things that you don’t notice beforehand, because, of course, as a human, you can’t have a perfect context of what you want to implement, which, in many cases, is something you are implementing because another person has told you what you need, for example, a customer or a product manager. 这些点通常是你事先无法察觉的,因为作为人类,你不可能对想要实现的目标拥有完美的上下文。在许多情况下,你之所以要实现这些功能,是因为其他人(例如客户或产品经理)告诉了你需求。

Secondly, you don’t have full context because you’re not fully aware of everything that’s in the codebase, especially now that a lot of code is written by AI. It’s hard to have a full overview of everything beforehand, and thus, you’re missing perfect context. This is why coding agent alignment is so hard, and in this article, I’ll cover how to align with your coding agents effectively so that your coding agents perform optimally and are better at one-shotting the implementations you ask them to do. 其次,你没有完整的上下文,因为你并不完全了解代码库中的所有内容,尤其是现在许多代码是由 AI 编写的。事先全面了解一切非常困难,因此你缺失了完美的上下文。这就是编程智能体对齐如此困难的原因。在本文中,我将介绍如何有效地与编程智能体对齐,以便它们能发挥最佳性能,并更好地一次性完成你要求的实现任务。

How to align with your coding agents

如何与你的编程智能体对齐

In this section, I’ll cover specific techniques that I utilize to align with my coding agent, and also a mindset on how I align with my coding agents. Each section will include a specific idea, mindset, or technique that you can implement into your own work as a programmer to effectively align with your coding agents. 在本节中,我将介绍我用来与编程智能体对齐的具体技术,以及我与它们对齐的心态。每一部分都将包含一个具体的理念、心态或技巧,你可以将其应用到自己的编程工作中,从而有效地与编程智能体对齐。

Agents always go to the default solution

智能体总是倾向于默认解决方案

The first concept I want to cover is that coding agents always go to the default solution whenever they try to implement something. What I mean by this is that the coding agent will typically look at previous implementations of something similar in your repository, replicate that, and do it again. 我要介绍的第一个概念是,编程智能体在尝试实现任何功能时,总是倾向于默认解决方案。我的意思是,编程智能体通常会查看代码库中类似功能的先前实现,进行复制并再次执行。

This means that if your code repository is poorly organized and you ask the coding agent to implement a new feature, the coding agent will likely continue the poor pattern from before and place the new feature in a sub-optimal manner. 这意味着,如果你的代码库组织混乱,而你要求智能体实现一个新功能,它很可能会延续之前的糟糕模式,并以一种非最优的方式放置该功能。

The point I’m trying to make here is that the coding agent will just follow the natural pattern in your codebase, whether that’s a good pattern or a bad pattern. That’s why it’s so important, if you want to effectively align with your coding agent, to ensure your codebase has good patterns throughout and that you refactor your code on a regular basis. 我想表达的重点是,编程智能体只会遵循代码库中的自然模式,无论那是好模式还是坏模式。因此,如果你想与编程智能体有效对齐,确保代码库始终保持良好的模式并定期重构代码就显得至关重要。

Active usage of plan mode

积极使用计划模式 (Plan Mode)

An important technique to align with your coding agents is to actively use plan mode whenever interacting with them. Plan mode is so great because it helps you identify ambiguities between the implementation that you’re envisioning and explaining to the LLM and the current codebase. 与编程智能体对齐的一个重要技巧是在与它们交互时积极使用“计划模式”。计划模式非常棒,因为它能帮助你识别你所设想并向大模型解释的实现方案与当前代码库之间的歧义。

You might have forgotten that if you make one change to the codebase, this impacts other parts of the codebase that you didn’t think about, and you need to… 你可能忘记了,如果你对代码库进行了一处修改,这可能会影响到你未曾考虑到的其他部分,而你需要……