# Claude Code Prompts for a Reviewable First Diff

> A reviewable first diff in Claude Code comes from a prompt that names the route, files, expected behaviour and checks for a single observable change.

URL: https://www.matthewswong.com/en/blog/claude-code-first-diff-contract/

- Author: Matthews Wong (https://www.matthewswong.com/en/about/)
- Published: 2026-12-03
- Updated: 2026-12-03
- Category: AI

> **Key takeaway:** A reviewable first diff in Claude Code comes from a prompt that names the route, files, expected behaviour and checks for a single observable change. For a bilingual Next.js site, start with one copy adjustment and verify both locales. The resulting diff gives a reliable baseline for larger work.

What should a first prompt name?

Ask to clarify the empty-state message on a named route and preserve the existing key and interaction. Give the expected result for both languages. For example, a missing search result should invite the reader to change the query and keep the search input focused.

How should the agent find the change?

Have it locate the current string and the component that renders it before editing. A translation key can be used on more than one route. Listing those references first lets you see whether a local change would accidentally propagate.

Which checks should run?

Run the repository’s message key parity command and open both locale routes. Inspect the text and focus behaviour with the empty fixture. A healthy build confirms that the code compiles, while the route check confirms the reader sees the intended result.

What makes a diff too large to review?

Pause when the patch renames unrelated keys or reformats a large translation file. Review the reason for each changed file. If shared UI requires a code change, give it its own focused commit and describe the behaviour it preserves.

What should the completion note include?

Request the route, file paths, commands run and one line about what the reviewer should see in each locale. Check the claim against git diff and the page. Reuse the same format when a teammate runs the task with a different coding agent.

How does the next prompt build on this?

Keep the same checks and add one new behaviour such as clearing the filter. Use the first diff as a sized example of a successful patch. The agent can then estimate which files and test cases are likely to change.

## Sources and further reading

- Claude Code overview
- Claude Code workflows
- Claude Code agentic loop
- Claude Code project memory

## Source links

- https://code.claude.com/docs/en/overview
- https://code.claude.com/docs/en/common-workflows
- https://code.claude.com/docs/en/how-claude-code-works
- https://code.claude.com/docs/en/memory

## FAQ

### What should a first prompt name?

Ask to clarify the empty-state message on a named route and preserve the existing key and interaction. Give the expected result for both languages. For example, a missing search result should invite the reader to change the query and keep the search input focused.

### How should the agent find the change?

Have it locate the current string and the component that renders it before editing. A translation key can be used on more than one route. Listing those references first lets you see whether a local change would accidentally propagate.

### Which checks should run?

Run the repository’s message key parity command and open both locale routes. Inspect the text and focus behaviour with the empty fixture. A healthy build confirms that the code compiles, while the route check confirms the reader sees the intended result.

### What makes a diff too large to review?

Pause when the patch renames unrelated keys or reformats a large translation file. Review the reason for each changed file. If shared UI requires a code change, give it its own focused commit and describe the behaviour it preserves.

### What should the completion note include?

Request the route, file paths, commands run and one line about what the reviewer should see in each locale. Check the claim against git diff and the page. Reuse the same format when a teammate runs the task with a different coding agent.

---

- HTML version: https://www.matthewswong.com/en/blog/claude-code-first-diff-contract/
- Bahasa Indonesia: https://www.matthewswong.com/id/blog/claude-code-first-diff-contract/
- 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
