Day 2: How To Actually Talk To Claude Code (Prompting That Works)
Vague prompts = vague results. It's not magic. Treat it like briefing a smart dev who just joined the team and doesn't know anything about your project yet.
Hey, it's G.
Day 2 of the Claude Code series.
Yesterday was setup. Today is the skill that actually matters: how to prompt Claude Code so it does what you want instead of what it thinks you want.
Most people treat Claude Code like ChatGPT. That's the problem.
Let me show you the difference between lazy prompts and effective ones.
The Core Problem (Why Vague Prompts Fail)
Here's what most people do:
> fix the bug
What Claude Code knows:
- There's... a bug?
- Somewhere in this project?
- Should I guess which one?
- What does "fixed" even mean?
What you get back: A guess. Maybe the right file. Probably not the actual problem.
The Concept (What Claude Code Actually Needs)
Claude Code has full access to your project — but it only knows what you tell it and what it can read.
A vague prompt gets a vague result. A good prompt has three things:
1. Context
What is this project? What are we working on? What patterns already exist?
2. Goal
What exactly do you want done? Be specific. Point to files.
3. Constraints
What to avoid. What "done" looks like. What not to touch.
The analogy:
Think of it like briefing a contractor before they start work.
"Fix the kitchen" gets you something.
"Fix the leaking pipe under the left sink, don't touch the tiles, tell me when it's done" gets you exactly what you need.
The Formula (Copy This)
[Where] + [What's wrong or what's needed] + [What done looks like] + [What to avoid]
Weak Prompt (Don't Do This)
> add a login page
What's missing:
- Where should it go?
- What components should it use?
- What auth system?
- What happens on success?
- What should it look like?
Strong Prompt (Do This)
> Add a login page at /app/login/page.tsx using the existing
> Button and Input components from /components/ui/.
> Use Supabase auth (already configured in /lib/supabase.ts).
> On success, redirect to /dashboard.
> Match the styling of the existing /app/signup/page.tsx.
What it includes:
- Exact file path (/app/login/page.tsx)
- What to use (existing Button and Input components)
- Where those components live (/components/ui/)
- What auth system (Supabase, already configured)
- Success behavior (redirect to /dashboard)
- Design reference (match /app/signup/page.tsx)
This prompt gives Claude Code everything it needs to execute perfectly on the first try.
Effective Prompting Patterns (What Actually Works)
Pattern 1: Give It a Role
> You are working on a Next.js 14 app using Supabase for auth.
> Help me add a password reset flow.
Why this works: Sets context about the tech stack and what already exists. Claude Code won't suggest Firebase when you're using Supabase.
Pattern 2: Tell It What NOT to Do
> Refactor this function for readability.
> Don't change the logic.
> Don't rename the function.
> Don't add new dependencies.
Why this works: Prevents it from "improving" things you don't want touched. Constrains creativity to the specific task.
Pattern 3: Ask It to Plan Before Acting
> Before making any changes, tell me your plan for implementing
> this feature. I'll confirm before you proceed.
Why this works: You review the approach before code is written. Catches misunderstandings early. Teaches you how it thinks.
Pattern 4: Reference Existing Patterns
> Add error handling to /api/users/route.ts.
> Follow the same pattern used in /api/posts/route.ts.
Why this works: Maintains consistency across your codebase. Claude Code reads both files and matches the style.
Pattern 5: Specify the Acceptance Criteria
> Add a dark mode toggle.
> When clicked, it should persist to localStorage.
> Default to system preference on first load.
> The toggle should be in the header next to the user avatar.
Why this works: Clear definition of "done." No ambiguity about what success looks like.
Real Example (Side-by-Side Comparison)
Let me show you the same task with weak vs. strong prompting.
Task: Add form validation to a contact form
❌ Weak Prompt:
claude
> add validation to the contact form
What Claude Code does:
- Guesses which form you mean (could be wrong)
- Adds generic validation (required fields, maybe)
- Might use a library you don't want
- Styling might break
- No error messages defined
✅ Strong Prompt:
claude
> There's a bug in /components/ContactForm.tsx — the form submits
> even when the email field is empty.
>
> Add validation that:
> - Blocks submission if email is empty or invalid
> - Shows an inline error message under the email field
> - Uses the existing error styling from /components/ui/Input.tsx
> - Don't add any dependencies
> - Don't change the existing submit handler logic
What Claude Code does:
- Goes directly to the right file
- Adds validation exactly where needed
- Uses existing components and styles
- Preserves your submit handler
- First attempt is probably correct
Time saved: 10 minutes of back-and-forth corrections.
Another Real Example (From My Projects)
Building a feature for Resiboko (my expense tracker):
❌ What I used to do:
> add a filter for expenses
What happened:
- Claude added a dropdown
- Wrong location in the UI
- Didn't connect to the actual data
- Had to give 3-4 follow-up prompts to fix
✅ What I do now:
> Add an expense category filter to /app/dashboard/page.tsx
>
> Requirements:
> - Use the Select component from /components/ui/select.tsx
> - Place it above the expense table (before the <ExpenseTable /> component)
> - Filter categories should come from the existing getCategories() function
> - When changed, update the URL param ?category= and refetch expenses
> - Default to "All Categories"
>
> Follow the same pattern as the date range filter already in this file.
What happened:
- First attempt worked
- Matched existing UI patterns
- Connected to real data
- Zero follow-up corrections needed
The difference: 30 seconds writing a clear prompt vs. 15 minutes debugging vague output.
Why This Actually Matters
Claude Code is only as good as your prompts.
The developers getting the most out of it aren't the ones who know AI best.
They're the ones who communicate clearly.
Think of it like this:
You're not prompting AI. You're briefing a senior developer who just joined your team and doesn't know anything about your project yet.
Give them context. Give them a goal. Give them constraints.
The Prompting Checklist (Copy This)
Before hitting enter on a prompt, check:
✅ Did I specify the file or location?
- "Add validation" ❌
- "Add validation to /components/ContactForm.tsx" ✅
✅ Did I reference existing patterns?
- "Make it match the design" ❌
- "Use the same styling as /components/ui/Button.tsx" ✅
✅ Did I define success criteria?
- "Make it better" ❌
- "On submit, show a success toast and clear the form" ✅
✅ Did I set constraints?
- Just the goal ❌
- "Don't add dependencies, don't change existing functions" ✅
✅ Did I provide enough context?
- "Fix the auth" ❌
- "We're using Supabase auth (configured in /lib/supabase.ts), fix the password reset email not sending" ✅
My Raw Notes (Unfiltered)
Vague prompts = vague results. It's not magic. Treat it like briefing a smart dev who just joined the team and doesn't know anything about your project yet.
Context + goal + constraints. Ask it to plan first before touching anything when you're not sure.
Tested both approaches today on actual Resiboko feature. Weak prompt took 15 min with corrections. Strong prompt worked first try. 30 seconds upfront saves 10+ minutes later.
Pattern recognition: it's really good at following existing code patterns if you point it to them. "Do this like that other file" works way better than describing from scratch.
Tomorrow (Day 3 Preview)
Topic: File operations — reading, writing, and editing files with Claude Code.
What I'm testing: How well it handles multi-file changes, what it can and can't edit, and when to let it read vs. when to paste content directly.
Following This Series
Daily updates for 30 days. Each day builds on the last.
Who this is for:
- Filipino developers learning AI-assisted coding
- Anyone building production apps with Claude
- People who want practical skills, not theory
Day 1: Setup and installation Day 2: Prompting that actually works (today) Day 3: File operations (tomorrow)
G
P.S. - The single biggest upgrade to your Claude Code results: Spend 30 seconds writing a clear prompt instead of 10 minutes fixing vague output.
P.P.S. - If you're already using Claude Code, what's your prompting strategy? Drop it in the comments. I want to learn from what's working for you.
P.P.P.S. - Tomorrow I'm testing multi-file operations. Curious if Claude Code can handle "refactor this across 5 files while maintaining consistency." Will document everything.