ClaudeHack
0.000

Prompt with task, guardrails and exit criteria instead of numbered steps

Claude Code / CLAUDE.md·15 hours ago·verified 15 hours ago·easy·~5 min setup·verified

Spelling out do-this-then-that is now the common failure mode. Describe the goal, the constraints and how Claude knows it is done, then leave the method alone.

The problem

Step-by-step prompts cap the model at your plan. It follows your worse idea instead of finding a better one, and stops at the last step rather than at a working result.

The hack

Structure the prompt as three parts: the task, the guardrails it must not cross, and the exit criteria that define done. Say nothing about how to get there.

Why it works

Boris Cherny names over-specified instructions as the most common mistake he sees, and says you should give the model slightly harder tasks than you think it can handle. Exit criteria matter more than method because they are what lets a long run stop correctly.

Setup

1. Write the outcome you want, not the procedure. 2. Add guardrails: files or systems to leave alone, patterns to follow, things not to install. 3. Add exit criteria Claude can actually check — a passing test suite, a command that exits 0, a screenshot that matches. 4. Send it and resist the urge to narrate the next step. 5. If it goes wrong, fix the guardrails or the exit criteria rather than adding steps.

Prompt

Task: migrate the billing module off Stripe Checkout to Payment Intents.
Guardrails: don't touch the webhook signature verification, don't add new dependencies.
Done when: `npm test` passes and a test card completes a payment end to end.

Additional details

The part people skip is verification. Cherny calls it the single most important thing people get wrong: a task without a check that can come back "no" leaves the agent to decide for itself whether it is finished, and it will usually decide yes. A check you cannot fail is not a check. "Run it and see if it looks better" is not an exit criterion. "The page fits a 375px viewport", "logging in with the wrong password fails", and "every command produces the same output as the old binary" are.

Source

youtube·View original →·by Boris Cherny (Y Combinator)

Does this still work?

0 said it works · 0 said it's broken

Related

Discussion

No comments yet. Be the first to say whether this worked for you.