Lesson 1 of 21 ~20 min
Course progress
0%

Communication Best Practices

Learn how to communicate effectively with Claude for optimal results.

Communication Best Practices

Master the art of communicating with Claude to get the best possible responses. Clear communication leads to better results.

Core Principles

1. Be Clear and Specific

Claude performs best with precise, unambiguous instructions.

❌ Vague:

Can you help with my code?

✅ Specific:

I have a React component that's causing infinite re-renders. 
Here's the code: [code block]
The issue happens when I update the user state.
Can you identify the problem and suggest a fix?

2. Provide Context

Help Claude understand your situation fully.

Essential Context Includes:

  • What you’re trying to achieve
  • Your tech stack/environment
  • What you’ve already tried
  • Any constraints or requirements
  • Relevant code or data

Communication Patterns

The Problem-Solution Format

**Problem**: [What's not working]
**Expected**: [What should happen]
**Actual**: [What's happening instead]  
**Code**: [Minimal reproducible example]
**Question**: [Specific ask]

Effective Request Example

Context: Building a Node.js API with Express
Goal: Implement rate limiting
Current: Using express-rate-limit package
Issue: Rate limit not working for API keys
Constraint: Must support per-key limits

Question: How do I implement per-API-key rate limiting?

Best Practices

✅ DO: Be Direct

I need help optimizing this SQL query.
Current execution time is 5 seconds.
Goal is under 1 second.
[query here]

❌ DON’T: Waste Tokens on Pleasantries

Hello! I hope you're having a wonderful day! 
I was wondering if maybe you could possibly help me...

✅ DO: Provide Examples

Create a function that formats dates:
- "2024-01-15" → "January 15, 2024"
- "2024-12-25" → "December 25, 2024"

❌ DON’T: Ask Multiple Unrelated Questions

1. How do I use React hooks?
2. What's the best database?
3. Should I use TypeScript?
4. Explain Docker to me

Advanced Techniques

Multi-Step Problems

Break complex tasks into stages:

I need to migrate PostgreSQL to MongoDB.
Let's approach this in stages:

1. First, analyze current schema
2. Then, design MongoDB schema  
3. Next, create migration script
4. Finally, write validation tests

Let's start with step 1...

Iterative Refinement

Build solutions progressively:

  1. Start broad: “I need user authentication”
  2. Add specifics: “Using JWT with 24h expiration”
  3. Refine: “Need token refresh and RBAC”
  4. Implement: “Here’s my code, add refresh tokens?”

Communication Checklist

Before asking, verify:

  • Clear objective
  • Necessary context
  • Specific question
  • Expected format
  • Examples provided
  • Constraints listed
  • Current progress

Practical Examples

Debugging Help

Good Request:

Getting "Cannot read property 'map' of undefined" error.

Context: React component fetching users
Error occurs: On initial render
Code:
  const [users, setUsers] = useState();
  useEffect(() => {
    fetch('/api/users').then(res => res.json()).then(setUsers);
  }, []);
  return <ul>{users.map(u => <li>{u.name}</li>)}</ul>;

What's causing this and how do I fix it?

Architecture Advice

Good Request:

Designing real-time chat for 10K concurrent users.

Requirements:
- Message persistence
- File sharing (10MB max)
- Read receipts
- <100ms latency

Stack: Node.js, PostgreSQL

Questions:
1. WebSockets vs Server-Sent Events?
2. Database structure?
3. Caching strategy?
4. Scalability concerns?

Key Takeaways

  1. Clarity is king - Be specific
  2. Context matters - Provide background
  3. Structure helps - Organize logically
  4. Examples clarify - Show what you mean
  5. Iterate freely - Build progressively
  6. Be direct - Skip pleasantries
  7. Stay focused - One topic at a time

What's the most important element of effective communication with Claude?

Being polite and friendly
Being clear and specific
Using technical jargon
Asking multiple questions

When debugging, what should you include?

Just the code
Just the error message
Just what you tried
Code, error, context, and attempts

How should you handle complex problems?

Break into steps, tackle one at a time
Ask everything at once
Start with hardest part
Provide no context initially

What if Claude misunderstands your request?

Start new conversation
Repeat same request
Clarify and correct
Give up