DEV Community

Joshua Matthews
Joshua Matthews

Posted on

Stop Writing Prompts Like This: Better Claude Code Communication

The way you communicate with Claude Code determines the quality of output you get. Most developers write prompts that actively sabotage their results.

What Bad Prompts Look Like

"Fix my code"
"Make this faster"
"Write a function that does X"

These prompts share a fatal flaw: they assume Claude Code can read your mind.

The Communication Framework That Works

1. Context First

Before asking for anything, provide context. What language? What framework? What constraints exist? What's the broader goal?

Bad: "Write a sorting function"
Better: "I'm working on a Python 3.11 data pipeline processing CSV files up to 500MB. I need a memory-efficient sorting function for timestamp columns."

2. Show, Don't Tell

Instead of describing what's wrong, paste the actual code, error messages, and expected vs actual behaviour.

3. Specify the Why

Claude Code makes better decisions when it understands purpose. "I need pagination" is weaker than "Users are experiencing slow load times on product listings. I need efficient pagination to reduce initial payload."

4. Iterate With Feedback

Don't accept the first response if it misses the mark. Provide specific feedback: "This works but the memory usage spikes. Can we use generators instead?"

5. Ask for Explanations

"Explain why you chose this approach" teaches you and reveals whether Claude Code understood your requirements.

The Compound Effect

Better communication compounds. Each interaction refines your shared context, making subsequent responses more accurate.


At Logic Leap, we help teams develop effective AI communication patterns. Clear prompts aren't just about getting better code—they're about building better development habits.

What prompting patterns have worked best for you?

Top comments (0)