Claude Code

Verified against Claude Code · 2026-07-27

Force a written plan before Claude Code touches a multi-file feature

A plan-first prompt that blocks Claude Code from creating, editing, or deleting any file until it has produced and gotten approval on a full change plan, mirroring the discipline of Plan Mode itself but making it a standing requirement rather than a manual toggle.

Claude CodeCursor4 fillable variables

The prompt

Ready to copy — highlighted parts are example details you can swap.

Before touching any file, produce a complete plan for this feature and wait for explicit approval. Do not create, edit, or delete a file, and do not run any command that changes repository state, until the plan below has been written in full and approved — reading files and searching the codebase during planning is expected and encouraged.

FEATURE
Add a saved-searches feature: users can save their current filter combination on the /reports page under a name and reload it later from a dropdown, with saved searches persisting across sessions.

DEFINITION OF DONE
A saved search survives a full page reload and a new login session, appears in the dropdown ordered by most recently used, and reloading one restores every filter exactly as it was saved.

EXISTING PATTERNS TO REUSE, NOT REINVENT
Reuse the existing FilterState type in lib/reports/filters.ts rather than inventing a parallel shape; store saved searches in the existing user_preferences JSON column rather than adding a new table, unless it genuinely cannot hold the data.

ROLLBACK EXPECTATIONS
This should be revertible with a single commit revert; no data migration should be required to undo it, since the column already exists.

WRITE THE PLAN IN THIS EXACT STRUCTURE
1. Restated understanding — the feature in two or three sentences, including any ambiguity in the request being resolved a specific way, and how, so a disagreement surfaces now rather than after the code is written.
2. Files touched — every file expected to be created or modified, grouped as new versus existing, each with a one-line reason it needs to change.
3. Build sequence — the order changes will be made in, and why that order; name any two steps that could happen in parallel versus any step that genuinely depends on a prior one finishing first.
4. Interfaces and contracts — every function signature, exported type, API shape, or database column this feature adds or changes, written out in full before any implementation, since this is the actual coordination surface between files that a plan is supposed to catch problems in before they exist as bugs.
5. Risk points — the two or three places most likely to break something outside this feature's obvious scope, and specifically what will be checked, and how, to confirm they did not.
6. Explicitly out of scope — anything a reasonable person might expect this feature to include that this plan is deliberately not doing, stated so it cannot be silently assumed later to have been forgotten rather than excluded on purpose.

End the plan with the exact sentence: 'Waiting for approval before making any changes.' Do not proceed past that line under any circumstance, including a case where the plan seems obviously correct and re-confirming it feels redundant — the point of the stop is that 'obviously correct' is exactly the judgment a plan review exists to check, not to skip.

IF THE PLAN CHANGES MID-IMPLEMENTATION
If, while implementing an approved plan, a genuine reason emerges to deviate from what was approved — a file needs a change that was not listed, or an interface needs a different shape than planned — stop, state exactly what changed and why, and wait for approval on the delta before continuing, rather than quietly implementing the deviation and mentioning it only in a final summary.

Customize

Optional — swap in your own details for the highlighted parts above.

Why this works

Claude Code has a real, built-in analog to this discipline: Plan Mode, toggled with Shift+Tab twice, puts the agent into a state where Read, Grep, and Glob still work but Edit, Write, and most Bash calls are mechanically blocked until a proposed plan is explicitly approved. This prompt reproduces that same blocking discipline as a standing written instruction rather than a manual per-session toggle, which matters for two practical reasons: the toggle is easy to forget to hit before starting a multi-file feature, and the same discipline is valuable in contexts where no dedicated read-only mode exists at all, such as inside a subagent or a different agentic tool entirely. The interfaces-and-contracts section of the plan is doing more work than it looks like — it is the actual coordination surface between files in a multi-file change, and this is exactly where unplanned agentic work goes wrong: an agent that starts with whichever file feels most obvious can invent a function signature or a data shape on the fly, build a second file against that invented shape, and only discover on a third file that the shape needs to be different, at which point two files already need to be redone rather than one plan needing a five-minute correction. The mid-implementation deviation clause exists because an approved plan is not a contract that survives contact with reality unchanged — real multi-file work regularly surfaces a genuine, good-faith reason to deviate partway through, and the actual discipline being enforced here is not that deviation never happens, it is that a deviation gets surfaced and re-approved in the moment it is discovered rather than silently implemented and mentioned only in a wrap-up summary a reviewer may skim past. Requiring the restated understanding to name and resolve any ambiguity in the original request up front catches a misread requirement while it is still a two-sentence disagreement worth a ten-second correction, rather than after it has become a finished diff across several files that someone now has to unwind and redo, which is a categorically more expensive place to discover the same misunderstanding.

What you get back

1. Understanding: add a per-user saved-search feature on /reports; resolving the unstated question of scope as per-user only, since user_preferences is already scoped that way. 2. Files touched: lib/reports/filters.ts (add SavedSearch type), lib/api/user-preferences.ts (add read and write helpers), components/reports/FilterBar.tsx (add save button and dropdown) — no new files. 3. Sequence: type first, then helpers, then UI, since each depends on the one before it. 4. Interfaces: SavedSearch = name, filters, savedAt; saveSearch(userId, search) and listSavedSearches(userId). 5. Risk: user_preferences is unbounded JSON today — confirming there is a size cap before appending indefinitely. 6. Not doing: no team sharing, no editing a saved search after creation. Waiting for approval before making any changes.

Verified against

Claude Code Sonnet 4.6 · 2026-07-27

Cursor 2.1 · 2026-07-27

Changelog

  • 2026-07-27 Initial publish, verified against Claude Code Plan Mode (Sonnet 4.6) and Cursor 2.1.

Building this for real?

This is a free starting point. If you'd rather have custom software built and running for your business, that's Scult's day job.

EXPLORE CUSTOM SOFTWARE
All Claude Code prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY