Skip to content

Lesson 01

What a prompt actually is (and why almost nobody gets it)

Before optimizing anything, let's understand what really happens when you talk to a model. No vague metaphors — the real mechanics.


The sentence that changes everything

An LLM does not understand your question. It predicts the next most likely token (≈ chunk of a word), given the previous ones. It is a probability calculator over text.

When you take this literally, you start writing better prompts — because the trick is not to “talk nicely”. The trick is to build a context that makes the answer you want inevitable.

The best prompt is not the one that asks for more. It’s the one that leaves the least room for ambiguity.

Anatomy of an API call

Here is a minimal call to Claude:

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();

const res = await client.messages.create({
  model: "claude-opus-4-7",
  max_tokens: 1024,
  messages: [
    { role: "user", content: "Explain what an LLM is in one sentence." },
  ],
});

console.log(res.content[0].text);

Three pieces, only three:

  1. model — which brain you are using. Bigger ≠ always better.
  2. messages — the history. Each message has a role (user or assistant) and content.
  3. max_tokens — the response cap. Too low and it gets cut off.

Your first experiment

Change the question three times and watch the output shift.

const prompts = [
  "Explain what an LLM is.",
  "Explain what an LLM is as if I were 10 years old.",
  "Explain what an LLM is in exactly 12 words, no metaphors.",
];

for (const p of prompts) {
  const res = await client.messages.create({
    model: "claude-haiku-4-5",
    max_tokens: 200,
    messages: [{ role: "user", content: p }],
  });
  console.log("→", p);
  console.log(res.content[0].text);
  console.log("---");
}

The model is the same. The gap between the three answers is the whole value you will learn to control in this course.

Beginner mistakes

  • “Do it well” → well for whom? Be concrete about audience and format.
  • “Be creative” → it already is; what you need is to constrain, not to free.
  • 800-word messages → more text ≠ better answer. More text = more cost and more noise.

Lesson challenge

Rewrite this bad prompt so it returns exactly what it asks:

Give me business ideas

Hint: specify sector, budget, number of ideas, and output format. In the next lesson you will see the full anatomy of a good prompt.


LEVEL 2

Pro challenge

Pro challenge for this lesson

Same idea, no hints, graded by automated tests.

Unlock Pro Mode · €19 One-time payment · lifetime access · no subscription
LEVEL 3

Hard Mode

Hard Mode

Extreme variant of the challenge. Time-bound with extra constraints.

Unlock Pro Mode · €19 One-time payment · lifetime access · no subscription