1.2Practice note · Agent-era codebase review
Agent-era codebase review
For an engineering team with a product in production that has adopted Claude Code, Cursor or Codex and now has more merged code than anyone can hold in their head. We map the duplication and the architectural drift, and we commit the guardrails that stop them recurring.
Particulars of engagement
- Client
- The engineering team
- Receives
- Four deliverables, committed in the client’s repository
- Access
- Read-only
- Duration
- One to two weeks from read access
- Fee
- Fixed, stated in writing before work begins
- Payment
- USD invoice or Upwork Direct Contracts escrow; W-8BEN-E on request
- Lead
- A senior engineer, in person
§ 1Where the debt sits
In an agent-written codebase, debt shows up as duplicated logic and quiet architectural drift, not as messy code. An agent that cannot find an existing implementation writes the fourth copy, and no linter catches it.
What catches it is a CLAUDE.md that encodes the architecture, guardrails in the repository, and someone reviewing architecture, not only diffs.
In GitClear’s analysis of 211 million changed lines, lines classified as copied or pasted rose from 8.3% to 12.3% between 2021 and 2024, and copied code exceeded moved code for the first time.1
The 2024 DORA report estimated that, as AI adoption increased, delivery throughput decreased by 1.5% and delivery stability by 7.2%.2
§ 2What the client receives
Four deliverables, committed in the client’s repository by pull request, so that the team reviews what we leave behind.
- 2.1
Duplication and drift map
Every near-duplicate implementation and every place the architecture diverged from itself, ranked by what the component handles, such as money, personal data or authentication.
- 2.2
CI rules and lint configuration that fail the build
Rules written against the patterns found, so that the same duplication cannot return without the build failing.
- 2.3
Decision records
Architecture decision records for the decisions that were never written down.
- 2.4
A CLAUDE.md that encodes the architecture
So that the next agent finds the existing implementation instead of writing another one.
§ 3How the review runs
- 3.1
Access
A read-only invitation to the repository, or an archive of it. We do not execute the client’s code; the analysis is static, on a clone, with the configuration the client chooses to share.
- 3.2
Measurement and map
The repository and its history are measured for near-duplicates and for departures from the intended architecture, and the findings are ranked.
- 3.3
Guardrails and records
The CI rules, lint configuration, decision records and CLAUDE.md are committed in the client’s repository.
- 3.4
Fee and payment
The fee is fixed and stated in writing before work begins. Payment is made by USD invoice or through Upwork Direct Contracts escrow.
§ 4Questions engineering leaders ask
- 4.1
We already run a duplicate-code checker
Tools such as jscpd, PMD CPD and SonarQube find token-identical blocks, and they should stay in place. The map is for what they miss: the near-duplicate that diverged after it was copied, and the same rule implemented several ways across modules. The rules we commit extend the tools already in use.
- 4.2
Does the review need to run our code
No. The analysis is static, on a clone, plus the configuration the client chooses to share.
- 4.3
We are not in payments
Payments is where our engineers learned what an unsafe change costs. The method is the same for any codebase where a wrong change is expensive.
- 4.4
Can we see the work product
The sample report, on a fictional company, is published in full. Read the sample drift report
Sources
- GitClear, “AI Copilot Code Quality: 2025 Look Back”, 2025. Scope: 211 million changed lines of code authored January 2020 to December 2024. gitclear.com/ai_assistant_code_quality_2025_research. Read at source 23 October 2026.
- Google Cloud, DORA, “Highlights from the 10th DORA report”, 22 October 2024. Scope: the DORA 2024 survey; the estimate is stated per increase in AI adoption. cloud.google.com/blog/products/devops-sre/announcing-the-2024-dora-report. Read at source 23 October 2026.