# Claude Code Lab for a Reviewable Diff

> Write a focused Claude Code brief, edit one bilingual label in a practice checkout, and verify the diff against real repository checks and both routes.

URL: https://www.matthewswong.com/en/learn/claude-code-tips/claude-code-reviewable-diff-lab/

Claude Code tips · Lesson 14 of 14 · Reviewed on 3 December 2026 · Checked against Claude Code v2.1.301 · By Matthews Wong (https://www.matthewswong.com/en/about/)

> A reviewable Claude Code diff changes one observable behaviour and gives a reviewer a short way to reproduce it. In this lab you update one bilingual UI label, verify message key parity and inspect the route in both languages. You finish with the exact file paths and a repeatable acceptance check.

## You will be able to

- Write an agent brief that ties one edit to visible outcomes.
- Show the bilingual diff and the independent verification.

## Claude Code Lab for a Reviewable Diff

A reviewable Claude Code diff changes one observable behaviour and gives a reviewer a short way to reproduce it. In this lab you update one bilingual UI label, verify message key parity and inspect the route in both languages. You finish with the exact file paths and a repeatable acceptance check.

1. **Pick one label.** Use an existing string shown on a named route. Record the exact before and after text in both languages.
2. **Find its callers.** Follow the key from the messages to the component. Identify shared uses before changing the string.
3. **Inspect the diff.** The diff should explain one requested behaviour in both locale files. Check for edits outside the task.

   *Predict:* Which evidence proves both readers see the new copy? (An updated English file / The new labels visible in both routes / A green Git status)
4. **Run two checks.** Use key parity for structure and the browser for the reader’s experience.
5. **Record evidence.** Keep both route results and the command outcome beside the diff.

## Make the behaviour observable

Ask for a copy change to the blog’s Key takeaway label. Keep the existing message key common.keyTakeawayLabel and identify at least one blog route that renders it. Record that the change affects every post using that label.

Tell Claude Code to inspect references before editing. Keep both language edits in one patch so the reviewer sees how the new label translates.

## Get evidence from the route

The message parity script verifies key structure. An unchanged key can pass even if one locale still displays its previous words. Open the same blog slug under /en and /id and inspect the callout at the start of each article.

## The real config behind this lesson

`package.json`

```json
    "messages:check": "node scripts/check-message-keys.mjs",
```

This script provides independent key parity evidence. The experiment also verifies the actual words in each browser route.

## What breaks

- **Only one language changed.** Retain the existing key and update the actual Indonesian and English values. Reopen both routes even when the parity check passed.
- **A shared label changed more routes than expected.** Trace where the key is used and decide if the task calls for a global edit or a separate route-specific key.

## Try it yourself

Use a practice checkout where both language files are available.

1. Start a lab branch and inspect its starting state.

   ```bash
   git switch -c lab/reviewable-diff
   git status --short
   ```
2. In Claude Code, ask to set common.keyTakeawayLabel to “What to remember” and “Yang perlu diingat”. Have it report callers before editing.
3. Check the key tree and the diff. Then open the linked Codex comparison under /en and /id and inspect the new label.

   ```bash
   npm run messages:check
   git diff -- messages/en.json messages/id.json
   npm run dev
   ```

## Quick quiz

1. **Which evidence proves both readers see the new copy?**
   A. An updated English file
   B. The new labels visible in both routes
   C. A green Git status
   Answer: B. Open the same slug in both locales to verify the result readers see.

2. **What should you check before a shared copy edit?**
   A. Where the key is referenced
   B. The newest package release
   C. The image’s width
   Answer: A. A shared key can change several routes, so use its callers to establish the scope.

3. **What does key parity establish?**
   A. The translated headline wraps
   B. The route is indexed
   C. Both message trees share keys
   Answer: C. The structural check verifies the presence of keys. Browser evidence shows how the translated text renders.

## Think it through

- **What should you check before a shared copy edit?** A shared key can change several routes, so use its callers to establish the scope.
- **What does key parity establish?** The structural check verifies the presence of keys. Browser evidence shows how the translated text renders.

## Go deeper

- [Claude Code Prompts for a Reviewable First Diff](https://www.matthewswong.com/en/blog/claude-code-first-diff-contract/)
- [Claude Code Instruction Tests in a Real Repository](https://www.matthewswong.com/en/blog/claude-code-instructions-proof-tests/)

## Sources

- [Claude Code workflows](https://code.claude.com/docs/en/common-workflows)
- [Claude Code project memory](https://code.claude.com/docs/en/memory)

---

- HTML version: https://www.matthewswong.com/en/learn/claude-code-tips/claude-code-reviewable-diff-lab/
- Bahasa Indonesia: https://www.matthewswong.com/id/learn/claude-code-tips/claude-code-reviewable-diff-lab/
- Site index for agents: https://www.matthewswong.com/llms.txt
- Sitemap: https://www.matthewswong.com/sitemap.xml
- API description (OpenAPI): https://www.matthewswong.com/openapi.json
