Claude Coding Prompts: 20 to Paste Into Claude Code

Claude Coding Prompts: 20 to Paste Into Claude Code

Short answer

The Claude coding prompts that work best in Claude Code do three things: they name what Claude can't see (the symptom, the file to start from, the decision you already made), they say what done looks like, and they give Claude a command it can run to check its own work. Below are 20 copy-ready prompts grouped by job: explore a repo, plan, implement, test, debug, refactor, review a diff, write CLAUDE.md and hand work to subagents. Every Claude Code feature they mention was checked against Anthropic's docs in November 2026.

A chat prompt gets an answer. A Claude Code prompt starts a piece of work in your repository, so saying how to verify the result matters more than pasting code.

How to use these prompts in Claude Code

Anthropic describes Claude Code as an agentic coding tool that reads your codebase, edits files, runs commands and integrates with your development tools, in the terminal, IDE, desktop app and browser. The prompts below are written for that agent. If you want prompts for the Claude chat app instead, see our best Claude prompts. For settings, hooks and permissions rather than prompts, our Claude Code tips cover the configuration side.

  • Replace every [bracket]. File paths, commands and numbers are what make these prompts work. A prompt with brackets left in is a vague prompt.
  • Hand over files instead of describing them. Type @ and a path to include a file, paste a screenshot straight into the prompt, or pipe output in with claude -p from your shell.
  • Use plan mode for anything multi-file. Press Shift+Tab until the status bar shows plan mode, or start a prompt with /plan. Claude reads and proposes; edits wait for your approval.
  • Skip the magic words. Anthropic's best-practices page says phrases like think hard are ordinary text, and the effort level is the real control. One phrase it does recommend is be ambitious, when you want the fuller version of a feature.
  • Steer early. Press Esc the moment Claude drifts. After two failed corrections, the docs recommend /clear and one better prompt over a third correction.

Prompts to explore a repository

Start every new codebase read-only. The commands Claude finds here become the checks you paste into every later prompt.

1. Map the repository before touching it

Your first prompt in an unfamiliar codebase. The commands it finds get reused in every later prompt.

Before we change anything, give me a working map of this repository.
1. What the app does, in two sentences, based on the code rather than the README.
2. The 8 to 12 folders or files that matter most, one line each.
3. The exact commands to install, run, test one file, run all tests, lint and typecheck. Run the test and typecheck commands now and tell me if they pass.
4. Anything surprising: generated code, required env vars, skipped tests.
Don't edit any files.

2. Trace one request end to end

Use when you need to change a flow but don't know every file it passes through.

Trace what happens when a user [submits the checkout form / calls POST /api/orders].
Start at [@src/routes/checkout.tsx or the entry point you know] and follow it through validation, business logic, database writes, background jobs and the response.
For each step give the file, the function name and one line on what it does.
Mark any step where an error is swallowed or retried silently.
Read only. No edits.

Prompts to plan before you build

These three prompts go from a fuzzy idea to a spec, an approved plan and steps small enough to review.

3. Interview me into a spec

For features you haven't fully thought through. The answers become a file you build from in a fresh session.

I want to add [team invitations by email] but I haven't decided the details.
Ask me questions one batch at a time, multiple choice where you can, until you could write a spec without guessing. Cover: who can do what, limits, what happens on failure, what is out of scope, and how we'd know it works.
Then write the spec to [docs/specs/invitations.md] with a "Done when" checklist of testable statements. Don't write any code yet.

4. Plan a multi-file change

Run it in plan mode (Shift+Tab, or start the prompt with /plan). Claude reads and proposes; nothing is edited until you approve, and Ctrl+G opens the plan in your editor.

/plan Move [file uploads] from [local disk] to [S3-compatible storage].
In the plan, list: every file you'd change and why, new dependencies (prefer none), the order of the changes, how existing uploads keep working during the switch, which tests prove it, and how we roll back.
Flag any decision you'd want me to make rather than assume.

5. Split the work into reviewable pieces

Use after a plan is approved, when the change is too big for one pull request.

Split the approved plan into pull-request-sized steps, each under about [300] changed lines.
For each step: what it changes, what stays behind a flag or unused until a later step, and the command that proves it works on its own.
Every step must leave main deployable. Write the list to [docs/plans/storage-migration.md], then start step 1 only.

Prompts to implement a feature

Two habits do most of the work here: point at existing code to copy, and end with a command whose output you can read.

6. Build a feature by copying an existing pattern

Point at the example you want copied and the new code looks like the rest of your codebase.

Add [a CSV export button to the invoices table].
Follow the pattern in [@src/features/customers/ExportButton.tsx] for the button, loading state and error toast, and the pattern in [@src/api/customers/export.ts] for the endpoint.
No new libraries. Add tests next to the existing export tests, then run [pnpm vitest run src/features/invoices] and show me the output.

7. Build from the spec, with scope stated

Anthropic's docs say Claude tends to build the smallest thing that satisfies a request, and that telling it you want the fuller version helps. This prompt does that, and ties done to the spec's checklist.

Implement [docs/specs/invitations.md] in this fresh session.
Be ambitious about scope: empty, loading and error states, an expired-invite path, rate limiting on resend, and the email template, not only the happy path.
Work through the "Done when" checklist in order. After each item, run [the relevant test command] and tick the item in the spec only when it passes.
Finish with the full test suite and typecheck, and paste both outputs.
Build this with a prompt on Greta.sh — describe the app, Greta writes and deploys it.

Prompts to write tests

Tests are what let Claude check itself. Without one, "done" means "looks done".

8. Pin current behavior before a refactor

Characterization tests record what the code does today, bugs included, so a refactor can't change behavior by accident.

I'm about to refactor [@src/billing/proration.ts]. Before any change, write characterization tests that pin its current behavior, including odd cases that look like bugs. Label those with a comment "current behavior, confirm before changing".
Cover each exported function with at least the inputs that reach every branch.
Run the new tests and show they pass against the unchanged code. Don't modify proration.ts.

9. Find the edge cases a function misses

Failing tests first, so you see the bugs before any fix.

List the inputs that could break [@src/utils/parseDuration.ts]: empty strings, whitespace, negative and huge values, mixed units, locale decimals, null from the API.
For each one, say what the function returns today and what it should return.
Write a failing test for every case where today's result is wrong, run them to show they fail, then fix the function and run them again.

Prompts to debug

Each one asks for evidence before a fix.

10. Debug from a stack trace

Asking for the root cause first stops a patch that only hides the symptom.

This error happens when [a user with no saved cards opens /billing]:
[paste the stack trace]

Find the root cause, not the line that throws. Explain the chain from user action to crash in plain steps.
Then write a test that reproduces it, confirm it fails, fix the cause, and show the test passing along with the rest of [the billing tests].
If the fix touches more than [3] files, stop and show me the plan first.

11. Chase a flaky test

Makes Claude collect evidence across many runs before it changes anything.

[tests/e2e/checkout.spec.ts] fails about [1 in 5] runs in CI and passes locally.
Run it [20] times in a loop and record which runs fail and the error each time.
Then rank likely causes by the evidence: shared state, timing waits, test order, time zones, unmocked network calls.
Propose the smallest fix for the top cause, apply it, and run the loop again to compare.

12. Find the commit that broke it

For a regression with a known good version. git bisect does the searching; Claude runs the check at each step.

[The PDF export renders blank pages]. It worked at tag [v2.3.0] and is broken on main.
Use git bisect between those two points. At each step run [pnpm test:pdf] and mark the commit good or bad from the result.
When bisect finishes, show me the first bad commit, explain which change in it causes the bug, and run git bisect reset. Don't fix anything yet.

Prompts to refactor

A refactor that changes behavior is a bug with a nicer diff.

13. Refactor in small, checked steps

Run prompt 8 first. Each step is small enough to undo, and the tests run after every one.

Refactor [@src/billing/proration.ts] to [split the 400-line calculate function into named steps].
Go in steps no bigger than one extracted function at a time. After each step, run [pnpm vitest run src/billing] and continue only if it passes.
Keep the public function signatures unchanged. No behavior changes: if a test would need editing, stop and tell me why.
End with a short list of what moved where.

14. Migrate one pattern across many files

For a repeated mechanical change. For very large ones, Claude Code also has a bundled /batch skill that splits the work into independent units, each run in its own worktree.

Replace every use of [our old fetchJson helper] with [the apiClient in @src/lib/apiClient.ts].
First, list every file that uses it and group them by how they use it (plain GET, POST with body, custom headers, error handling).
Migrate one group at a time. After each group, run the typecheck and the tests for those folders.
Leave anything that doesn't fit a group for me, with a note on why.

Prompts to review a diff

Ask for issues that matter and nothing else. A reviewer told to find problems will always find some, so "skip style" earns its place in the prompt.

15. Review my branch before I open a PR

A focused self-review. Claude Code's /code-review command also reviews the current diff in a fresh subagent if you want a built-in pass.

Review the diff between this branch and [main] as if you were the reviewer who has to approve it.
Report only issues that affect correctness, security or data: wrong logic, missing error handling, unvalidated input, secrets in code, migrations that can't be rolled back.
For each issue: file and line, what goes wrong, and the input that triggers it. Skip style and naming.
Don't edit anything.

16. Write the pull request description

Builds the description from the real diff and test output, not from memory.

Write a pull request description for the current branch against [main].
Sections: what changed and why (3 to 5 lines), how to test it (exact commands and the URL or screen to check), risks and how they're handled, and anything deliberately left out.
Run the test suite first and include the summary line of its output.
Plain language, no marketing words, no emoji.
Want to try one of these? Start on Greta.sh — no setup, no boilerplate — just a prompt.

Prompts for CLAUDE.md and skills

CLAUDE.md is loaded every session, so every line costs context. Skills load only when they run, which makes them the right home for long procedures.

17. Write or trim CLAUDE.md

/init generates a starter file. This prompt is for the second pass, cutting it to what Claude can't learn from the code. Anthropic's memory docs suggest staying under 200 lines per file.

Rewrite our CLAUDE.md to under [80] lines.
Keep: the commands that prove work is done, rules that came from decisions or incidents (not visible in the code), and gotchas like generated folders or ports.
Remove: anything you can learn by reading the repo, such as folder layout, framework names or general coding advice.
Show me what you removed and why, then write the new file.

18. Turn a repeated prompt into a skill

Pasted the same instructions three times? Make them a slash command.

Create a project skill called [release-check] in .claude/skills/release-check/SKILL.md.
It should: confirm the branch is up to date with [main], run lint, typecheck and the full test suite, list migrations added since the last tag, and print a pass or fail summary.
Write a clear description so it's obvious when the skill applies, set disable-model-invocation: true so it only runs when I type /release-check, and show me the file before saving.

Prompts for subagent tasks

Ask for a subagent in plain words: "use a subagent to" is enough. Anthropic's docs list built-in Explore and Plan subagents that start without your CLAUDE.md files to keep research fast, and you can define your own in .claude/agents/.

19. Send research to subagents in parallel

For questions that need many file reads. Each subagent works in its own context window and returns a summary, so your main session stays focused.

Use three subagents in parallel:
1. One finds every place we read or write [user.email], including raw SQL.
2. One lists every external service we call, with the file and the env var holding its key.
3. One finds feature flags that are always on or always off in every environment.
Each returns a table with file paths only, no code. Then combine the three tables into a short summary for me.

20. Get a fresh-eyes review against the spec

Anthropic's docs point out that a reviewer that never saw your reasoning helps, and that asking it to skip style keeps it from inventing work.

Use a subagent to review the diff on this branch against [docs/specs/invitations.md].
It should check that every "Done when" item is implemented and has a test, list requirements that are missing or only partly done, and point out edge cases the spec names that have no test.
Report gaps that affect correctness only. Skip style. Then wait for me before fixing anything.

Which prompt for which job

JobPromptsRun it inProof to ask for
Learn a new codebase1, 2Normal mode, no editsTest and typecheck results
Turn an idea into a spec3Normal modeA spec file with a Done when list
Plan a multi-file change4, 5Plan modeFiles, order, rollback, tests
Build a feature6, 7Fresh session after the planTest and typecheck output
Add tests8, 9Normal modeTests failing, then passing
Fix a bug10, 11, 12Normal modeA reproduction or bisect result
Restructure code13, 14Normal mode, after prompt 8Tests after every step
Get ready to merge15, 16, 20Normal mode or a subagentFile and line for each issue
Make it repeatable17, 18Normal modeThe file shown before saving
Research many files19SubagentsTables of file paths

Working in other tools too? The same structure carries over to our Cursor prompts and to the chat-window coding prompts for ChatGPT, Claude or Gemini.

Common mistakes

  • No check to run. Claude stops when the work looks done. A test command or typecheck in the prompt turns "looks done" into "passes".
  • Accepting "all tests pass" without output. Ask for the command and its output. Reading it is faster than rerunning it.
  • Correcting the same mistake three times. The conversation now holds three failed attempts. /clear and write one prompt that includes what you learned.
  • Putting hard rules in a prompt. "Never push to main" in a prompt is a request. A permission rule or hook enforces it; our Claude Code tips show how.
  • Trusting checkpoints like git. /rewind restores edits Claude made with its file tools, not files changed by shell commands. Commit before big prompts.

For habits that hold in any AI coding tool, such as keeping changes small and reading every diff, see our best practices for AI coding.

Frequently Asked Questions

What makes a good prompt for Claude Code?
Tell it what it can't see in the repo: the symptom, the file to start from, a preference between two reasonable approaches, and what done looks like. Then give it a check it can run, such as a test command, and ask for the command output as evidence. Anthropic's Claude Code best-practices page makes both points.

How are Claude Code prompts different from Claude chat prompts?
Claude Code is an agent that reads, edits and runs code in your repository, so a good prompt names files, commands and a pass or fail check instead of pasting code. For chat-app prompts, see our best Claude prompts collection.

Do phrases like think hard or ultrathink still work in Claude Code?
Anthropic's best-practices page says think hard, think harder and be thorough are ordinary prompt text that nudges Claude within its effort setting, not keywords that raise it. The effort level is the real control. The same page says ultrathink still asks for deeper reasoning on a single turn.

Should I use plan mode for every prompt?
No. Use it for multi-file changes you want to approve first. Small, well-specified fixes can go straight to a normal prompt with a test to run.

How do I reuse a Claude Code prompt I keep typing?
Turn it into a skill: a SKILL.md file in .claude/skills/[name]/ that you run as /[name]. Anthropic's docs say custom commands have been merged into skills, so a file in .claude/commands/ also creates a slash command. Prompt 18 below writes one for you.

When should a prompt ask for a subagent?
When the work is a side task whose output you don't need in full: research across many files, or an independent review. A subagent works in its own context window and returns a summary. Anthropic's docs note that delegating doesn't make an answer better on its own, while a fresh reviewer that never saw your reasoning does help.

Ready to build it?
Start with a prompt.

Try building on Greta.sh

left-gradient
left-gradient
Questera Logo
SOC 2 Type II Cert.
SOC 2 Type II Cert.
AI Security Framework
AI Security Framework
Enterprise Encryption
Enterprise Encryption
Security Monitoring
Security Monitoring

© 2026 Questera

Follow in Google