Claude Code can write code quickly.
That is useful until it starts moving faster than it understands your project.
I kept running into the same problems:
Small requests touched unrelated files
Existing logic was rebuilt instead of reused
Bug fixes created different bugs
Claude changed the scope halfway through
Tasks were marked complete without testing the real user flow
The issue was not simply “bad prompts.”
My entire workflow started too late.
I was asking Claude to build before making it inspect, define boundaries and agree on what success looked like.
A quick disclosure
I created The Claude Code Toolkit, a paid collection containing 260 prompts and systems, 15 CLAUDE.md templates, 10 development workflows and 100 curated Claude Code skills.
It costs £3.99:
The complete pre-flight prompt below is free to copy. It is not a shortened preview.
The pre-flight check I run before important changes
Before Claude edits anything, I make it answer five questions:
What does the current system do?
Which files are actually relevant?
What must remain untouched?
What is the smallest safe change?
How will the result be verified?
That sounds basic, but it prevents a lot of unnecessary work.
Here is the full prompt.
Act as a senior software engineer preparing to make a controlled change inside an existing codebase.
TASK
[DESCRIBE THE FEATURE, FIX OR UPDATE]
EXPECTED RESULT
[DESCRIBE EXACTLY WHAT THE USER SHOULD BE ABLE TO DO]
PROTECTED FUNCTIONALITY
[LIST FEATURES, PAGES, FILES, DATA OR INTEGRATIONS THAT MUST REMAIN UNCHANGED]
KNOWN PROJECT CONTEXT
Project purpose:
[DESCRIBE THE APPLICATION]
Tech stack:
[LIST THE STACK OR WRITE UNKNOWN]
Relevant files:
[LIST THEM OR WRITE UNKNOWN]
Recent changes:
[LIST RELEVANT CHANGES OR WRITE NONE]
Known errors:
[PASTE ERRORS OR WRITE NONE]
Do not edit any code yet.
First, inspect the existing project and perform a pre-flight review.
Your review must include:
- Trace the current user flow connected to this task.
- Identify the components, routes, services, APIs, database logic and state involved.
- Find existing patterns, utilities and components that should be reused.
- Identify every file likely to be modified.
- Explain why each file may need to change.
- Identify functionality that could be affected indirectly.
- List unclear requirements or missing information.
- Identify security, permission, validation and data-integrity risks.
- Recommend the smallest safe implementation.
- Create a testing plan for the complete user flow.
Respond using these sections:
CURRENT BEHAVIOUR
Explain how the relevant functionality currently works.
TASK UNDERSTANDING
Restate the requested result in your own words.
RELEVANT FILES
List the files involved and explain what each one controls.
EXISTING PATTERNS TO REUSE
Identify components, services, utilities and conventions that should be preserved.
RISKS
Explain possible regressions, edge cases and security concerns.
SMALLEST SAFE CHANGE
Recommend the minimum implementation required to deliver the requested result.
APPROVED SCOPE
List every file and area you expect to modify.
PROTECTED AREAS
List everything that must remain untouched.
IMPLEMENTATION PLAN
Provide a step-by-step plan.
TESTING PLAN
Explain how you will test:
- The complete successful flow
- Invalid and missing input
- Failed requests
- Loading, empty and error states
- Authentication and permissions
- Repeated clicks or duplicate submissions
- Related functionality
- Browser console errors
- Server logs
- Protected functionality
Wait for my approval before editing any code.
After approval:
- Stay inside the approved scope.
- Follow the existing architecture.
- Reuse existing project patterns.
- Do not perform unrelated refactoring.
- Do not change unrelated styling.
- Do not add dependencies without approval.
- Stop and ask before modifying an unapproved file.
- Preserve existing user data, permissions and integrations.
After implementation:
- List every file created or modified.
- Explain the exact changes made.
- Compare the result against the approved plan.
- Test the complete user flow.
- Test related protected functionality.
- Report failed tests.
- List anything that could not be verified.
Do not claim completion because the code compiles or the page loads.
The task is complete only when the intended user flow has been tested and protected functionality still works.
ENJOY!
Top comments (0)