Aulafy

Writing Good Prompts

The quality of what Claude Code gives you depends a lot on how you ask. You don't need to know how to "speak technical"—just be clear. Here are 7 principles and real before/after examples.

1. Be specific, not generic

"Fix this" forces Claude to guess. The more context you give, the less it has to guess and the better it does.

Fix my code

The 'Send' button on login.html does nothing when clicked. It should show an error message if the email field is empty. Investigate why it's not working and fix it.

2. State your level and ask for explanations

Claude adapts to you. If you tell it you're just starting out, it will explain things instead of just dumping code.

Make a REST API with JWT authentication

I'm just starting to program. Help me create a simple API with login. Explain each step in plain language before writing the code, and tell me what 'JWT' is when you use it.

3. Ask to see before acting

For tasks that change files or can have consequences, ask for the plan first. That way you learn and avoid surprises.

4. Give context: paste errors, data, and examples

Don't describe the error in your own words—paste it in full. Don't explain what your data looks like—show it the file.

I get an error when running the program

When I run "python app.py" I get this error: Traceback (most recent call last): File "app.py", line 12, in <module> print(precio * cantidad) TypeError: can't multiply sequence by non-int What does it mean and how do I fix it?

5. Break down large tasks

Instead of asking for everything at once, go step by step. Claude works better and you understand what's happening.

Build me a complete online store with cart, payments, users, and admin panel

Let's build an online store step by step. Let's start with just the page that shows the product list. Once that works, we'll continue with the cart.

6. Describe the outcome you want, not the technical solution

You don't have to know how to do it. Describe what you want to achieve and let Claude suggest the how.

Use a useEffect with debounce and memoization

I want the search results to filter automatically as the user types, without having to click a button, but it shouldn't lag even when they type quickly.

7. Ask it to correct you and teach you

Claude Code isn't just for getting the work done—use it to improve yourself.

Ready-to-use templates

Copy, fill in the brackets, and paste:

To create something new

To fix something

To understand something

To improve what you already have

Common mistakes when starting out

  • Accepting changes without reading them. Claude shows a diff before editing. Read it: that way you learn and catch if something isn't what you wanted.
  • Not giving project context. If you have a CLAUDE.md (see Configuration), Claude understands your project much better from the first message.
  • Giving up on the first attempt. If the response isn't what you wanted, don't start over—tell it "almost, but I also wanted..." and refine.
  • Asking for too much at once. Huge tasks in a single prompt turn out worse. Divide and conquer.