
Short answer
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.
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.
Start every new codebase read-only. The commands Claude finds here become the checks you paste into every later prompt.
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.
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.
These three prompts go from a fuzzy idea to a spec, an approved plan and steps small enough to review.
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.
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.
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.
Two habits do most of the work here: point at existing code to copy, and end with a command whose output you can read.
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.
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.
Tests are what let Claude check itself. Without one, "done" means "looks done".
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.
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.
Each one asks for evidence before a fix.
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.
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.
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.
A refactor that changes behavior is a bug with a nicer diff.
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.
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.
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.
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.
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.
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.
/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.
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.
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/.
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.
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.
| Job | Prompts | Run it in | Proof to ask for |
|---|---|---|---|
| Learn a new codebase | 1, 2 | Normal mode, no edits | Test and typecheck results |
| Turn an idea into a spec | 3 | Normal mode | A spec file with a Done when list |
| Plan a multi-file change | 4, 5 | Plan mode | Files, order, rollback, tests |
| Build a feature | 6, 7 | Fresh session after the plan | Test and typecheck output |
| Add tests | 8, 9 | Normal mode | Tests failing, then passing |
| Fix a bug | 10, 11, 12 | Normal mode | A reproduction or bisect result |
| Restructure code | 13, 14 | Normal mode, after prompt 8 | Tests after every step |
| Get ready to merge | 15, 16, 20 | Normal mode or a subagent | File and line for each issue |
| Make it repeatable | 17, 18 | Normal mode | The file shown before saving |
| Research many files | 19 | Subagents | Tables 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.
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.
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.
© 2026 Questera
Follow in Google