Effective Prompting
Communicate clearly with Claude for the best results

Pixl presents
Vague prompts get vague code. Shocking, I know. Here are the three keys to asking like you mean it.Vague prompts get vague code. Shocking, I know. Here are the three keys to asking like you mean it.

How you ask Claude Code for help changes what you get back. Like, a LOT. This lesson starts with the basics and works up to the patterns power users lean on every day.
Quick warning before we start. The internet is crawling with "prompt engineering" gurus selling secret templates (oh sure, he's a PrOmPt ExPeRt after three weeks of Claude Code). Three weeks doesn't make anybody an expert. The real secret is boring as heck... it's clear communication, and that's all this lesson is.
What is a Prompt?#
A prompt is just what you type to Claude. Your message, your request or your question. Better prompts get better answers.
Think about asking for directions. "Where's the place?" won't get you very far. "Where's the nearest coffee shop that's open right now?" gets you a latte.
The Three Keys to Good Prompts#
1. Be Specific#
Vague prompts get vague results, and specific prompts get exactly what you need.
2. Include Context#
Claude Code can see your files, but it still helps to point it in the right direction.
That hands Claude the location, what's happening (a crash) and what SHOULD happen (an error message).
3. State Your Goal#
Tell Claude what you're trying to pull off, on top of the thing you want it to do.
Once Claude gets your goal, it can suggest better approaches you might never have thought of.
Delegation vs Dictation#
The biggest prompting mistake out there is dictating the how when you should be delegating the what.
Why delegation works better.
- Claude might know a better approach than the one you'd dictate
- It leaves Claude room to handle edge cases you didn't think about
- The prompt is shorter, which saves context window space
- Claude can adapt if the code is set up differently than you assumed
Constraint Specification#
When Claude over-engineers something or wanders off in the wrong direction, add explicit constraints.
Create a formatPhoneNumber utility in src/utils.ts.
Constraints:
- US numbers only (10 digits)
- Output format: (XXX) XXX-XXXX
- No external libraries
- No input validation (caller handles that)
- Single function, no classes or abstractionsGood constraints tell Claude what not to do.
| Constraint Type | Example |
|---|---|
| Scope | "Only modify this one file" |
| Complexity | "No abstractions, just inline logic" |
| Dependencies | "No new packages" |
| Coverage | "Don't add tests yet, just the implementation" |
| Style | "Match the pattern used in the existing userUtils.ts" |
Multi-Step Decomposition#

Got a big task? Break it into explicit steps.
I need to add a notification system. Let's do this in phases:
1. First, create the database schema for notifications (prisma)
2. Then, create the API routes for CRUD operations
3. Finally, add the UI component to display notifications
Start with step 1 only. I'll approve before moving to step 2.That keeps Claude from sprinting ahead and gives you checkpoints along the way.
Anti-Patterns to Avoid#
Kitchen Sink Sessions#
Problem. Cramming a pile of unrelated jobs into one session.
"Fix the login bug, then add dark mode, then refactor the database
queries, then update the README..."Why it fails. Context fills up with unrelated code. Later tasks come out worse because Claude's working memory is cluttered with earlier stuff that doesn't matter anymore.
Fix. One task per session. Use /clear between unrelated tasks.
Over-Correction Loops#
Problem. Jumping on every little imperfection with a correction until you're stuck in a back-and-forth spiral.
Why it fails. Every correction adds context. After 10 of them, Claude has lost the big picture.
Fix. Batch your feedback. Wait until you can describe the whole end result in one message.
Vague Exploration#
Problem. Open-ended prompts with no clear finish line.
"Make the app better"
"Optimize everything"
"Clean up the code"Why it fails. Claude has no idea when it's done, so it might go refactor things that were totally fine.
Fix. Spell out what "better" means. "Reduce the dashboard load time to under 2 seconds" is something Claude can actually hit.
Course-Correcting Mid-Session#
When Claude is mid-action and heading the wrong way, here's the move.
- Press Escape to interrupt the current action
- State clearly what's wrong and what you want instead
- Be direct - "Stop. Use X approach instead of Y."
If Claude already made changes you don't want, use /rewind to roll back to an earlier point in the conversation.
The Power Prompt Template#
For the bigger requests, use this structure.
## Goal
[What you want to achieve - the outcome, not the steps]
## Context
[What Claude needs to know - relevant files, current state, related systems]
## Constraints
[What NOT to do - scope limits, no new deps, match existing patterns]
## Success Criteria
[How to verify it worked - tests pass, specific behavior, no regressions]Is it fancy? Nope. Does it work? Every single time.
TL;DR#
- Specific prompts with context get specific results
- Delegate the what and the why, and let Claude pick the how
- Use explicit constraints to stop over-engineering
- Break big tasks into phases with checkpoints
- Skip the kitchen sink sessions and stick to one task per session
- Interrupt early with Escape, and use /rewind to undo mistakes
- Batch your feedback instead of getting stuck in correction loops
This lesson ends with a short activity.
