Long Run Task Brief
Hand Claude Code a whole task with a clear finish line and one condition to stop and ask.
You fill in the whole job in one sentencefor example, every endpoint…one condition
Claude Code works inside your repository, so a prompt for it names files, commands and the definition of done. Each block below is one job: plan a change, add tests, review a diff, fix CI, write the project's CLAUDE.md.
Hand Claude Code a whole task with a clear finish line and one condition to stop and ask.
You fill in the whole job in one sentencefor example, every endpoint…one condition
Before a coding agent follows someone else's setup document, have a model read it and every script it pulls.
You fill in paste the link or the documentWindows 11 / Ubuntu / macOS
Writes a failing test first, explains the real cause, then makes the smallest fix and runs the whole suite.
You fill in describe the bug, how to…
Reproduces a failing build locally, names the real cause and fixes it without skipping or deleting a single test.
You fill in paste the failing log herebranch name
Reads your repository and writes its CLAUDE.md: verified commands, the layout and the conventions the code follows.
You fill in how it is deployedthe command I actually run…what an agent should know
Adds a command to your CLI in the existing pattern, with flags, help text, error handling and tests that run.
You fill in what it doesthe exact command line
Tours an unfamiliar repository: what it does, how to run it, one request traced end to end, and what to read first.
You fill in what you have been asked to do
Writes a reversible migration in your repo style, split into safe steps for a large table, with the tests run.
You fill in describe the schema changerow count
Surveys every use of a package, lists the breaking changes that touch you and upgrades it one commit at a time.
You fill in packagecurrent versiontarget version
Measures before it optimises: a baseline, a profile, one fix, and the before and after numbers side by side.
You fill in what is slowtarget
Reviews a branch or pull request for defects, risks and missing tests, with a verdict and no invented findings.
You fill in branch name, pull request…
Explores your repository and returns a commit sized plan, the risks and a definition of done before it writes code.
You fill in describe the feature you want…
Refactors behind passing tests, writing characterisation tests first and stopping the moment one of them fails.
You fill in file or modulethe reason
Traces untrusted input through a diff and reports real security findings with the attack path, impact and fix.
You fill in branch, pull request number…
Claude Code reads your repository, edits files and runs commands, and it keeps going until the work looks finished to it. That's the catch: without a check it can run, «looks finished» is the only signal it has, and you become the person who finds every mistake. A request that works carries five things.
Put together, a request you can type from memory:
[What is wrong, or what should exist], in [folder or file]. Follow the pattern in [an existing file that does this well]. Don't change [what must stay the same]. No new dependencies. Verify with [test or build command] and fix anything that fails. Done means [the condition]. Show me the diff and the test output.
Every prompt on this page is that pattern worked out for one job. The Bug Reproduction Test adds a failing test before any fix; the Safe Refactor Pass runs the tests after every small step and stops at the first red one.
| You want to | Use | What you get back |
|---|---|---|
| Understand a repo you've never seen | Codebase Tour Guide | One request traced end to end, and the five files to read first |
| Plan a feature before any code | Repo Feature Planner | Commit-sized steps, each with its test, and a definition of done |
| Hand over a whole task | Long Run Task Brief | A TASKS.md checklist kept current, and one stop condition |
| Fix a bug properly | Bug Reproduction Test | A failing test, the cause, the smallest fix |
| Clean up code without changing it | Safe Refactor Pass | Small steps with a test run after each |
| Get a red build green | CI Failure Fixer | The failure classified and reproduced, then fixed |
| Review a branch or PR | Pull Request Reviewer | Defects, risks and cleanups by severity, and a verdict |
| Check a change for security holes | Security Review Pass | Attack paths with file and line, ordered by what to fix first |
| Upgrade a major dependency | Dependency Migration Plan | Breaking changes that touch your code, then one commit at a time |
| Change a database schema | Database Migration Writer | Up and down steps, split safely for large tables |
| Make something faster | Performance Profiler | A baseline, a profile, one fix, before and after numbers |
| Add a command to your CLI | CLI Command Builder | A command modeled on two existing ones, with tests |
| Give the repo standing instructions | CLAUDE.md Writer | A CLAUDE.md built from verified commands and real conventions |
| Vet a setup guide before an agent runs it | Setup Doc Safety Check | Every command and download, risks quoted, and a verdict |
We wrote this pair ourselves to show the difference. The first is what gets typed at the end of a long day:
the export is broken, fix it
Claude will fix something, but you can't tell whether it's what you meant. Here's the same request with the five parts in it:
CSV exports from the reports page show dates one day early for users west of UTC. The export code is in src/reports/export/. Write a failing test that reproduces it for a user in America/Los_Angeles, run it and show me the failure. Then fix the cause, not the formatting of the output. Don't change the column order or add a dependency. Run npm test -- reports and show the output. Done means the new test and the existing reports tests pass.
Each line removes a guess. The time zone says which bug. The folder keeps it from wandering the repo. The failing test proves the bug exists before anything changes, and the test command gives it a pass or fail it can read. The column order is what a downstream spreadsheet depends on and a tidy fix might «improve».
For a change that spans several files, or code you don't know well, separate exploring from editing. Plan mode does this: Claude reads files and writes a plan, but doesn't edit your source. Press Shift+Tab until the status bar shows plan mode, start the request with /plan, or launch with claude --permission-mode plan. Ctrl+G opens the plan in your text editor so you can correct it before approving. Anthropic's own guidance is to skip the plan when you could describe the diff in one sentence.
The Repo Feature Planner is written for that first step. Once you approve, ask for one step at a time with the tests run after each, and commit as you go. Small diffs are ones you'll actually read.
Claude reads CLAUDE.md at the start of every session, so it's where things you'd otherwise repeat belong: commands it can't guess, style rules that differ from the defaults, branch and PR conventions, a required environment variable. Leave out what it can learn from the code. As of October 2026, Anthropic's docs suggest keeping each file under 200 lines, because longer files cost context and get followed less. Running /init drafts a starter file, and on a repo that already has one it suggests improvements. The CLAUDE.md Writer goes further and records only commands it has run.
One limit worth knowing: Claude treats CLAUDE.md as context, not as enforced rules. If something must never happen, such as writes to a migrations folder, that's a job for a hook.
You rarely need a new prompt. One line in the same session usually repairs it.
| The result | Reply with |
|---|---|
| Says it's done, shows nothing | Run the tests and paste the output. Show me the commands you ran. |
| Touched files you didn't ask about | Revert every change outside [folder]. List what you reverted. |
| Fixed the symptom | Explain why the bug happened in two sentences. If the fix doesn't address that, redo it. |
| Invented its own pattern | Redo this following [existing file] exactly. Same structure, same naming. |
| One huge diff | Split this into commits that each pass the tests on their own. |
| Added a library | Remove the new dependency and use what the project already has. |
| Went in the wrong direction | Press Esc twice or run /rewind, then send a narrower request. |
The failures are predictable, which makes them cheap to avoid.
For an unfamiliar module or a big pull request, a diagram reads faster than three screens of terminal text. Claude Code can publish an artifact: one interactive web page on claude.ai, built from what the session can see and updated as it continues. Anthropic's own examples include a PR walkthrough with the diff annotated inline. Ask for the explanation before any edit:
Don't change any code yet. Make an artifact that explains how [module or feature] works: a diagram of the main parts and how one request moves through them, with the file path on every box. Then list the three places a change to [what I want] would touch.
As of October 2026, artifacts need a Pro, Max, Team or Enterprise plan and a session signed in with /login; API-key and cloud-provider sessions can't publish them. Without that, ask for the diagram as an HTML file in a folder you name. For reasoning in the terminal as it works, the Explanatory output style (/output-style explanatory) adds short Insight blocks explaining its choices.
As listed in Anthropic's Claude Code docs, October 2026. Type / in a session to see what your version has; our Claude Code cheat sheet has the rest.
Claude Code comes with Claude's Pro and Max plans, and usage there is shared between the Claude apps and Claude Code. Our Claude Code review has the plan details, and the parent Claude prompts page covers the chat app.
In the terminal, with Claude Code started in the repository root, because every block assumes it can read files, run your tests and report real paths. Codebase Tour Guide means nothing without that access. The chat app can still help with a single file you attach, but drop the lines about exploring first and naming what it read.
Repo Feature Planner tells it to explore, list the files it read and write nothing during that step, then return commit sized pieces each with the test that proves it. Read the plan, correct whatever is wrong about your codebase, and only then say go. Planning in one session and implementing in the next makes that boundary harder to cross by accident.
CI Failure Fixer forbids it outright and makes it classify the failure first: a genuine defect, a flaky test, an environment or dependency problem, or broken pipeline configuration. It also has to quote the first real error rather than the last line printed, and reproduce the failure locally before touching code. If everything passes locally, the gap between environments is the bug.
No, although later runs go better with one. CLAUDE.md Writer reads your build files, scripts, test configuration, CI workflows and recent commits, then records what the project is, the commands it verified, the directory layout and the conventions the code genuinely follows. Where such a file already exists, it keeps whatever still holds instead of starting over.
One email a week: the best new prompts and one short guide. Unsubscribe any time. Privacy policy