Kalau kamu sudah mencoba Claude dan merasa outputnya "kurang pas" dibanding ChatGPT, bisa jadi masalahnya bukan di Claude — tapi di cara kamu prompt-nya. Claude memang punya preferensi unik dalam cara menerima instruksi, dan itu bukan kelemahan, tapi fitur yang bisa kamu manfaatkan untuk hasil lebih presisi.
Episode 1-3 series ini sudah cover dasar Claude — cara pakai, keunggulan, dan use case umum. Sekarang kita naik level: menguasai prompt engineering yang benar-benar match dengan "cara berpikir" Claude. Hasilnya? Output yang lebih konsisten, relevan, dan siap pakai tanpa banyak revisi.
Mengapa Claude Berbeda dari ChatGPT dalam Prompt?
Claude dilatih dengan filosofi "lebih baik instruksi eksplisit daripada asumsi user". Artinya, Claude akan lebih responsive kalau kamu:
- Memberikan struktur yang jelas (XML-style atau markdown header)
- Menulis konteks lengkap, bukan "membaca pikiran" user
- Menentukan persona/role secara tegas
- Specify output format dengan detail, bukan "asal yang penting jelas"
- Memberikan constraint eksplisit (length, tone, target audience)
Berbeda dengan ChatGPT yang sering "menebak" intent dari prompt minimal, Claude akan minta klarifikasi atau output secara literal dari apa yang kamu tulis. Ini yang bikin beberapa orang bilang Claude "rigid" — padahal sebenarnya kamu hanya perlu lebih presisi.
Struktur Prompt Claude yang Efektif
Template umum yang paling berhasil dengan Claude menggunakan struktur bertingkat:
<context>
[Konteks panjang, background, data yang relev]
</context>
<task>
[Task spesifik yang mau dilakukan]
</task>
<constraints>
- Constraint 1
- Constraint 2
</constraints>
<output_format>
[Spesifikasi format: Markdown, JSON, plain text, dll]
</output_format>Kamu nggak perlu pakai tag XML literal — tapi Claude jauh lebih responsif kalau ada separasi jelas antara konteks, task, constraint, dan format output. Kalau kamu gabung semua jadi satu paragraf panjang, Claude bakal lebih sering "bingung" atau output hasil yang belum optimal.
Persona + Role + Tone yang Eksplisit
Salah satu kekuatan Claude adalah kemampuan "roleplay" teknis. Tapi untuk hasil maksimal, kamu harus kasih persona dengan sangat spesifik:
You are an expert backend engineer with 10+ years experience in Python and databases. Your specialty is code review for performance and security issues. When reviewing code:
- Focus on algorithmic complexity first
- Flag security vulnerabilities explicitly
- Suggest refactoring only if it improves clarity or performance
- Use a direct, professional tone
- Avoid opinion-based feedbackInstruksi ini jauh lebih efektif daripada sekedar "please review my code". Claude akan paham exactly apa expertise yang kamu minta, angle apa yang harus dia fokus, dan tone apa yang diharapkan.
7 Template Prompt Siap Pakai untuk Berbagai Use Case
Template 1: Code Review
<context>
I'm reviewing Python code for a production service. The codebase uses FastAPI and PostgreSQL.
</context>
<task>
Review the following function for:
1. Performance bottlenecks
2. Security issues
3. Code readability
4. Potential edge cases
[PASTE CODE HERE]
</task>
<constraints>
- Be specific: point to exact lines
- Suggest fix only if severity is high or medium
- Don't suggest style changes (we use Black formatter)
- Focus on production-level concerns
</constraints>
<output_format>
Format as markdown with sections: Issues Found | Severity | Fix Suggestion
</output_format>Template 2: Debugging Assistance
<context>
I'm debugging a bug in a React application. The error happens intermittently under load.
Error message: [PASTE ERROR]
Environment: Node 18, React 18, latest Chrome
Steps to reproduce: [DESCRIBE]
</context>
<task>
Help me identify:
1. Root cause of this error
2. Why it's intermittent (not always happening)
3. How to fix it permanently
</task>
<constraints>
- Assume I'm familiar with React hooks and debugging tools
- Don't suggest "try reinstalling node_modules" unless absolutely necessary
- Focus on logical flow, not environment setup
</constraints>
<output_format>
1. My hypothesis (1-2 sentences)
2. How to verify (specific debugging steps)
3. Fix (code example if applicable)
</output_format>Template 3: Artikel Writing
<context>
I'm writing for a tech blog (DuaMasa Tech) targeting Indonesian developer audience. The tone should be santai-profesional. Previous articles use examples and avoid jargon without explanation.
Topic: How to optimize database queries in Django
</context>
<task>
Write an article outline + first 2 sections that:
1. Hook the reader with relatable problem
2. Explain why it matters
3. Provide 2 concrete Django-specific optimization techniques
</task>
<constraints>
- Target audience: mid-level Django developers (1-3 years experience)
- Avoid advanced ORM tricks; focus on practical wins
- Include 1 code example per technique
- Length: 800 words maximum
</constraints>
<output_format>
Markdown with heading hierarchy. Code blocks use triple backticks with python syntax highlighting.
</output_format>Template 4: Document Summarization
<task>
Summarize this document for me:
[PASTE DOCUMENT]
</task>
<constraints>
- Extract key points only (no minor details)
- Identify action items explicitly
- Flag any contradictions or unclear statements
- Target audience: executive summary level
- Use bullet points, not prose
</constraints>
<output_format>
- Key Points (3-5 bullets)
- Action Items (if any)
- Unclear/Ambiguous sections (if any)
- Recommended next step
</output_format>Template 5: API Documentation
<context>
I have a messy API endpoint that I need to document. It's a POST endpoint in a Django REST framework API.
Endpoint code:
[PASTE CODE]
Current status: partially documented, parameters unclear
</context>
<task>
Generate complete OpenAPI 3.0 documentation for this endpoint including:
1. Summary and description
2. All request parameters with types
3. Example request and response
4. Possible error codes and meanings
</task>
<constraints>
- Use proper OpenAPI 3.0 spec format (YAML)
- Make descriptions concise but clear
- Include validation rules in description
- Don't invent behavior; only document what code does
</constraints>
<output_format>
YAML format, ready to paste into OpenAPI spec file
</output_format>Template 6: Architecture Decision
<context>
We're deciding between two approaches for handling file uploads in our web app:
1. Direct upload to S3 via browser (presigned URL)
2. Upload to backend server, then move to S3
Project scale: 50k daily active users, mostly Indonesia, slow/variable internet
</context>
<task>
Compare both approaches in terms of:
1. User experience (speed, reliability)
2. Backend complexity
3. Cost implications
4. Security considerations
Which would you recommend and why?
</task>
<constraints>
- Assume backend is Python/Django
- Storage is AWS S3
- Budget is limited (startup)
- Focus on practical concerns, not theoretical purity
</constraints>
<output_format>
Structured comparison table (Pro/Con), then recommendation with reasoning
</output_format>Template 7: Learning Explanation
<role>
You are a patient mentor explaining technical concepts to junior developers. Use analogies and real-world examples. Avoid showing off with advanced terminology.
</role>
<task>
Explain what a database index is and why it matters.
</task>
<constraints>
- Assume reader knows what a database table is
- Start with an analogy
- Include 1 visual comparison (prose description)
- Explain trade-off (why not index everything?)
- Suggest when to use
- Length: 300-400 words
</constraints>
<output_format>
Markdown with clear sections. Use **bold** for key terms.
</output_format>Pro Tips untuk Hasil Maksimal
- Lebih banyak context lebih baik. Claude tidak "baca pikiran". Kalau konteks kurang, dia akan output umum atau minta klarifikasi. Jadi generous dengan detail.
- Gunakan markdown header untuk organizing. Claude responsif dengan struktur visual — bukan hanya XML tag, tapi juga # ## ### membantu clarity.
- Specify "tidak" seserik "iya". Katakan explicitly apa yang JANGAN dilakukan ("don't suggest refactoring style" atau "don't use advanced ORM tricks"). Claude bakal lebih nurut pada negatif constraint.
- Output format matters. Claude akan deliver output exactly dalam format yang kamu specify. Mau JSON? Mau Markdown? Mau Python code? Spell it out.
- Chain of thought bisa diexplicit. Kalau kamu minta Claude "show your reasoning step by step", output jadi lebih detailed dan transparent — bagus untuk debugging logic.
Kesimpulan
Claude bukan "version ganteng dari ChatGPT" yang siap paham apa maksud kamu dari prompt minimal. Claude adalah tool yang merespons terbaik pada instruksi yang jelas, terstruktur, dan eksplisit. Kalau kamu invest waktu untuk nulis prompt yang well-formed — dengan context, task, constraint, dan output format yang jelas — hasilnya bakal jauh lebih presisi dan langsung bisa pakai.
Coba gunakan 7 template di atas sebagai starting point untuk use case kamu, kemudian adapt sesuai kebutuhan. Semakin spesifik dan terstruktur prompt kamu, semakin consistent dan valuable output dari Claude. Happy prompting!