Skip to main content

Anthropic Prompt Engineering Best Practices

Anthropic Prompt Engineering Best Practices

Research Date: December 2025 Purpose: Document prompt engineering best practices for Claude Sources: Anthropic documentation, engineering blogs, community best practices


Executive Summary

Effective prompt engineering balances clarity, specificity, and brevity. Key principles include progressive disclosure, structured formatting, and iterative refinement.


1. Core Principles

Clarity

  • Use specific, concrete language
  • Avoid ambiguity
  • Provide examples
  • Define technical terms

Brevity

  • Short, declarative statements
  • Bullet points over paragraphs
  • Remove unnecessary words
  • Focus on essentials

Structure

  • Consistent heading hierarchy
  • Logical organization
  • Visual separation
  • Clear sections

2. Instruction Guidelines

Effective Instructions

DO:

  • Be specific: "Use 2-space indentation" not "Format nicely"
  • Provide examples: Show desired output format
  • Use emphasis sparingly: "IMPORTANT" for critical requirements
  • Test iteratively: Remove what doesn't help

DON'T:

  • Overuse emphasis: Reduces effectiveness
  • Write paragraphs: Use bullets instead
  • Add theoretical content: Focus on practical needs
  • Include obvious instructions: Assume basic competence

Instruction Limits

From Anthropic research:

  • Frontier LLMs can follow ~150-200 instructions reliably
  • Claude Code system prompt contains ~50 instructions
  • Leave headroom for task-specific guidance
  • Quality degrades as instruction count increases

3. Communication Style

Writing for AI vs. Humans

"You're writing for Claude, not onboarding a junior dev - use short, declarative bullet points and don't write long, narrative paragraphs."

Preferred Style

  • Concise: 10 words > 30 words
  • Declarative: "Do X" not "You should consider doing X"
  • Action-oriented: Commands and instructions
  • Specific: Concrete over abstract

Example Comparison

Poor:

"When working on this project, developers should generally try to follow best practices for code organization and structure, keeping in mind that maintainability is important for long-term success."

Good:

  • Organize code by feature, not file type
  • Use descriptive names
  • Keep functions under 50 lines
  • Document public APIs

4. Progressive Disclosure

Principle

Reveal information just-in-time rather than upfront.

Implementation

## Quick Reference

Common commands: `npm run dev`, `npm test`

**For detailed workflows**, see:
- `docs/development.md` - Development processes
- `docs/deployment.md` - Deployment procedures
- `docs/testing.md` - Testing strategies

Benefits

  • Reduced token consumption
  • Focused context
  • Scalable documentation
  • Easier maintenance

5. Output Style Configuration

Available Styles

  • Normal: Balanced (default)
  • Concise: Direct, minimal
  • Explanatory: Educational, detailed
  • Formal: Polished, professional
  • Custom: User-defined

Custom Output Styles

Location: .claude/output-styles/[name].md

Example:

# Technical Writer Style

- Use active voice
- Define acronyms on first use
- Include code examples
- Provide step-by-step instructions
- Link to additional resources

6. Best Practices Summary

Structure

  • Use Markdown headings consistently
  • Organize content logically
  • Separate sections clearly
  • Include navigation aids

Content

  • Be specific and concrete
  • Provide examples
  • Use bullet points
  • Avoid paragraphs

Optimization

  • Test and iterate
  • Remove ineffective content
  • Use progressive disclosure
  • Monitor instruction count

Communication

  • Write for AI consumption
  • Use declarative style
  • Emphasize sparingly
  • Stay focused

7. Source References

  1. Anthropic Prompt Engineering Guide
  2. Claude Code Best Practices
  3. Effective Context Engineering

Last Updated: December 2025 Status: Production-validated best practices