THU, JULY 30, 2026
Independent · In‑Depth · Practitioner‑Tested
Claude Coding

Best Claude Sonnet 5 Prompts for Coding (2026) — Before August 31 Deadline

Claude Sonnet 5 at $2/$10/M (intro pricing through August 31, 2026) is the most cost-efficient Anthropic model for coding tasks. After August 31 it moves to $3/$15/M. For teams running high-volume coding workloads, the next 30 days are the window to lock in the most cost-efficient Anthropic coding model available. Sonnet 5 handles writing, coding, and analysis tasks at quality comparable to Opus 4.8 at 60% of the price. These prompts are optimised for the Anthropic API (claude-sonnet-5) and Claude Code.

⌨️ 6 prompts 🕐 Updated Jul 30, 2026
💡 How to use these prompts: Replace everything in [BRACKETS] with your specific details before sending. Click Copy to copy any prompt to your clipboard instantly.
1
Implement a Feature From a Spec
Implement any feature from a plain English spec at $2/M
[CLAUDE SONNET 5 — $2/M THROUGH AUG 31]

Implement the following feature. Work through it autonomously and produce complete, working code — no stubs, no TODOs.

Feature spec: [DESCRIBE WHAT THE FEATURE SHOULD DO IN PLAIN ENGLISH]
Stack: [YOUR LANGUAGE AND FRAMEWORK]
Files to modify: [LIST OR DESCRIBE]
Do not touch: [FILES TO LEAVE UNCHANGED]
Definition of done: [HOW TO VERIFY IT WORKS]

Write the complete implementation. If you need to make assumptions about any unspecified detail, state them at the end.
2
Write Tests for Untested Code
Write comprehensive tests with edge cases at Sonnet 5 cost
Write complete tests for the following code. Cover the cases that matter.

Code to test: [PASTE CODE]
Framework: [JEST / PYTEST / VITEST / GO TEST / OTHER]
Test style: [UNIT / INTEGRATION / BOTH]

Write:
1. A test for the normal/happy path of each function
2. Edge cases: null inputs, empty arrays, boundary values
3. Error cases: what happens when things fail

Do not write placeholder tests — every test must assert something specific. If a function has a bug that your tests would catch, note it separately.
3
Refactor for Readability
Refactor code for readability without changing functionality
Refactor the following code for readability. Keep all existing functionality intact — only improve the code structure, naming, and clarity.

Specific improvements to make:
- Extract any function that does more than one thing into separate functions
- Rename any variable or function whose name does not clearly describe its purpose
- Simplify any condition that requires more than 3 seconds to understand
- Remove any dead code or unused variables
- Add a docstring to each function if missing

Output the refactored code with a brief summary of each change made.

Code: [PASTE CODE]
4
Code Review — Bug Focus
Find bugs in any code with specific line references and fixes
Review this code for bugs. Be specific — name the bug, show the line, explain what goes wrong, and give the fix.

Focus on:
1. Logic errors (wrong condition, off-by-one, wrong operator)
2. Null/undefined handling (what crashes if a value is missing)
3. Edge cases (what happens with empty input, large input, negative numbers)
4. Race conditions or async errors (if applicable)

Skip style preferences — only report things that will break or produce wrong output.

Language: [LANGUAGE]
Code: [PASTE CODE]
5
Generate API Documentation
Generate complete API documentation from code
Write complete API documentation for the following code. Format it as markdown that can go directly into a README or docs site.

For each function/endpoint document:
- What it does (one sentence)
- Parameters: name, type, required/optional, description
- Return value: type and description
- Example request/call
- Example response/return value
- Error cases: what errors it can throw and when

Code: [PASTE YOUR API CODE OR FUNCTION SIGNATURES]
6
Migrate to a New Package or Library
Migrate code between packages or libraries with all breaking changes handled
Help me migrate from [OLD PACKAGE/LIBRARY] to [NEW PACKAGE/LIBRARY].

What I am migrating: [DESCRIBE — component, service, or codebase section]
Breaking changes I know about: [LIST ANY YOU HAVE READ ABOUT]
My current code: [PASTE CODE USING THE OLD PACKAGE]

Produce:
1. The migrated code using the new package
2. A list of every breaking change you handled
3. Any dependency changes needed in package.json / requirements.txt / go.mod
4. A test to verify the migration works correctly