How to prepare for AI-driven code modernization projects 如何为人工智能驱动的代码现代化项目做好准备
How to organize AI-driven modernization projects for critical systems and regulated enterprises.如何为关键系统和受监管企业组织人工智能驱动的现代化项目。
In our Notes from the Field series, Anthropic forward deployed engineers share best practices inspired by real customer deployments. In this article, we share our experience managing large code modernization projects.在我们的“实地笔记”(Notes from the Field)系列文章中,Anthropic 的前线部署工程师会分享从真实客户部署案例中总结出的最佳实践。在本文中,我们将分享管理大型代码现代化项目的经验。
Code modernizations once scoped as multi-year, all-hands efforts can now finish in months (or weeks), but the organizational work on either side often remains the same.过去被规划为多年期、全员参与的代码现代化项目,现在可以在数月(甚至数周)内完成,但项目前后的组织工作往往保持不变。
For example, every change to a critical banking system must go through change management, review, and approval. It is a robust process because regulators, auditors, and the business require it.例如,对关键银行系统的每一次变更都必须经过变更管理、审查和批准。这是一个稳健的流程,因为监管机构、审计人员和业务部门都有此要求。
Those processes are what make critical systems trustworthy, and they were built on the assumption that a human wrote each change and a human would review each diff. Once agents accelerate writing the changes, the bottleneck shifts from producing changes to mobilizing the organization around them.正是这些流程确保了关键系统的可靠性,而这些流程的构建前提是:每一次变更都由人工编写,每一次差异(diff)都由人工审查。一旦智能体(Agent)加快了编写变更的速度,瓶颈就会从“产生变更”转移到“围绕变更调动整个组织”上。
This article covers the work enterprises must do before the modernization takes place: defining what done means, what evidence a change must carry, how certified changes will reach production, and what has to be staged so the run can start.本文涵盖了企业在实施现代化之前必须完成的工作:定义“完成”的标准、变更必须携带的证据、经过认证的变更如何进入生产环境,以及在运行开始前需要准备的阶段性工作。
We break this process into six steps:我们将此过程分为六个步骤:
- Define the target: the tech stack and behavior the modernized code must have.定义目标:现代化代码必须具备的技术栈和行为。
- Create the certificate: the conditions that the changes must meet to be considered correct in the target state.创建证书:变更必须满足的条件,以被视为在目标状态下是正确的。
- Set the promotion policy: the path by which certified changes get into production at the rate they’re produced.设定推广策略:已认证的变更以其产生的速度进入生产环境的路径。
- Put the prerequisites in place: environment, CI/CD, review capacity, and approvals.落实先决条件:环境、CI/CD、审查能力和审批。
- Build and refine the agentic workflow: the custom Claude Code dynamic workflow that distributes the modernization across many smaller parallel subagent workstreams that produce the changes. This is built around the target, certificate, and promotion policy.构建并优化智能体工作流:自定义的 Claude Code 动态工作流,将现代化任务分配给许多较小的并行子智能体工作流来产生变更。这是围绕目标、证书和推广策略构建的。
- Run the modernization: prove the workflow end to end on a small partition of the codebase, then scale.运行现代化:在代码库的一小部分上端到端地验证工作流,然后进行扩展。
Step 1: Define the target第 1 步:定义目标
The target is the end state of the modernization. The desired end state determines which of the three kinds of modernization you are doing, detailed in the table below.目标是现代化的最终状态。预期的最终状态决定了您正在进行哪种类型的现代化,下表对此进行了详细说明。
Determine the modernization type确定现代化类型
Determining which type of modernization to do is often debated inside an organization. In our experience, the people closest to production want the stack swapped with behavior held constant to contain risk (transform modernization). On the other side are often the engineers who have lived with the codebase and want the modernization to pay down tech debt, plus other business stakeholders who want to take the opportunity to name new requirements (reimagine modernization).确定采用哪种现代化类型在组织内部经常引发争论。根据我们的经验,最贴近生产环境的人员希望在保持行为不变的情况下更换技术栈,以控制风险(转换式现代化)。而另一方通常是那些长期维护代码库的工程师,他们希望通过现代化来偿还技术债务,以及其他希望借此机会提出新业务需求的利益相关者(重构式现代化)。
Both positions are reasonable, but if the question is left unresolved it resurfaces later as an argument over whether a given change is “correct.” Building consensus on which path to take adds initial friction, but streamlines the project as a whole.这两种立场都有其合理性,但如果问题悬而未决,稍后就会演变成关于特定变更是否“正确”的争论。就采取哪种路径达成共识会增加初期的摩擦,但会使整个项目更加顺畅。
Map the codebase and create the behavioral spec映射代码库并创建行为规范
Understanding the current system is often a good first step for defining the target. Extracting what the old code actually does and creating an inventory of current behavior makes it easy to decide if parts should be changed or dropped, and so whether the modernization is a transform or a reimagine. This also often reveals unknown business logic and edge cases.了解现有系统通常是定义目标的第一步。提取旧代码的实际功能并盘点当前行为,可以更容易地决定哪些部分应该修改或舍弃,从而确定是进行转换式现代化还是重构式现代化。这也经常能揭示出未知的业务逻辑和边缘情况。
Claude can do much of that discovery by mapping dependencies and documenting workflows that nobody remembers building. The code modernization plugin’s assess, map, and extract-rules commands mine business rules with source citations that engineers can then review.Claude 可以通过映射依赖关系和记录无人知晓其构建过程的工作流来完成大部分此类发现工作。代码现代化插件的 assess(评估)、map(映射)和 extract-rules(提取规则)命令可以挖掘带有源码引用的业务规则,供工程师审查。
However, Claude’s discovery alone may not capture how a legacy system fully behaves. Interviews with business users and developers, and internal documentation, can fill those gaps. Context gathering may take some time upfront, but the quality of that context shapes every decision the workflow makes later.然而,仅靠 Claude 的发现可能无法完全捕捉遗留系统的行为方式。与业务用户和开发人员的访谈,以及内部文档,可以填补这些空白。收集背景信息可能需要一些前期时间,但背景信息的质量决定了工作流后续所做的每一个决策。
For a reimagine, defining the target requires additional work: a detailed behavioral spec should be written down and agreed with user groups.对于重构式现代化,定义目标需要额外的工作:应编写详细的行为规范,并与用户组达成一致。

Establish the project’s justification and goals确立项目的正当性和目标
Alongside defining the target, the organization should consider why the modernization is worth undertaking at all. Modernizing legacy systems can reduce ongoing maintenance and operational costs, however, in our experience, cost reduction has not been the driving goal of most modernization projects.在定义目标的同时,组织应考虑为什么值得进行这项现代化工作。现代化遗留系统可以降低持续的维护和运营成本,但根据我们的经验,降低成本并不是大多数现代化项目的主要驱动目标。
“Risk reduction is often the most important modernization benefit. Consider the risk of not doing the modernization when debating whether or not to undergo the project.”“风险降低通常是现代化最重要的益处。在讨论是否要进行项目时,请考虑不进行现代化的风险。”
For example, a system carrying unpatched vulnerabilities can mean a cyber breach or an outage severe enough to put the business itself at risk. An unsupported runtime or a shrinking pool of engineers who understand the system exacerbates the risk.例如,一个带有未修补漏洞的系统可能意味着网络攻击或严重的业务中断,甚至危及企业自身。不受支持的运行时环境或了解该系统的工程师群体日益萎缩,都会加剧这种风险。
Agentic coding tools like Claude Code have shortened modernization timelines, but budgets are still hard to estimate, which leads to inertia. We have released the costs of some of our large-scale modernizations as have others. These can serve as a rough baseline, and we have additional guidance on budget projections at the bottom of this guide.像 Claude Code 这样的智能体编码工具缩短了现代化时间表,但预算仍然难以估算,这导致了行动迟缓。我们已经发布了一些大型现代化项目的成本,其他人也一样。这些可以作为粗略的基准,我们在本指南底部提供了关于预算预测的额外指导。
The main challenge in initiating these projects is usually building the internal consensus and commitment from the teams that own the system, and the teams that depend on it. Building the business case and setting the goals of the project, often at the leadership level, make this part of the process easier. This also helps anchor the tradeoffs in the certificate and promotion policy that follow. When stakeholders disagree over how much risk a change can carry, the risk of not modernizing is the counterweight.启动这些项目的主要挑战通常在于建立内部共识,以及获得系统所有者团队和依赖该系统的团队的承诺。建立业务案例并设定项目目标(通常在领导层层面)可以使这一过程更容易。这也有助于为随后的证书和推广策略中的权衡确立基准。当利益相关者对变更所能承担的风险水平产生分歧时,不进行现代化的风险就是平衡砝码。
Step 2: Define the certificate第 2 步:定义证书
The certificate is the set of conditions or tests that every modernization change must meet. Pick the conditions that give the strongest cumulative evidence that the change is correct against the target.证书是一组条件或测试,每个现代化变更都必须满足这些条件。选择那些能提供最强累积证据的条件,以证明变更相对于目标是正确的。
Each condition should be checkable without a human in the loop, so the agentic workflow can iterate on a change until it meets the certificate or flag it for human review if it can’t.每个条件都应在无需人工干预的情况下即可检查,以便智能体工作流可以迭代变更,直到其满足证书要求;如果无法满足,则将其标记为需要人工审查。
What goes into the certificate depends on the target, but will usually draw from this list:证书包含的内容取决于目标,但通常会参考以下列表:
- The original test suite passes原始测试套件通过
- Claude-authored tests written during the modernization all pass现代化期间编写的 Claude 编写的测试全部通过
- Test coverage meets an agreed threshold测试覆盖率达到商定的阈值
- Performance benchmarks stay within an agreed bound性能基准保持在商定的范围内
- Independent adversarial reviews by Claude, each in a fresh context window, find no blocking issuesClaude 在新的上下文窗口中进行的独立对抗性审查未发现阻塞性问题
- For user interfaces, Claude-driven computer use finds no regressions对于用户界面,Claude 驱动的计算机使用未发现回归
- Current and target versions produce the same output from the same input, which can be live, recorded, or Claude-generated当前版本和目标版本在相同输入下产生相同输出,输入可以是实时的、记录的或 Claude 生成的
- Persisted state and wire formats round-trip between current and target versions持久化状态和连线格式在当前版本和目标版本之间往返一致
- Changes run in staging for an agreed period with no regressions in error rates, latency, or alerts变更在暂存环境中运行一段商定的时间,错误率、延迟或警报没有回归
- Static analysis and security scans show no new findings静态分析和安全扫描未显示新发现
- For compiled targets, the build is clean and type checks pass对于编译目标,构建是干净的且类型检查通过
“Write the certificate with the people who will review and promote changes into production. Bring in the developers, user groups, and business leads who depend on the codebase now, while the certificate and agentic workflow are still being designed.”“与将审查并推动变更进入生产环境的人员一起编写证书。在设计证书和智能体工作流时,尽早引入目前依赖该代码库的开发人员、用户组和业务主管。”
Their expertise shapes what the certificate measures, and their early involvement is what earns their buy-in when changes reach review. A good check on the finished certificate is whether they would be comfortable merging on the certificate's evidence alone. If they see their own bar in it, the promotion policy in Step 3 can be lighter.他们的专业知识决定了证书的衡量标准,他们的早期参与是当变更进入审查阶段时获得其认可的关键。检验完成后的证书的一个好方法是:他们是否愿意仅凭证书的证据就进行合并。如果他们看到了自己设定的标准,第 3 步中的推广策略就可以更宽松。
What the certificate checks against, and how, depends on the modernization type.证书针对什么进行检查以及如何检查,取决于现代化类型。
- For an uplift modernization, parity is against the original codebase, and the original test suite can be the core of the certificate.对于升级式现代化(Uplift),一致性是针对原始代码库的,原始测试套件可以作为证书的核心。
- For a transform modernization, parity is also against the original codebase, but the original test suite rarely runs on the new stack. Replay of production traffic, differential testing between old and new, and a prod-parallel deployment do most of the work instead.对于转换式现代化,一致性也是针对原始代码库的,但原始测试套件很少能在新栈上运行。重放生产流量、新旧差异测试以及生产平行部署反而完成了大部分工作。
- For a reimagine modernization, the certificate is anchored in the behavioral spec. This is the hardest case. A spec is less objective than an existing system to diff against, so a larger degree of model judgement is involved, which can lead to more variable outcomes. Here, the certificate leans on tests written from the spec, independent adversarial reviews by Claude that check each change against the sec, and differential checks where the new system keeps the old one’s behavior. Expect to revise the certificate as the spec is clarified: gaps in the spec show up here first.对于重构式现代化,证书锚定在行为规范中。这是最困难的情况。规范不如现有系统那样客观,无法直接进行差异对比,因此涉及更大程度的模型判断,这可能导致结果更加多变。在这里,证书依赖于根据规范编写的测试、Claude 进行的检查每个变更是否符合规范的独立对抗性审查,以及新系统保持旧系统行为的差异检查。预计随着规范的澄清,需要修订证书:规范中的空白会首先在这里显现出来。
Older systems often have thin test coverage, flaky tests, and little telemetry. Part of defining the certificate is identifying these gaps. If it will be difficult to support a strong certificate, one of the most useful things to do at this step is to use Claude to build the missing evidence, whether that’s standing up a prod-parallel setup, building a replay harness, or writing more tests.旧系统通常测试覆盖率低、测试不稳定且遥测数据很少。定义证书的一部分就是识别这些差距。如果难以支持强有力的证书,此步骤中最有用的做法之一是使用 Claude 来构建缺失的证据,无论是搭建生产平行环境、构建重放工具,还是编写更多测试。
Step 3: Set the promotion policy第 3 步:设定推广策略
Agents will produce changes far faster than any human team can review them diff-by-diff. The promotion policy is a tiered review path–written down and agreed in advance–that sets the depth of human review for a change, so the modernization can finish on an acceptable timeline.智能体产生变更的速度将远超任何人工团队逐个差异(diff)审查的速度。推广策略是一种分层的审查路径——提前书面记录并达成一致——它设定了人工审查变更的深度,以便现代化项目能在可接受的时间表内完成。
Like the certificate, work this step with the reviewers, and fit it into your organization's existing change-management process wherever you can. The details will differ by organization and the risk tradeoffs it faces, but a few rules hold everywhere:像证书一样,与审查人员一起完成此步骤,并尽可能将其融入您组织现有的变更管理流程中。具体细节会因组织及其面临的风险权衡而异,但有一些规则在任何地方都适用:
- Tier changes by blast radius and agent confidence. Use your organization's own change or risk classification if it has one. Keep full human review for critical paths.按影响范围和智能体置信度对变更进行分级。如果您的组织有自己的变更或风险分类,请使用它。对关键路径保留完全的人工审查。
- Fix recurring flags at the source. Group and analyze the flagged changes over time. When the same kind of flag keeps recurring, fix the cause in the agentic workflow or the certificate rather than reviewing each one.从源头修复重复的标记。随时间推移对标记的变更进行分组和分析。当同一类标记不断出现时,应在智能体工作流或证书中修复原因,而不是审查每一个标记。
- Design the output format with the reviewers. Agree on what information and format make review the fastest, and what signals give more confidence than others. Have them review early sample outputs in Step 5.与审查人员共同设计输出格式。就哪些信息和格式能使审查最快,以及哪些信号比其他信号提供更多置信度达成一致。让他们在第 5 步中审查早期的样本输出。
- Allocate SME time effectively. SMEs won't read every final diff, but their judgment is still the scarce input. Make it easy for them to go straight to the changes in the highest-risk tiers, and to the flagged agent decisions within each one, without wading through large diffs. A small number of expert hours then covers the changes that carry the most risk.有效分配中小企业(SME)的时间。SME 不会阅读每一个最终的差异,但他们的判断仍然是稀缺资源。让他们能够轻松直接地进入最高风险层级的变更,以及每个层级内被标记的智能体决策,而无需查看大量的差异。少量的专家时间随后就能覆盖风险最高的变更。
Many of these rules front-load SME hours by engaging them early in the project. Their feedback tunes the certificate and the agentic workflow before the full modernization begins.这些规则中的许多通过让 SME 尽早参与项目来前置他们的工作时间。他们的反馈会在全面现代化开始之前调整证书和智能体工作流。
Their sign-off on the samples also becomes further justification for a lighter review path where there is high confidence. This is the reverse of the traditional, non-agentic pattern, where review happens at the end.他们对样本的签字确认也成为了在置信度高的情况下采取更轻量级审查路径的进一步理由。这与传统的非智能体模式相反,传统模式中审查发生在最后。

The promotion policy should also reflect where the modernization sits on the spectrum between speed and review depth. A modernization racing to a hard deadline, such as a runtime losing support, needs a faster policy with lighter human review and an explicit agreement to accept more risk per change.推广策略还应反映现代化在速度与审查深度之间的平衡点。一个正在竞速截止日期(例如运行时失去支持)的现代化项目,需要更快的策略、更轻量的人工审查,以及关于接受每个变更更多风险的明确协议。
A modernization on a longer timeline can afford deeper human review and a slower cutover. Stakeholders will land on different points of this spectrum depending on their risk appetite and constraints so it is worth locking in before the work starts.时间表较长的现代化项目可以承担更深的人工审查和更慢的切换。利益相关者会根据他们的风险偏好和约束条件落在该谱系的不同点上,因此在工作开始前锁定这些点是值得的。
In a regulated environment, taking a lighter human review path for any change can cause real discomfort. Individual approvers hesitate to sign off because they carry the risk of a bad change, while leadership carries the larger risk of an aging system.在受监管的环境中,对任何变更采取更轻量的人工审查路径都可能引起真正的不适。个人审批者因为承担了错误变更的风险而犹豫不决,而领导层则承担着系统老化的更大风险。
In our experience, it is best to have the directive for the promotion policy come from the top of the organization. It is also better to agree on it beforehand so responsibility for a bug that reaches production is shared, not pinned on whoever approved the change.根据我们的经验,最好由组织高层下达推广策略的指令。最好提前达成一致,以便对进入生产环境的错误承担责任是共享的,而不是归咎于批准变更的人。
“All of this still depends on a certificate detailed enough to serve as real evidence, and on reviewers who understand how Claude arrived at a change well enough to trust it.”“所有这些仍然取决于足够详细以作为真实证据的证书,以及足够理解 Claude 如何得出变更并足以信任它的审查人员。”
Step 4: Put the prerequisites in place第 4 步:落实先决条件
Much of this step runs through teams outside the modernization: platform or infrastructure for the host, QA or release engineering for test capacity, security and compliance for approvals. Each of those teams often has its own backlog or approval process, so open the conversations early, as soon as you have identified the requirements, often while Steps 1 through 3 are still underway.此步骤的大部分工作由现代化项目之外的团队完成:平台或基础设施团队负责主机,QA 或发布工程团队负责测试能力,安全和合规团队负责审批。这些团队中的每一个通常都有自己的积压工作或审批流程,因此一旦确定了需求,请尽早开始对话,通常在第 1 至第 3 步进行时就开始。
Environment环境
- A dedicated remote host for running the workflow with the codebase and other relevant sources reachable by Claude一个专用的远程主机,用于运行工作流,且 Claude 可以访问代码库和其他相关源
- Test capacity as required by the certificate证书要求的测试能力
- Anything that strengthens the certificate: production telemetry, a prod-parallel setup, or production data for replay任何能加强证书的东西:生产遥测、生产平行设置或用于重放的生产数据
Codebase and CI/CD代码库和 CI/CD
- A dependency map of the codebase, grounded in build and compile logs; import analysis; or runtime traces. Note: The plugin’s map command is a good starting point, but depending on the size and age of the codebase, more extensive upfront work may need to be done基于构建和编译日志、导入分析或运行时跟踪的代码库依赖关系图。注意:插件的 map 命令是一个很好的起点,但根据代码库的大小和年限,可能需要进行更广泛的前期工作
- Planned treatment of any dependencies or packages, as part of the target definition作为目标定义的一部分,对任何依赖项或包的计划处理
- A compatibility check ready to add to CI/CD, if needed如果需要,准备添加到 CI/CD 的兼容性检查
- An agreed code-freeze policy, if you are modernizing in place如果您在原地进行现代化,则需要商定的代码冻结策略
- A communication plan for active developers covering any code freezes and new compatibility requirements针对活跃开发人员的沟通计划,涵盖任何代码冻结和新的兼容性要求
Teams and review团队和审查
- Agreement from other teams that depend on the codebase on how they take part, like signing off on the certificate or reviewing under the promotion policy, with reviewer time set aside依赖该代码库的其他团队同意参与方式,例如签署证书或在推广策略下进行审查,并预留审查人员时间
Security and compliance安全和合规
- A model access path for Claude Code approved for source code已批准用于源代码的 Claude Code 模型访问路径
- Least-privilege access for the agentic workflow: write only to modernization branches and no production credentials智能体工作流的最小权限访问:仅写入现代化分支,且无生产凭据
- Secrets and PII scrubbed or masked from the modernization branch从现代化分支中清除或掩盖密钥和 PII
- Every change traceable and PR linked to an agent transcript and certificate evidence每个变更均可追溯,且 PR 链接到智能体转录和证书证据
- License and vulnerability checks on new dependencies新依赖项的许可证和漏洞检查
Step 5: Build and refine the agentic workflow第 5 步:构建并优化智能体工作流
Use Claude Code to develop a customized dynamic workflow for modernizing the codebase.使用 Claude Code 开发一个定制的动态工作流来现代化代码库。
We recommend starting with the code modernization plugin, and putting everything the workflow may need on the file system or over MCP, where Claude can reach it. This includes the target, certificate, promotion policy, codebase, documentation, and whatever data sources or tooling the certificate requires. You can give this article to Claude as context too. This forms the central knowledge base for the project.我们建议从代码现代化插件开始,并将工作流可能需要的一切放在文件系统上或通过 MCP 提供,以便 Claude 可以访问。这包括目标、证书、推广策略、代码库、文档以及证书所需的任何数据源或工具。您也可以将本文作为背景提供给 Claude。这构成了项目的核心知识库。
With that in place, building the modernization workflow is the easy part. Have SMEs review Claude’s work as needed, including any codebase-specific skills or extracted rules before anything downstream relies on it.有了这些,构建现代化工作流就很简单了。让 SME 根据需要审查 Claude 的工作,包括任何特定于代码库的技能或提取的规则,然后再让下游依赖它。
Refine what you've built by applying it to small parts of the codebase, with SMEs reviewing the changes it produces, the agents’ process, and the evidence the certificate was met.通过将其应用于代码库的一小部分来优化您构建的内容,并让 SME 审查它产生的变更、智能体的流程以及满足证书的证据。
“You should modify the workflow, not each change, when issues surface. The goal is confidence that, once scaled, changes will meet the certificate almost everywhere and reviewers will be comfortable merging under the promotion policy.”“当出现问题时,您应该修改工作流,而不是修改每个变更。目标是确保一旦扩展,变更几乎在任何地方都能满足证书要求,并且审查人员能够放心地在推广策略下进行合并。”
Step 6: Run the modernization第 6 步:运行现代化
First, complete the modernization end to end on a small part of the codebase, including reviewing and landing the changes through the promotion policy. Fix anything that doesn’t work while it’s still cheap, repeat the process until you are confident, then scale to the full codebase.首先,在代码库的一小部分上端到端地完成现代化,包括通过推广策略审查和落地变更。在成本尚低时修复任何不起作用的地方,重复此过程直到您有信心,然后扩展到整个代码库。
While transform and reimagine modernizations involve building the target alongside the existing system and cutting over once complete, an uplift has a second option: modernizing in place on the live codebase while development continues.虽然转换式和重构式现代化涉及在现有系统旁构建目标并完成后切换,但升级式现代化有第二个选择:在实时代码库上原地现代化,同时继续开发。
This is the usual choice when the system cannot be down, or when the codebase changes so quickly that it’s difficult to keep a separate modernized copy up to date. What we have seen work in this case is splitting the codebase into logical partitions from the leaves inward; freezing and modernizing one partition at a time; and gating CI/CD so new commits cannot undo a partition once it has been modernized.当系统不能停机,或者代码库变化太快以至于难以保持单独的现代化副本更新时,这通常是首选。在这种情况下,我们看到有效的方法是:从叶子节点向内将代码库划分为逻辑分区;一次冻结并现代化一个分区;并设置 CI/CD 门禁,以便新提交无法撤销已现代化分区的成果。

A note on cost关于成本的说明
We often get asked what a modernization like this will cost in tokens. Each modernization effort is different, but the main cost drivers include:我们经常被问到这样的现代化在 Token 消耗上需要多少成本。每次现代化工作都不同,但主要的成本驱动因素包括:
- How much of the codebase has to be read versus changed;代码库有多少需要读取,有多少需要更改;
- How involved the certificate is (verification, not writing the change, is usually the larger share in a regulated environment);证书的复杂程度(在受监管的环境中,验证通常比编写变更所占的份额更大);
- How much new test writing and test repair the certificate demands; and证书要求编写和修复多少新测试;以及
- How much reconciliation work comes from other teams merging around you while the run is in progress.运行期间其他团队在您周围合并代码所产生的协调工作量。
“When completing the modernization on a small part of the codebase, measure token-usage and use that to extrapolate for the rest of the run. Treat anything the pilot couldn’t see, such as reconciliation on a live codebase, as an unknown. This way you can get an estimate for the cost floor for the full modernization.”“在代码库的一小部分上完成现代化时,测量 Token 使用量并以此推断剩余运行的成本。将试点无法看到的内容(例如在实时代码库上的协调)视为未知数。这样,您就可以获得整个现代化成本底线的估算。”
Measurements from the pilot also show where to optimize your agentic workflow for cost. Find the parts of the workflow that consumed the most tokens and consider how to make them more efficient. Move compute-heavy verification signals behind cheaper gates so they only run once easier checks have passed.试点中的测量数据也显示了在哪里可以优化智能体工作流以降低成本。找到工作流中消耗 Token 最多的部分,并考虑如何使其更高效。将计算密集型的验证信号放在更便宜的门禁之后,以便只有在通过了更容易的检查后才运行它们。
Consider using models like Sonnet that balance cost and capability for the mechanical, high-volume work the certificate fully checks. Keep more intelligent models for hard transformations and the adversarial reviews that verify correctness.考虑使用像 Sonnet 这样在成本和能力之间取得平衡的模型来处理证书完全检查的机械化、大批量工作。保留更智能的模型用于困难的转换和验证正确性的对抗性审查。
You can also escalate to a more expensive model when a less expensive one fails to meet the certificate, but analyze retry rates carefully while piloting, since several cheap attempts can cost more than one expensive one. If you give Claude access to both the workflow and the pilot data, it can do much of this analysis with you.当较便宜的模型无法满足证书要求时,您也可以升级到更昂贵的模型,但在试点时要仔细分析重试率,因为几次廉价的尝试可能比一次昂贵的尝试成本更高。如果您让 Claude 同时访问工作流和试点数据,它可以与您一起进行大部分此类分析。
Beyond the modernization现代化之后
The modernized codebase is one output. The others are the workflow that produced it, a written certificate for what counts as correct, a promotion policy your change-management process has already accepted, and an evidence trail for every change that landed. Codify the playbook as a reusable asset, so the pattern is already in place for the next upgrade or rewrite.现代化的代码库只是一个产出。其他产出包括产生它的工作流、一份关于什么算作正确的书面证书、一份您的变更管理流程已经接受的推广策略,以及每个落地的变更的证据追踪。将此手册编纂为可重用的资产,以便下一次升级或重写时,该模式已经就位。
Our forward deployed engineers work through these steps with customers on their most critical systems. If you're preparing a modernization, talk to our team.我们的前线部署工程师会与客户一起在他们的最关键系统上完成这些步骤。如果您正在准备现代化,请联系我们的团队。
Additional resources其他资源
- The public codemod plugin for Claude CodeClaude Code 的公共代码修改(codemod)插件
- The AI-Native SDLC playbookAI 原生 SDLC 手册
- Code modernization playbook代码现代化手册
- COBOL Modernization with AI: Breaking the Cost BarrierAI 辅助 COBOL 现代化:打破成本壁垒