Skip to main content

Prompting Strategies

2 min read

Master the art of communicating with Claude for better, more accurate results


title: Prompting Strategies description: Master the art of communicating with Claude for better, more accurate results

Effective prompting is the key to getting great results from Claude. This guide covers proven strategies for structuring your requests to get exactly what you need.

The Anatomy of a Good Prompt

A well-structured prompt typically includes:

  1. Context - What Claude needs to know
  2. Task - What you want done
  3. Constraints - Limitations or requirements
  4. Format - How you want the output

Example: Complete Prompt

Text

Prompting Patterns

1. The Specific Request

Be precise about what you want:

Vague:

Text

Specific:

Text

2. The Contextual Request

Provide relevant background:

Text

3. The Constrained Request

Set clear boundaries:

Text

4. The Iterative Request

Build on previous work:

Text

5. The Comparative Request

When you want options:

Text

Advanced Techniques

Chain of Thought

Ask Claude to think through the problem:

Text

Role Assignment

Set expectations with a role:

Text

Few-Shot Examples

Show what you want through examples:

Text

Structured Output

Request specific formats:

Text

Domain-Specific Prompting

For Bug Fixes

Text

For New Features

Text

For Refactoring

Text

For Code Review

Text

Common Mistakes to Avoid

1. Too Vague

❌ "Fix the performance" ✅ "The /api/products endpoint takes 3s to respond. Profile and optimize the database queries in src/api/products.ts"

2. Missing Context

❌ "Add validation" ✅ "Add Zod validation to the user registration form in src/components/RegisterForm.tsx. Validate email format, password strength (8+ chars, 1 number), and matching password confirmation."

3. Overloading

❌ "Build a complete authentication system with login, registration, password reset, 2FA, social login, session management, and admin user management" ✅ Start with one feature: "Implement email/password login. We'll add other features incrementally."

4. Assuming Knowledge

❌ "Use our standard pattern" ✅ "Follow the repository pattern we use in src/repositories/UserRepository.ts"

Prompt Templates

Bug Report Template

Text

Feature Request Template

Text

Next Steps

Generated with AI using Claude AI by Anthropic

Model: Claude Opus 4.5 · Generated: 2025-12-20 · Build: v1.21.0-75762dc

Edit this page on GitHub··

Discussion

0/2000

Comments are reviewed before being published