File of the day
A Claude Code rule that finds where the work will break before you hand it over
Slava Sazhin 4 October 2026 3 min read 0 views
A rule for your global CLAUDE.md: at the end of every task and plan Claude imagines the work has failed and deals with the causes before the handover.
Today's file is a rule for Claude Code. Claude says "done", you pass the work on, and the breakage turns up later at the person who got it: a client, your accountant, a colleague. The rule has Claude look for that breakage before the handover: at the end of every finished task and in every plan it adds a "What could go wrong" block.
How it works
Claude imagines that the work has already failed and names the reasons. The psychologist Gary Klein called this a premortem, and the file is named after it. For each reason Claude looks for a remedy it can apply right now. A risk with no remedy does not make the list, and a safeguard that already exists does not count as one. A safe remedy Claude applies before it answers and reports as done, with the result. A risky one, or one that depends on someone else, it names and waits for your decision. If a check can settle a doubt, Claude runs the check first: if it finds nothing, there is no item; if it finds a breakage, Claude fixes it instead of describing it. Anything that needs your consent, it asks about before the work reaches people.
The items are numbered, so you can answer with a number. When there is nothing to say, there is no block at all, not even a heading, and there is none in intermediate steps.
In our test we asked in four languages for a plan to move client bookings from a paper notebook into a Google Sheet. Without the rule the plan had no such block. With it the plan ended in three to five numbered items, such as: photograph the notebook before typing anything, share the sheet only with named people because it holds client phone numbers, pick the day the notebook stops. Where a decision was ours, Claude asked for it: which day, who gets access. To "what is 17*23" Claude answered 391 and added no block.
What to change
The file is a first line and twelve short points: nine on how to build the block and three on how to write it. To get the block only in plans, remove "At the end of every finished task and" from the first line. We added one point ourselves. In the first test we only asked what a small backup script does, and the rule's "fix it instead of describing it" made Claude try to rewrite the script and run it. Now the file says that when only a plan or an answer to a question was asked for, Claude changes nothing and runs nothing, names the remedy and waits. On the same question it then listed three problems with their remedies and touched nothing.
Install
The rule goes at the end of ~/.claude/CLAUDE.md, the file with your instructions for all projects. If you do not have it yet, Claude creates it; the note below has the exact request. That folder holds Claude's own settings, so Claude asks before it edits the file: answer Yes. Then close Claude Code and open it again, because the file is read at startup. The check from the note below: ask for a plan to move client bookings from a paper notebook into a Google Sheet, and the plan ends with a "What could go wrong" block: what Claude already took care of and what waits for your decision.
The files
Every file of the day on GitHub# Find where the work will break, before handing it over
At the end of every finished task and in every plan, add a "What could go wrong" block.
How to put it together:
- Imagine that what was done has already failed, and name the reasons it failed.
- For each reason, find a remedy that prevents it right now.
- An item is written for the sake of the remedy, not the risk: no remedy now - no item, however big the risk.
- Something that already exists and would kick in by itself when things fail does not count as a remedy.
- The remedy is safe - apply it before you answer and write the item down as done, with the result.
- The remedy is risky or does not depend on you - name the risk and the remedy and wait for my decision.
- If a doubt can be settled by a check, check before you answer: the check found nothing - no item; it found a breakage - fix it instead of describing it.
- Only a plan or an answer to a question was asked for - change nothing and run nothing: name the remedy and wait for my decision.
- Anything that needs my consent, ask about it before the work reaches people, not after.
How to write the block:
- Not a single item - no heading and no line in its place; do not write the words "nothing found".
- Number the items so I can answer with a number.
- Do not write the block in intermediate steps inside a task.
# How to install the rule: find where the work will break, before handing it over
1. Ask Claude: "Append the contents of the downloaded file premortem.md to the end of the file ~/.claude/CLAUDE.md, and if that file does not exist, create it".
2. Close Claude Code and open it again: the rule is read at startup.
Check:
1. Ask Claude: "Make a plan for moving client bookings from a paper notebook into a Google Sheet".
2. At the end of the plan Claude writes a "What could go wrong" block: what it has already taken care of in the plan itself and what waits for your decision. Without the file there is no such block.
Was this article worth your time?
Give Claude a computer of its own
Your own Linux machine with Claude Code on it, working around the clock while your laptop is shut. From $3.49 a month.