Learn Claude Prompt Engineering Course


01 Jun 2025 / by KhanhIceTea

Today I learned the course of Claude Prompt Engineering on Github

This is my fork and python notebook : https://github.com/khanhicetea/prompt-eng-interactive-tutorial

Main ideas I learned for the courses

  1. Be Clear and Direct : system prompt (instruct AI how to behave) > user prompt (asking 5W for answer)
  2. Role Acting : change role => change POV of AI => change how it read the question => change how it think and calculate the prob to answer
  3. Separating Data and Instructions : Instruction like a barebone to filling data (so put data in xml tag with semantic tag name making good structure of prompts)
  4. Formating output, prefill : instruct AI to put desired answer data into a specified xml - json, or prefill seeding answer (feed the prefix answer to let it continue)
  5. Precognition : "Thinks only counts when it's out loud." => Instruct it write its thinking in a format step-by-step, then answer the conclusion (because LLM works by calculate next tokens by previous token so no previous tokens mean no thinking - no data). Btw, the ordering is matter (GOOD -> BAD = BAD ; BAD -> GOOD = GOOD), the later is matter.
  6. Few shots prompting : shots mean examples of question - answer pair, it provide context, how to answer, how to act, how to deal edge-cases by examples
  7. Avoid hallucinations : Give it an out (instruct AI how to behave when its data can fulfill the answer by denying reply) + Guide AI write out the quotes from long documents for evidences first the try to answer based on these evidences
  8. Complex prompting : Give AI a good structure about these components
    1. Task Context : Role + Goal (must have)
    2. Tone Context : AI tone when answer (optional)
    3. Task Description : Rules to follow (do + don't) + Outer way (out of scope)
    4. Examples : more examples more edge-cases (optional but should have)
    5. Input Data : additional data - user files, web search, documents, RAG (optional)
    6. Intermidate Task : user question, what to do (must have)
    7. Precognition : guide it thinking, step-by-step, make whiteboard, make scratchpad for complex tasks (thinking out loud)
    8. Output Formatting : how AI answer formating text (optional - should have)
    9. Prefill - talk for AI (should have)

Quote of the day

Thinks only counts when it's out loud.


Sound good ?


Read more
about #ai