编码代理的组件

How coding agents use tools, memory, and repo context to make LLMs work better in practice

编码代理如何使用工具、内存和 repo 上下文来使 LLMs 在实践中更好地工作

In this article, I want to cover the overall design of coding agents and agent harnesses: what they are, how they work, and how the different pieces fit together in practice. Readers of my Build a Large Language Model (From Scratch) and Build a Large Reasoning Model (From Scratch) books often ask about agents, so I thought it would be useful to write a reference I can point to.

在本文中,我想涵盖 coding agents 和 agent harnesses 的整体设计:它们是什么、如何工作,以及不同部分在实践中如何组合。Build a Large Language Model (From Scratch)Build a Large Reasoning Model (From Scratch) 书籍的读者经常询问 agents,所以我觉得写一个可以指代的参考资料会很有用。

More generally, agents have become an important topic because much of the recent progress in practical LLM systems is not just about better models, but about how we use them. In many real-world applications, the surrounding system, such as tool use, context management, and memory, plays as much of a role as the model itself. This also helps explain why systems like Claude Code or Codex can feel significantly more capable than the same models used in a plain chat interface.

更一般地说,agents 已成为一个重要话题,因为最近在实用 LLM 系统中的许多进展不仅仅是关于更好的模型,而是关于我们如何使用它们。在许多现实世界的应用中,周围系统(如 tool use、context management 和 memory)的作用与模型本身一样重要。这也有助于解释为什么像 Claude Code 或 Codex 这样的系统感觉比在普通 chat interface 中使用的相同模型要强大得多。

In this article, I lay out six of the main building blocks of a coding agent.

在本文中,我列出了编码代理的六个主要构建模块。

Claude Code, Codex CLI, and Other Coding Agents

Claude Code、Codex CLI 和其他编码代理

You are probably familiar with Claude Code or the Codex CLI, but just to set the stage, they are essentially agentic coding tools that wrap an LLM in an application layer, a so-called agentic harness, to be more convenient and better-performing for coding tasks.

你可能熟悉 Claude Code 或 Codex CLI,但只是为了铺垫,它们本质上是 agentic coding tools,将 LLM 包装在应用层中,即所谓的 agentic harness,以在编码任务中更方便、更高效。

Figure 1: Claude Code CLI, Codex CLI, and my Mini Coding Agent .

图 1:Claude Code CL...

开通本站会员,查看完整译文。

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.1. UTC+08:00, 2026-04-08 19:52
浙ICP备14020137号-1 $访客地图$