Games & code · The What2Prompt engine

Claude Code prompts for planning, coding and review

Strong Claude Code prompts make the task observable: the symptom, relevant files, what must stay unchanged and which check proves success. Use these examples to investigate a repository, plan a narrow change and review the diff before you accept it. Prompts guide the work; permissions and tests protect it.

See all prompt guides →
2Which AI will you paste it into?
Short and punchy.
1 credit per prompt

Works with ChatGPT, Claude, Gemini, Midjourney, Suno and more.

Copy · Paste · Done
STEP 3 · YOUR PROMPT
Prompt for Claude CodeQuickExample

Role

Coding assistant reviewing the existing repository.

Context

Use the actual source files, diff and failing cases available in this project.

Task

Inspect this repository to find why the saved-prompts list shows older records first.
Locate the query, the list rendering and any existing tests.
Explain the likely cause with file references before editing.
Add a regression test with two distinct timestamps, run the relevant tests and report the observed result.

Format

Then propose the smallest fix that makes ordering newest first without changing access rules or the page design.

Guardrails

Do not rewrite unrelated modules or expose credentials.
5 free prompts

Example prompts

Example

Investigate before changing code

Role

Coding assistant reviewing the existing repository.

Context

Use the actual source files, diff and failing cases available in this project.

Task

Inspect this repository to find why the saved-prompts list shows older records first.
Locate the query, the list rendering and any existing tests.
Explain the likely cause with file references before editing.
Add a regression test with two distinct timestamps, run the relevant tests and report the observed result.

Format

Then propose the smallest fix that makes ordering newest first without changing access rules or the page design.

Guardrails

Do not rewrite unrelated modules or expose credentials.
Example

Implement a scoped feature

Role

Coding assistant reviewing the existing repository.

Context

Use the actual source files, diff and failing cases available in this project.

Task

Add a favourite toggle to the existing saved-prompts page.
First read the current data types, ownership checks and update flow.
Use the established UI controls and keep users limited to their own records.
Plan the change before implementing it.
Cover adding and removing a favourite, a failed save and a different user’s record in relevant tests.
Afterward summarize the files changed and any checks you could not run.

Format

Inspect first, give a focused plan, then report changes and test evidence.

Guardrails

Do not create a parallel data layer.
Example

Review a risky diff

Role

Coding assistant reviewing the existing repository.

Context

Use the actual source files, diff and failing cases available in this project.

Task

Review the current diff without modifying files.
Look for access-control regressions, lost error handling, accidental credential exposure and changed query ordering.
Prioritize findings by user impact and cite the exact code supporting each one.
Distinguish confirmed defects from questions that need runtime evidence.
Suggest a focused test for each likely regression.
If you find no concrete issue, say so and list the checks performed rather than inventing criticism to fill a report.

Format

Inspect first, give a focused plan, then report changes and test evidence.

Guardrails

Preserve existing work. Ask for missing inputs; do not invent source files, paths or successful test results.

A Claude Code prompt should define scope and verification

Describe a user-visible symptom and the smallest reproduction you have. Name relevant files only when you know them; otherwise ask the agent to locate the code before proposing a change. Supply the expected behavior and boundaries that the repository cannot explain, such as a billing rule or a required public URL. Tell the agent to inspect existing patterns rather than create a parallel implementation just because a new module looks cleaner.

For a risky change, request a short investigation and plan first. Ask which assumptions remain and what check will prove the result. Then authorize the scoped implementation. A useful completion report identifies changed files, tests actually run and any missing checks. Do not accept invented successful test output. For a small well-reproduced defect, keep planning proportionate instead of turning a two-line correction into an unrelated architecture project.

Include concrete acceptance cases. A list-ordering change needs two timestamps and expected order. An access-control change needs an owner and a different user. A file utility needs duplicate-name and permission-failure cases. Ask for error handling as well as the happy path. Review the diff yourself, especially when work touches user data, deletion, permissions or payments. Prompt boundaries guide behavior but do not replace restricted credentials and enforced policies.

Debug without losing the parts that work

When a test fails, supply the exact output and ask for a diagnosis grounded in the current source. Require a narrow fix that preserves unrelated behavior. If the tool cannot run a check, it should say so and provide a reproducible next step rather than claiming completion. Never paste tokens or private customer records into a debugging prompt. Use minimal sanitized examples and keep destructive commands subject to explicit review.

What makes a good Claude Code prompt

  1. Supply a symptom and reproduction. “Fix the dashboard” is vague; a failed action with an expected result gives the agent a target.

  2. Ask it to inspect before editing when the cause is unknown. Existing code often answers questions that a speculative rewrite would miss.

  3. Define boundaries: access rules, public URLs, data shape and design. Explicitly preserve behavior that must survive the change.

  4. Give a check that can fail. A regression test, real form submission or reproduced error is better evidence than a confident summary.

  5. Require an honest completion report. Separate what changed, what ran and what remains unverified so you can decide whether to accept it.

Bad prompt vs What2Prompt prompt

Bad prompt

“fix my app”

What2Prompt prompt

Role

Coding assistant reviewing the existing repository.

Context

Use the actual source files, diff and failing cases available in this project.

Task

Reproduce the saved-prompts ordering bug, inspect the existing query, apply the smallest change and run a test showing the newer timestamp appears first.
Preserve all owner-access checks.

Format

Inspect first, give a focused plan, then report changes and test evidence.

Guardrails

Preserve existing work. Ask for missing inputs; do not invent source files, paths or successful test results.

This brief makes success measurable and limits the blast radius. The What2Prompt engine helps describe the task; your coding tool still needs appropriate repository access, permissions and review of the resulting diff.

Keep the conversation grounded in observations. If a patch fails, share the exact test output and ask for a diagnosis instead of repeating the original request more forcefully. Before accepting the result, read the diff and check the behavior a real user encounters. A report that admits a missing test is more useful than one claiming everything works without evidence.

Reference: Claude Code best practices ↗

Questions about Claude Code prompts

Should I ask Claude Code to plan before coding?

For an unfamiliar area or a risky change, planning helps expose assumptions before files are edited. Small, well-specified repairs may not need an elaborate plan. Ask for enough investigation to identify the relevant code, the intended change and its verification, without turning every simple task into a long architecture exercise.

What should I put in a Claude Code prompt?

Include the user-visible goal, relevant reproduction or sample input, important constraints and a verification command or test. Explain facts the repository cannot reveal, such as an external process or business requirement. Avoid pasting secrets. Let the tool inspect code it can access rather than duplicating an entire repository in your message.

Does a detailed prompt make code safe automatically?

No. Prompts guide behavior but do not replace permissions, access policies or tests. Review changes that touch security, billing, destructive operations or user data. Claude Code’s documentation specifically distinguishes instructions from enforced rules: a boundary that must never be crossed needs a technical safeguard, not only a sentence asking for care.

What2Prompt prompt engine, with the W2P mark on cobalt.

Give your next idea a better brief.